Converting a model from 2d to 3d

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

Moderators: silvia, selimgunay, Moderators

Post Reply
jazzieman
Posts: 6
Joined: Thu Jul 09, 2020 4:18 pm
Location: Mayaguez, Puerto Rico

Converting a model from 2d to 3d

Post by jazzieman » Wed Sep 23, 2020 9:40 am

I'm currently working in a simple model of a RC circular contilever column (fibers). I performed gravity, pushover, and dynamic anlysis for calibration on the 2d model with no problems. I'm now trying to create a 3d model of the column. I changed the -ndm and -ndf as required, but when the model is built (without error messages) when I ask for the strainStress, don't get any. Don't know what I'm doing wrong (I'm new to openseespy been working only a couple of months and is my first try to build a 3d model). This is part of the code (2d first):

Code: Select all

# =============================================================================
# III. MATERIAL DEFINITIONS
# =============================================================================

# Materials -----
     # 1: Cover Concrete (Unconfined)
ops.uniaxialMaterial('Concrete01', 1, -fpcu*1e6, -epsc0, 0, -epsU)  

     # 2: Core Concrete (Confined)
ops.uniaxialMaterial('Concrete01', 2, -fpcc*1e6, -eps_cc, -fcu*1e6, -ecu)

     # 3: Reinforcing Steel
ops.uniaxialMaterial('ReinforcingSteel', 3, fyBars*1e6, fuBars*1e6, Es*1e6, 
                     Esh*1e6, eps_sh, eps_ult, '-CMFatigue', cf, alpha,
                     cd,'-MPCurveParams', R1, R2, R3)

print('Materials and Element Properties Done!'); print('\n')


# =============================================================================
# IV. DOF AND NODES
# =============================================================================

# Model Bulder -----
ops.model("basic","-ndm", 2,"-ndf", 3)

# Create Nodes -----
ops.node(1, 0.0, 0.0)
ops.node(2, 0.0, LCol/1000) 

# Add Mass -----
mass = SS_W*1000/(g/1000)
ops.mass(2, *[mass, mass, 0])

# Constraints -----
ops.fix(1,*[1,1,1])

print('Nodal Coords., Boundary Cond., and Mass Done!'); print('\n')


# =============================================================================
# V. SECTION AND ELEMENTS
# =============================================================================

# Section Definition -----
ops.section('Fiber', 1)

    # 1: Patches
        # A: Cover Concrete
ops.patch('circ', 1, 3, 40, *[0 , 0], *[Ds/(2*1000), DCol/(2*1000)], *[0, 360]) 

        # B: Core Concrete
ops.patch('circ', 2, 20, 40, *[0 , 0], *[0 ,     Ds/(2*1000)], *[0, 360]) 
        
        # C: Reinforcing Steel (using layer)
rBars   = Ds/2-0.5*DHoops-0.5*DBars                 # Radius to center of long rebar
theta   = 360.0/NumBars                             # Angle increments to long rebar
ops.layer('circ', 3, NumBars, ABars/1000**2, *[0.0 ,0.0], rBars/1000, *[10, 350])

# Coordinates of rebars ----
xBar = np.zeros([NumBars])                          # array with x-coord of rebars
yBar = np.zeros([NumBars])                          # array with y-coord of rebars         

for i in range(NumBars):
    xBar[i], yBar[i] = [rBars/1000*np.cos((10+i*theta)*np.pi/180),rBars/1000*np.sin((10+i*theta)*np.pi/180)]
       
# Geometric Transformation ----
ops.geomTransf('PDelta', 1)

# Beam Integration -----
ops.beamIntegration('HingeRadau', 1, 1, (Lp/1000), 1, 0, 1)

# Element Definition
ops.element('forceBeamColumn', 1, *[1, 2], 1, 1)

print('Section and Element Generation Done!'); print('\n')

# =============================================================================
# VI. GRAVITY ANALYSIS
# =============================================================================

# Define Gravity ----
ops.timeSeries('Linear', 1)
ops.pattern('Plain', 1, 1)
ops.load(2, *[0, -SS_W*1000, 0])

# Parameters (Load Controlled Static Analysis)
ops.constraints('Plain')
ops.numberer('Plain')
ops.system('BandGeneral')
ops.test('NormDispIncr',1e-10, 6)
ops.algorithm("Newton")
ops.integrator('LoadControl', 1/10)
ops.analysis("Static")
ops.analyze(10)
ops.loadConst('-time', 0.0)
ops.wipeAnalysis()

print('Gravity Analysis Done!'); print('\n'); 
print('Model Built!'); print('\n'); print('\n');
when I use the command (for the cover concrete fiber): ops.eleResponse(1, '-section','1', '-fiber','-.6095','0','1','stressStrain')
I get these: [-2756711.363215994, -8.805447541750114e-05]

Now when I try the 3d...

Code: Select all

# =============================================================================
# III. MATERIAL DEFINITIONS
# =============================================================================

# Materials -----
     # 1: Cover Concrete (Unconfined)
ops.uniaxialMaterial('Concrete01', 1, -fpcu*1e6, -epsc0, 0, -epsU)  

     # 2: Core Concrete (Confined)
ops.uniaxialMaterial('Concrete01', 2, -fpcc*1e6, -eps_cc, -fcu*1e6, -ecu)

     # 3: Reinforcing Steel
ops.uniaxialMaterial('ReinforcingSteel', 3, fyBars*1e6, fuBars*1e6, Es*1e6, 
                     Esh*1e6, eps_sh, eps_ult, '-CMFatigue', cf, alpha,
                     cd,'-MPCurveParams', R1, R2, R3)

print('Materials and Element Properties Done!'); print('\n')


# =============================================================================
# IV. DOF AND NODES
# =============================================================================

# Model Bulder -----
ops.model("basic","-ndm", 3,"-ndf", 6)

# Create Nodes -----
ops.node(1, 0.0, 0.0, 0.0)
ops.node(2, 0.0, LCol/1000, 0.0) 

# Add Mass -----
mass = SS_W*1000/(g/1000)
ops.mass(2, *[mass, 0.0, mass])

# Constraints -----
ops.fix(1,*[1,1,1,1,1,1])

print('Nodal Coords., Boundary Cond., and Mass Done!'); print('\n')


# =============================================================================
# V. SECTION AND ELEMENTS
# =============================================================================

# Section Definition -----
ops.section('Fiber', 1, '-GJ', 1e100)

    # 1: Patches
        # A: Cover Concrete
ops.patch('circ', 1, 3, 40, *[0 , 0], *[Ds/(2*1000), DCol/(2*1000)], *[0, 360]) 

        # B: Core Concrete
ops.patch('circ', 2, 20, 40, *[0 , 0], *[0 ,     Ds/(2*1000)], *[0, 360]) 
        
        # C: Reinforcing Steel
rBars   = Ds/2-0.5*DHoops-0.5*DBars                 # Radius to center of long. rebar
theta   = 360.0/NumBars                             # Angle increments to long. rebar
ops.layer('circ', 3, NumBars, ABars/1000**2, *[0.0 ,0.0], rBars/1000, *[10, 350])

# Coordinates of rebars (for later use) ----
xBar = np.zeros([NumBars])                          # array with x-coord of rebars
yBar = np.zeros([NumBars])                          # array with y-coord of rebars         

for i in range(NumBars):
    xBar[i], yBar[i] = [rBars/1000*np.cos((10+i*theta)*np.pi/180),
                        rBars/1000*np.sin((10+i*theta)*np.pi/180)]
    
       
# Geometric Transformation ----
ops.geomTransf('PDelta', 1, *[0, 0 , 1])

# Beam Integration -----
ops.beamIntegration('HingeRadau', 1, 1, (Lp/1000), 1, 0, 1)

# Element Definition
ops.element('forceBeamColumn', 1, *[1, 2], 1, 1)

print('Section and Element Generation Done!'); print('\n')


# =============================================================================
# VI. GRAVITY ANALYSIS
# =============================================================================

# Define Gravity ----
ops.timeSeries('Linear', 1)
ops.pattern('Plain', 1, 1)
ops.load(2, *[0.0, -SS_W*1000, 0.0, 0.0, 0.0, 0.0])

# Parameters (Load Controlled Static Analysis)
ops.constraints('Plain')
ops.numberer('Plain')
ops.system('BandGeneral')
ops.test('NormDispIncr',1e-10, 6)
ops.algorithm("Newton")
ops.integrator('LoadControl', 1/10)
ops.analysis("Static")
ops.analyze(10)
ops.loadConst('-time', 0.0)
ops.wipeAnalysis()

print('Gravity Analysis Done!'); print('\n'); 
print('Model Built!'); print('\n'); print('\n');

# Beam Integration -----
ops.beamIntegration('HingeRadau', 1, 1, (Lp/1000), 1, 0, 1)

# Element Definition
ops.element('forceBeamColumn', 1, *[1, 2], 1, 1)

print('Section and Element Generation Done!'); print('\n')

ops.recorder('Element', '-file', 'ForcaeColSec12.out','-time', '-ele', 1, 'section', 1, 'force')

# =============================================================================
# VI. GRAVITY ANALYSIS
# =============================================================================

# Define Gravity ----
ops.timeSeries('Linear', 1)
ops.pattern('Plain', 1, 1)
ops.load(2, *[0.0, -SS_W*1000, 0.0, 0.0, 0.0, 0.0])

# Parameters (Load Controlled Static Analysis)
ops.constraints('Plain')
ops.numberer('Plain')
ops.system('BandGeneral')
ops.test('NormDispIncr',1e-10, 6)
ops.algorithm("Newton")
ops.integrator('LoadControl', 1/10)
ops.analysis("Static")
ops.analyze(10)
ops.loadConst('-time', 0.0)
ops.wipeAnalysis()

print('Gravity Analysis Done!'); print('\n'); 
print('Model Built!'); print('\n'); print('\n');
annd use command: (to get stressStrain of concrete cover) I get nothing.
ops.eleResponse(1, '-section','1', '-fiber','-.6095','0','1','stressStrain')
Alan Rivera
Ph.D. Candidate Structural Engineering
University of Puerto Rico, Mayaguez Campus

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

Re: Converting a model from 2d to 3d

Post by mhscott » Thu Sep 24, 2020 11:27 am

Unfortunately, there's an inconsistency in what the 2d and 3d forceBeamColumn elements recognize for recorders and eleResponse.

2d recognizes '-section' and 'section' but 3d only recognizes 'section'. Try removing the '-' in the 3d version and see if it works. If it does work, I'll update the source code.

jazzieman
Posts: 6
Joined: Thu Jul 09, 2020 4:18 pm
Location: Mayaguez, Puerto Rico

Re: Converting a model from 2d to 3d

Post by jazzieman » Thu Sep 24, 2020 11:58 am

Professor Scott,

I tried 'section' (without the '-'), and it worked!!! That definitely solved the problem. I would have never figured it out by myself. Thanks a lot!!
Alan Rivera
Ph.D. Candidate Structural Engineering
University of Puerto Rico, Mayaguez Campus

Post Reply