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
Nino