eleResponse for 3d moment-curvature analysis

Forum for asking and answering questions related to use of the OpenSeesPy module

Moderators: silvia, selimgunay, Moderators

Post Reply
SpinoWeb
Posts: 2
Joined: Sat Mar 20, 2021 1:38 am
Contact:

eleResponse for 3d moment-curvature analysis

Post by SpinoWeb » Sat Mar 20, 2021 2:29 am

Hello,
I'm currently trying to create a 3d model of a simple RC rectangular fiber section.
By following the example at this link https://openseespydoc.readthedocs.io/en ... ature.html, I was able to perform a moment-curvature analysis, but when I ask for the strainStress (eleResponse) for a rebar, I always get [0.0, 0.0].
Don't know what I'm doing wrong. This is part of the code:

Code: Select all

#from openseespy.opensees import *
import openseespy.opensees as op


nodeI = 101
nodeJ = 102
ele1  = 201
secTag = 1

ku = 0.05 / 1.0e3 # 1/m => 1/mm
nk = 50
Plo = 0.0 * 1.0e3 # kN => N

# --------------------
# start opensees
# --------------------
op.wipe()

# Define model builder
op.model('basic', '-ndm', 3, '-ndf', 6)

# Uniaxialmaterial
# ------------------------------------------
op.uniaxialMaterial('Concrete01', 1, -20.0,  -0.002,  -20.0,  -0.0035)
op.uniaxialMaterial('Steel01', 3, 400.0, 200000.0, 0.01)

# fiber section
# ------------------------------------------
h = 600.0
cover = 25.0
bw = 300.0
As = 201.0
y1 = h / 2
z1 = bw / 2
op.section('Fiber', secTag, '-GJ', 1.0e99)
op.patch('rect', 1, 6, 3, -y1, -z1, y1, z1)

op.layer('straight', 3, 3, As, y1-cover, z1-cover, y1-cover, cover-z1)
op.layer('straight', 3, 2, As, cover-y1, z1-cover, cover-y1, cover-z1)

# geometry
# ------------------------------------------
# Define two nodes at (0,0,0)
op.node(nodeI, 0.0, 0.0, 0.0)
op.node(nodeJ, 0.0, 0.0, 0.0)

# Fix all degrees of freedom except axial and bending
op.fix(nodeI, 1, 1, 1, 1, 1, 1)
op.fix(nodeJ, 0, 1, 1, 1, 1, 0)

# Define element
#                             tag   ndI    ndJ    secTag
op.element('zeroLengthSection',  ele1, nodeI, nodeJ, secTag)

# Create recorders
fiber_stressStrain = op.eleResponse(ele1, 'section', 'fiber', str(y1 - cover), str(z1 - cover), str(3), 'stressStrain')
fiber_stress = op.eleResponse(ele1, 'section', 'fiber', str(y1 - cover), str(z1 - cover), str(3), 'stress')
fiber_strain = op.eleResponse(ele1, 'section', 'fiber', str(y1 - cover), str(z1 - cover), str(3), 'strain')

# Define constant axial load
op.timeSeries('Constant', 301)
op.pattern('Plain', 301, 301)
op.load(nodeJ, Plo, 0.0, 0.0, 0.0, 0.0, 0.0)

# Define analysis parameters
op.integrator('LoadControl', 0.0, 1.0, 0.0, 0.0)
#op.integrator('LoadControl', 0.0)
op.system('SparseGeneral', '-piv')
op.test('EnergyIncr', 1e-9, 10)
#op.test('NormUnbalance', 1e-9, 10)
op.numberer('Plain')
op.constraints('Plain')
op.algorithm('Newton')
op.analysis('Static')

# Do one analysis for constant axial load
op.analyze(1)

# keep axial load constant and reset time
op.loadConst('-time', 0.0)

# Define reference moment
op.timeSeries('Linear', 302)
op.pattern('Plain', 302, 302)
op.load(nodeJ, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0)

# Compute curvature increment
dK = ku / nk
#print(ku, nk, dK)

# Use displacement control at nodeJ for section analysis
op.integrator('DisplacementControl', nodeJ, 6, dK, 1, dK, dK)

# Do the section analysis
#ok = analyze(nk)
j = 0
while j <= nk:
    j += 1
    ok = op.analyze(1)
    print(fiber_stressStrain, fiber_stress, fiber_strain)
    # here return [0.0, 0.0] [0.0] [0.0] for each step
Thanks in advance for your kind reply.
Nino

mhscott
Posts: 569
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: eleResponse for 3d moment-curvature analysis

Post by mhscott » Sat Mar 20, 2021 6:45 am

You need to put the calls to eleResponse inside the analysis loop.

Also, your GJ value of 1e99 is way too large! Not a problem here because the DOF is fixed, but would definitely cause problems in a building model.

Code: Select all

# Do the section analysis
#ok = analyze(nk)
j = 0
while j <= nk:
    j += 1
    ok = op.analyze(1)
    fiber_stressStrain = op.eleResponse(ele1, 'section', 'fiber', str(y1 - cover), str(z1 - cover), str(3), 'stressStrain')
    fiber_stress = op.eleResponse(ele1, 'section', 'fiber', str(y1 - cover), str(z1 - cover), str(3), 'stress')
    fiber_strain = op.eleResponse(ele1, 'section', 'fiber', str(y1 - cover), str(z1 - cover), '3', 'strain')    
    print(fiber_stressStrain, fiber_stress, fiber_strain)

mhscott
Posts: 569
Joined: Tue Jul 06, 2004 3:38 pm
Location: Corvallis, Oregon USA
Contact:

Re: eleResponse for 3d moment-curvature analysis

Post by mhscott » Sat Mar 20, 2021 6:59 am

eleResponse is like a real-time recorder, giving you values only for the current time when the command is called.

SpinoWeb
Posts: 2
Joined: Sat Mar 20, 2021 1:38 am
Contact:

Re: eleResponse for 3d moment-curvature analysis

Post by SpinoWeb » Sat Mar 20, 2021 9:11 am

Thank you, your answer has been very helpful!

Post Reply