Example #1
0
def elastic_section(section_id):

    e_conc = 30e6
    area = 0.3 * 0.4
    inertia = 0.3 * 0.4 ** 3 / 12

    op.section("Elastic", section_id, *[e_conc, area, inertia])
Example #2
0
def run(arg_1, arg_2, arg_3, arg_4):
    ops.reset()
    ops.wipe()

    ops.model('basic', '-ndm', 3, '-ndf', 6)

    ops.node(1, 0.0, 0.0, 0.0)
    ops.node(2, 0.0, 3.2, 0.0)
    ops.fix(1, 1, 1, 1, 1, 1, 1)

    ops.uniaxialMaterial('Concrete01', 1, -80.0e6, -0.002, 0.0, -0.005)

    ops.section('Fiber', 1, '-GJ', 1)
    ops.patch('rect', 1, 10, 10, -0.8, -0.1, 0.8, 0.1)

    ops.geomTransf('Linear', 1, 0, 0, 1)
    ops.beamIntegration('Legendre', 1, 1, 10)
    ops.element('dispBeamColumn', 1, 1, 2, 1, 1)

    ops.timeSeries('Linear', 1)
    ops.pattern('Plain', 1, 1)
    ops.load(2, 0, -24586.24, 0, 0, 0, 0)

    ops.constraints('Plain')
    ops.numberer('RCM')
    ops.system('UmfPack')
    ops.test('NormDispIncr', 1.0e-6, 2000)
    ops.algorithm('Newton')
    ops.integrator('LoadControl', 0.01)
    ops.analysis('Static')
    ops.analyze(100)

    ops.wipeAnalysis()
    ops.loadConst('-time', 0.0)

    ops.recorder('Node', '-file', 'disp.out', ' -time',
                 '-node',  2, '-dof', 1, 'disp')
    ops.recorder('Node', '-file', 'react.out', '-time ',
                 '-node', 2, '-dof', 1, 'reaction')

    ops.timeSeries('Linear', 2)
    ops.pattern('Plain', 2, 2)
    ops.load(2, 11500, 0, 0, 0, 0, 0)
    ops.constraints('Plain')
    ops.numberer('RCM')
    ops.system('UmfPack')
    ops.test('NormDispIncr', 1.0, 2000)
    ops.algorithm('Newton')
    ops.integrator('LoadControl',  0.01)
    ops.analysis('Static')
    # ops.analyze(100)

    step = 100
    data = np.zeros((step, 2))
    for i in range(step):
        ops.analyze(1)
        data[i, 0] = ops.nodeDisp(2, 1)
        data[i, 1] = ops.getLoadFactor(2) * 11500
    return data
    def define_section(self, w, h, mesh_size, Ti=20, Tp=300):
        '''
        Define empty section.
        
        Args:
            w: An integer section width (z axis).
            h: An integer section height (y axis).
            mesh_size: A tuple mesh size in along z and y axes.
            Ti: An integer ambient temperature, Celsius (default=20C).
            Tp: An integer surface burning temperature, Celsius (default=300C).
        '''

        self.section = Section(w, h, Ti, Tp)
        self.section.discretise(mesh_size)
        ops.section('Fiber', 1)
Example #4
0
def section_create():
    ''' section create
    '''
    ops.section('Fiber', 1, '-GJ', 1)
    ops.fiber(-1.250E+002, -2.500E+002, 5.000E+003, 2)
    ops.fiber(-7.500E+001, -2.500E+002, 5.000E+003, 2)
    ops.fiber(-2.500E+001, -2.500E+002, 5.000E+003, 2)
    ops.fiber(2.500E+001, -2.500E+002, 5.000E+003, 2)
    ops.fiber(7.500E+001, -2.500E+002, 5.000E+003, 2)
    ops.fiber(1.250E+002, -2.500E+002, 5.000E+003, 2)
    ops.fiber(-1.250E+002, -1.500E+002, 5.000E+003, 2)
    ops.fiber(-7.500E+001, -1.500E+002, 5.000E+003, 2)
    ops.fiber(-2.500E+001, -1.500E+002, 5.000E+003, 2)
    ops.fiber(2.500E+001, -1.500E+002, 5.000E+003, 2)
    ops.fiber(7.500E+001, -1.500E+002, 5.000E+003, 2)
    ops.fiber(1.250E+002, -1.500E+002, 5.000E+003, 2)
    ops.fiber(-1.250E+002, -5.000E+001, 5.000E+003, 2)
    ops.fiber(-7.500E+001, -5.000E+001, 5.000E+003, 2)
    ops.fiber(-2.500E+001, -5.000E+001, 5.000E+003, 2)
    ops.fiber(2.500E+001, -5.000E+001, 5.000E+003, 2)
    ops.fiber(7.500E+001, -5.000E+001, 5.000E+003, 2)
    ops.fiber(1.250E+002, -5.000E+001, 5.000E+003, 2)
    ops.fiber(-1.250E+002, 5.000E+001, 5.000E+003, 2)
    ops.fiber(-7.500E+001, 5.000E+001, 5.000E+003, 2)
    ops.fiber(-2.500E+001, 5.000E+001, 5.000E+003, 2)
    ops.fiber(2.500E+001, 5.000E+001, 5.000E+003, 2)
    ops.fiber(7.500E+001, 5.000E+001, 5.000E+003, 2)
    ops.fiber(1.250E+002, 5.000E+001, 5.000E+003, 2)
    ops.fiber(-1.250E+002, 1.500E+002, 5.000E+003, 2)
    ops.fiber(-7.500E+001, 1.500E+002, 5.000E+003, 2)
    ops.fiber(-2.500E+001, 1.500E+002, 5.000E+003, 2)
    ops.fiber(2.500E+001, 1.500E+002, 5.000E+003, 2)
    ops.fiber(7.500E+001, 1.500E+002, 5.000E+003, 2)
    ops.fiber(1.250E+002, 1.500E+002, 5.000E+003, 2)
    ops.fiber(-1.250E+002, 2.500E+002, 5.000E+003, 2)
    ops.fiber(-7.500E+001, 2.500E+002, 5.000E+003, 2)
    ops.fiber(-2.500E+001, 2.500E+002, 5.000E+003, 2)
    ops.fiber(2.500E+001, 2.500E+002, 5.000E+003, 2)
    ops.fiber(7.500E+001, 2.500E+002, 5.000E+003, 2)
    ops.fiber(1.250E+002, 2.500E+002, 5.000E+003, 2)
    ops.fiber(-1.150E+002, 2.650E+002, 3.900E+002, 1)
    ops.fiber(1.150E+002, 2.650E+002, 3.900E+002, 1)
    ops.fiber(-1.150E+002, -2.650E+002, 4.900E+002, 1)
    ops.fiber(0.000E+000, -2.650E+002, 4.900E+002, 1)
    ops.fiber(1.150E+002, -2.650E+002, 4.900E+002, 1)

    ops.beamIntegration('Legendre', 1, 1, 10)
    logger.info("section created")
Example #5
0
def ops_section():
    ''' define section '''
    # 保护层壳
    ops.section('LayeredShell', 1, 4, 2, 50/1000,
                2, 50/1000, 2, 50/1000, 2, 50/1000)
    # 加强区壳
    ops.section('LayeredShell', 2, 10,
                2, 20/1000,          # 保护层
                6, 1.28177/1000,     # 箍筋层
                2, 26.239/1000,      # 核心区混凝土
                2, 26.239/1000,      # 核心区混凝土
                2, 26.239/1000,      # 核心区混凝土
                2, 26.239/1000,      # 核心区混凝土
                2, 26.239/1000,      # 核心区混凝土
                2, 26.239/1000,      # 核心区混凝土
                6, 1.28177/1000,     # 箍筋层
                2, 20/1000           # 保护层
                )
    # 中部壳
    ops.section('LayeredShell', 3, 12,
                2, 20/1000,              # 保护层
                6, 0.65345127/1000,      # 箍筋层
                7, 0.6544985/1000,       # 纵筋层
                2, 26.2274/1000,         # 核心区混凝土
                2, 26.2274/1000,         # 核心区混凝土
                2, 26.2274/1000,         # 核心区混凝土
                2, 26.2274/1000,         # 核心区混凝土
                2, 26.2274/1000,         # 核心区混凝土
                2, 26.2274/1000,         # 核心区混凝土
                7, 0.6544985/1000,       # 纵筋层
                6, 0.65345127/1000,      # 箍筋层
                2, 20/1000               # 保护层
                )

    ops.section('Fiber', 4, '-GJ', 1)
    # 端部 GFRP 拉锁
    ops.patch('circ', 3, 10, 10, 0, 0, 0, 0.01414, 0, 360)
    # 端部 SFCB 纵筋
    ops.patch('circ', 4, 10, 10, 0, 0.015, 0, 0.01414, 0, 360)
    ops.beamIntegration('Legendre', 1, 1, 9)
    # 0 1 0

    # 端部 SFCB 拉锁
    ops.section('Fiber', 5, '-GJ', 1)
    ops.patch('circ', 4, 10, 10, 0, 0, 0, 0.01414, 0, 360)
    ops.beamIntegration('Legendre', 2, 2, 9)

    ops.geomTransf('Linear', 1, 0, 1, 0)
Example #6
0
def set_section():
    '''
    @Brief set section
    '''
    confined_region_1: float = [
        30, 0.015, 7, 0.0001839, 7, 0.0003676, 30, 0.039743, 30, 0.039743, 30,
        0.039743, 30, 0.039743, 7, 0.0003676, 7, 0.0001839, 30, 0.015
    ]
    middle_region_1: float = [
        30, 0.015, 7, 0.0001839, 6, 0.0002356, 30, 0.08458, 30, 0.08458, 6,
        0.0002356, 7, 0.0001839, 30, 0.015
    ]

    ops.section('LayeredShell', 1, 10, *confined_region_1)
    logger.info("confined region with [1]")
    logger.info(confined_region_1)

    ops.section('LayeredShell', 2, 8, *middle_region_1)
    logger.info("middle region with [2]")
    logger.info(middle_region_1)
Example #7
0
def ops_material():
    # 中部混凝土
    ops.nDMaterial('PlaneStressUserMaterial', 1, 40, 7, 31.7, 3.17, -6.34,
                   -0.00234, -0.03, 0.001, 0.05)
    ops.nDMaterial('PlateFromPlaneStress', 2, 1, 1.23e9)

    # 端部拉锁
    ops.uniaxialMaterial('Steel02', 3, 156.9375, 7937500, 1e-15)
    # 端部纵筋
    ops.uniaxialMaterial('Steel02', 4, 348.7, 170.931e6, 0.2210)
    # 中部纵筋和箍筋
    ops.uniaxialMaterial("Steel02", 5, 257.5, 131.378e6, 0.320)

    # 中部箍筋层
    ops.nDMaterial("PlateRebar", 6, 5, 0)
    # 中部纵筋层
    ops.nDMaterial("PlateRebar", 7, 5, 90)
    # 边缘区混凝土
    ops.uniaxialMaterial('Concrete01', 6, -31.7, -0.00234, 0.0, -0.005)

    # 中部壳
    ops.section('LayeredShell', 1, 12, 2, 20, 6, 0.65345127, 7, 0.6544985, 2,
                26.2274, 2, 26.2274, 2, 26.2274, 2, 26.2274, 2, 26.2274, 2,
                26.2274, 7, 0.6544985, 6, 0.65345127, 2, 20)
    # 边缘约束区
    ops.section('Fiber', 2, '-GJ', 0)
    # 混凝土
    ops.fiber(100, 0, 40000, 6)
    # 端部SFCB纵筋
    ops.fiber(0, 100, 314, 4)
    ops.fiber(0, -100, 314, 4)
    ops.fiber(100, 100, 314, 4)
    ops.fiber(100, -100, 314, 4)
    ops.fiber(200, 100, 314, 4)
    ops.fiber(200, -100, 314, 4)
    # 端部GFRP拉锁
    ops.fiber(200, 70, 314, 3)
    ops.fiber(200, -70, 314, 3)
Example #8
0
def section_creator(sectag, matcore, matcover, matsteel, d, b, cc, fi, bartop, 
                      nsuby, nsubz, fibot=0, barbot=0, fiside = 0, barside = 0, angle = 0, print_section = False):
    """
    Introduction
    ------------
    This function generate a fiber section for openseespy framework.
    It is implemented for RC section, with the possibility to Plot the section,
    and to rotate the RcSection by a given angle.
    As output the function will generate the give section on openseespy model.
    
     Information
     -----------
        Author: Gaetano Camarda, Ph.D. Student in Structural Engineer
        Affiliation: University of Palermo
        e-mail: [email protected]
        
                                                                     V1.0 2020
    Package needed
    --------------
    - Openseespy
    - Openseespy.postprocessing
    - matplotlib
    - numpy
    
    
    Input:
    ------
        sectag, the sectiontag in the model
        matcore, material for confined core concrete
        matcover, material for concrete cover
        matsteel, material for reinforcement
        d, section depth
        b, section base length
        cc, cover length
        fi, top bar diameter
        bartop, number of top bar; if barbot is not specidied, bartop will be used
        nsuby, fiber subdivision along y axis
        nsubz, fiber subdivision along z axis
        
    Optional input:
    ---------------
        fibot, diameter of bottom reinforcement if different from top
        barbot, number of bottom reinforcement if different from top
        fiside, diameter of side bar
        barside, number of side bar (How to use:
                                     if for example you need 4 bars, you have to
                                     input barside = 2, because the other 2 bars
                                     are inserted in bartop and bottom)
        angle, angle if you need to rotate section, for example angle = 90
        print_section, plot the section defined
    """
    if fibot == 0:
        fibot = fi
    if barbot == 0:
        barbot = bartop
        
    import openseespy.opensees as ops
    import openseespy.postprocessing.ops_vis as opsv
    import matplotlib.pyplot as plt
    from numpy import power
    from numpy import pi
    ymax = b / 2
    zmax = d / 2
    ymin = ymax - cc
    zmin = zmax - cc
    Abar = pi * power(fi/2,2)
    Abarbot = pi * power(fibot/2,2)
    Abarside = pi * power(fiside/2,2)
    lside = d - (2*cc)
    bside = lside / (barside + 2) + (lside / (barside + 2))/(barside+2) # TODO: VERIFICARE COME SI COMPORTANO LE BARRE LATERAL
    angle = (angle * pi) /180
    pc = {
                        'a' : rotate_point(-ymin, -zmin, angle),
                        'b' : rotate_point(ymin, -zmin, angle),
                        'c' : rotate_point(ymin, zmin, angle),
                        'd' : rotate_point(-ymin, zmin, angle),
                        'e' : rotate_point(-ymax, -zmax, angle),
                        'f' : rotate_point(ymax, -zmax, angle),
                        'g' : rotate_point(ymax, zmax, angle),
                        'h' : rotate_point(-ymax, zmax, angle),
                        'b1': rotate_point(ymax, -zmin, angle),
                        'a1': rotate_point(-ymax, -zmin, angle),
                        'd1': rotate_point(-ymax, zmin, angle),
                        'c1': rotate_point(ymax, zmin, angle)
                        }
    fib_sec = [['section', 'Fiber', sectag],
                      ['patch','quad',matcore,nsuby, nsubz, pc['a'][0], pc['a'][1], pc['b'][0], pc['b'][1], pc['c'][0], pc['c'][1], pc['d'][0], pc['d'][1]], # core 1
                      ['patch','quad',matcover,nsuby, int(nsubz/2), pc['e'][0], pc['e'][1], pc['f'][0], pc['f'][1], pc['b1'][0], pc['b1'][1], pc['a1'][0], pc['a1'][1]], #  cover 2
                      ['patch','quad',matcover,nsuby, int(nsubz/2), pc['d1'][0], pc['d1'][1], pc['c1'][0], pc['c1'][1], pc['g'][0], pc['g'][1], pc['h'][0], pc['h'][1]], # cover 3
                      ['patch','quad',matcover,int(nsubz/2), nsuby, pc['a1'][0], pc['a1'][1], pc['a'][0], pc['a'][1], pc['d'][0], pc['d'][1], pc['d1'][0], pc['d1'][1]], # cover 4
                      ['patch','quad',matcover,int(nsubz/2), nsuby, pc['b'][0], pc['b'][1], pc['b1'][0], pc['b1'][1], pc['c1'][0], pc['c1'][1], pc['c'][0], pc['c'][1]] # cover 5
                      ]
    
    ops.section('Fiber', sectag)
    ops.patch('quad',matcore,nsuby, nsubz, pc['a'][0], pc['a'][1], pc['b'][0], pc['b'][1], pc['c'][0], pc['c'][1], pc['d'][0], pc['d'][1])
    ops.patch('quad',matcover,nsuby, int(nsubz/2), pc['e'][0], pc['e'][1], pc['f'][0], pc['f'][1], pc['b1'][0], pc['b1'][1], pc['a1'][0], pc['a1'][1])
    ops.patch('quad',matcover,nsuby, int(nsubz/2), pc['d1'][0], pc['d1'][1], pc['c1'][0], pc['c1'][1], pc['g'][0], pc['g'][1], pc['h'][0], pc['h'][1])
    ops.patch('quad',matcover,int(nsubz/2), nsuby, pc['a1'][0], pc['a1'][1], pc['a'][0], pc['a'][1], pc['d'][0], pc['d'][1], pc['d1'][0], pc['d1'][1])
    ops.patch('quad',matcover,int(nsubz/2), nsuby, pc['b'][0], pc['b'][1], pc['b1'][0], pc['b1'][1], pc['c1'][0], pc['c1'][1], pc['c'][0], pc['c'][1])
    
    if barbot == bartop:
        fib_sec.append(['layer', 'straight', matsteel, bartop, Abar, pc['d'][0], pc['d'][1], pc['c'][0], pc['c'][1]])
        fib_sec.append(['layer', 'straight', matsteel, barbot, Abarbot, pc['a'][0], pc['a'][1], pc['b'][0], pc['b'][1]])
        ops.layer('straight', matsteel, bartop, Abar, pc['d'][0], pc['d'][1], pc['c'][0], pc['c'][1]),
        ops.layer('straight', matsteel, barbot, Abarbot, pc['a'][0], pc['a'][1], pc['b'][0], pc['b'][1])
    elif bartop != barbot:
        fib_sec.append(['layer', 'straight', matsteel, bartop, Abar, pc['d'][0], pc['d'][1], pc['c'][0], pc['c'][1]])
        fib_sec.append( ['layer', 'straight', matsteel, barbot, Abarbot, pc['a'][0], pc['a'][1], pc['b'][0], pc['b'][1]])
        ops.layer('straight', matsteel, bartop, Abar, pc['d'][0], pc['d'][1], pc['c'][0], pc['c'][1]),
        ops.layer('straight', matsteel, barbot, Abarbot, pc['a'][0], pc['a'][1], pc['b'][0], pc['b'][1])
    if barside != 0:
        p1 = rotate_point(-ymin, -zmin + bside, angle)
        p2 = rotate_point(-ymin, zmin - bside, angle)
        fib_sec.append(['layer', 'straight', matsteel, barside, Abarside, p1[0], p1[1], p2[0], p2[1]])
        p3 = rotate_point(ymin, -zmin + bside, angle)
        p4 = rotate_point(ymin, zmin - bside, angle)
        fib_sec.append(['layer', 'straight', matsteel, barside, Abarside, p3[0], p3[1], p4[0], p4[1]])
        ops.layer('straight', matsteel, barside, Abarside, p1[0], p1[1], p2[0], p2[1])
        ops.layer('straight', matsteel, barside, Abarside, p3[0], p3[1], p4[0], p4[1])
    
    if print_section == True:
        # plt.style.use('classic')
        matcolor = ['r', 'darkgrey', 'lightgrey', 'w', 'w', 'w']
        opsv.plot_fiber_section(fib_sec, matcolor=matcolor)
        plt.axis('equal')
        del fib_sec
        
#### DISMISSED FOR NOW #####
# def PlotFrame(nodematrix,elementmatrix,displacement = None,scale = 1):
#     import matplotlib.pyplot as plt
#     plt.style.use('classic')
#     plt.figure()
#     if displacement is None:
#         plt.figure()
#         for i in range(len(elementmatrix[0])):
#             nodoi = elementmatrix[0][i]
#             nodoj = elementmatrix[1][i]
#             xx = (nodematrix[nodoi][0],nodematrix[nodoj][0])
#             yy = (nodematrix[nodoi][1],nodematrix[nodoj][1])
#             plt.text(nodematrix[nodoi][0], nodematrix[nodoi][1], nodoi)
#             plt.text(nodematrix[nodoj][0], nodematrix[nodoj][1], nodoj)
#             plt.text((nodematrix[nodoi][0]+nodematrix[nodoj][0])/2, (nodematrix[nodoi][1]+nodematrix[nodoj][1])/2, i, bbox=dict(facecolor='green', alpha=0.2))
#             plt.plot(xx, yy,'-k');
#     elif displacement is not None:
#             nodematrix_update = []
#             plt.figure()
#             for i in range(len(elementmatrix[0])):
#                 nodoi = elementmatrix[0][i]
#                 nodoj = elementmatrix[1][i]
#                 xx = (nodematrix[nodoi][0],nodematrix[nodoj][0])
#                 yy = (nodematrix[nodoi][1],nodematrix[nodoj][1])
#                 plt.text(nodematrix[nodoi][0], nodematrix[nodoi][1], nodoi)
#                 plt.text(nodematrix[nodoj][0], nodematrix[nodoj][1], nodoj)
#                 plt.text((nodematrix[nodoi][0]+nodematrix[nodoj][0])/2, (nodematrix[nodoi][1]+nodematrix[nodoj][1])/2, i,bbox=dict(facecolor='green', alpha=0.2))
#                 plt.plot(xx, yy,'-k');
#             txt = ('Node Displacement (Scale_factor: ' + str(scale) + ')')
#             plt.title(txt)
#             for i in range(len(nodematrix)):
#                 nodematrix_update.append([nodematrix[i][0]+displacement[i][0]*scale,nodematrix[i][1]+displacement[i][1]*scale])
#             for i in range(len(elementmatrix[0])):
#                 nodoi = elementmatrix[0][i]
#                 nodoj = elementmatrix[1][i]
#                 xx = (nodematrix_update[nodoi][0],nodematrix_update[nodoj][0])
#                 yy = (nodematrix_update[nodoi][1],nodematrix_update[nodoj][1])
#                 plt.plot(xx, yy,'-r');
                
# def PlotFrame_move(nodematrix,elementmatrix,displacement = None,scale = 1):
#     import matplotlib.pyplot as plt
#     plt.style.use('classic')
#     if displacement is None:
#         plt.figure()
#         for i in range(len(elementmatrix[0])):
#             nodoi = elementmatrix[0][i]
#             nodoj = elementmatrix[1][i]
#             xx = (nodematrix[nodoi][0],nodematrix[nodoj][0])
#             yy = (nodematrix[nodoi][1],nodematrix[nodoj][1])
#             plt.text(nodematrix[nodoi][0], nodematrix[nodoi][1], nodoi)
#             plt.text(nodematrix[nodoj][0], nodematrix[nodoj][1], nodoj)
#             plt.text((nodematrix[nodoi][0]+nodematrix[nodoj][0])/2, (nodematrix[nodoi][1]+nodematrix[nodoj][1])/2, i, bbox=dict(facecolor='green', alpha=0.2))
#             plt.plot(xx, yy,'-k');
#     elif displacement is not None:
#             nodematrix_update = []
#             plt.figure()
#             for i in range(len(elementmatrix[0])):
#                 nodoi = elementmatrix[0][i]
#                 nodoj = elementmatrix[1][i]
#                 xx = (nodematrix[nodoi][0],nodematrix[nodoj][0])
#                 yy = (nodematrix[nodoi][1],nodematrix[nodoj][1])
#                 plt.text(nodematrix[nodoi][0], nodematrix[nodoi][1], nodoi)
#                 plt.text(nodematrix[nodoj][0], nodematrix[nodoj][1], nodoj)
#                 plt.text((nodematrix[nodoi][0]+nodematrix[nodoj][0])/2, (nodematrix[nodoi][1]+nodematrix[nodoj][1])/2, i,bbox=dict(facecolor='green', alpha=0.2))
#                 plt.plot(xx, yy,'-k');
#             txt = ('Node Displacement (Scale_factor: ' + str(scale) + ')')
#             plt.title(txt)
#             for i in range(len(nodematrix)):
                nodematrix_update.append([nodematrix[i][0]+displacement[i][0]*scale,nodematrix[i][1]+displacement[i][1]*scale])
            for i in range(len(elementmatrix[0])):
                nodoi = elementmatrix[0][i]
                nodoj = elementmatrix[1][i]
                xx = (nodematrix_update[nodoi][0],nodematrix_update[nodoj][0])
                yy = (nodematrix_update[nodoi][1],nodematrix_update[nodoj][1])
                plt.plot(xx, yy,'-r');
ops.uniaxialMaterial("Steel01", matTag, Fy, Es, b)
# ops.uniaxialMaterial("SteelMP", matTag, Fy, Es, b)

# Define sections
# ---------------
# Sections defined with "canned" section ("WFSection2d"), otherwise use a FiberSection object (ops.section("Fiber",...))
colSecTag, beamSecTag = 1, 2
WSection = {
    "W18x76": [18.2 * inch, 0.425 * inch, 11.04 * inch,
               0.68 * inch],  # [d, tw, bf, tf]
    "W14X90": [14.02 * inch, 0.44 * inch, 14.52 * inch,
               0.71 * inch],  # [d, tw, bf, tf]
}

#                          secTag,    matTag, [d, tw, bf, tf],    Nfw, Nff
ops.section("WFSection2d", colSecTag, matTag, *WSection["W14X90"], 20,
            4)  # Column section
ops.section("WFSection2d", beamSecTag, matTag, *WSection["W18x76"], 20,
            4)  # Beam section

# Define elements
# ---------------
colTransTag, beamTransTag = 1, 2
# Linear, PDelta, Corotational
ops.geomTransf("Corotational", colTransTag)
ops.geomTransf("Linear", beamTransTag)

colIntTag, beamIntTag = 1, 2
nip = 5
# Lobatto, Legendre, NewtonCotes, Radau, Trapezoidal, CompositeSimpson
ops.beamIntegration("Lobatto", colIntTag, colSecTag, nip),
ops.beamIntegration("Lobatto", beamIntTag, beamSecTag, nip)
def RectCFSTSteelHysteretic(length: float, secHeight: float, secWidth: float,
                            thickness: float, concrete_grade: float,
                            steel_grade: float, axial_load_ratio: float,
                            disp_control: Iterable[float]):
    '''Peakstress: concrete peak stress \n crushstress: concrete crush stress
    '''
    #disp input
    # dispControl=[3,-3,7,-7,14,-14,14,-14,14,-14,28,-28,28,-28,28,-28,42,-42,42,-42,42,-42,56,-56,0]
    dispControl = tuple(disp_control)
    #Geometry
    # length=740
    # secHeight=100
    # secWidth=100
    # thickness=7
    #Materials
    ##steel_tube
    point1Steel, point2Steel, point3Steel = [460, 0.00309], [460, 0.02721
                                                             ], [530, 0.26969]
    point1SteelNegative, point2SteelNegative, point3SteelNegative = [
        -460, -0.00309
    ], [-460, -0.02721], [-736, -0.26969]
    pinchX = 0.2
    pinchY = 0.7
    damagedFactor = 0.01
    densitySteel = 7.8 / 1000000000
    ##concrete
    peakPointConcrete, crushPointConcrete = [-221.76, -0.0102], [-195, -0.051]

    unloadingLambda = 0.2
    tensileStrength = 5.6
    tensilePostStiffness = 0.01
    densityConcrete = 2.4 / 1000000000
    #axialLoadRatio
    # axialLoadRatio=0.4
    #fix condition
    Fixed = 1

    #section parameter
    areaConcrete = (secHeight - 2 * thickness) * (secWidth - 2 * thickness)
    areaSteel = secWidth * secHeight - areaConcrete

    # fck,Ec,nuConcrete=128.1,4.34*10000,0.21
    # fy,epsilonSteely,Es,nuSteel=444.6,3067/1000000,1.99*100000,0.29
    fck = peakPointConcrete[0]
    fy = point1Steel[0]

    #Computate parameter
    axialLoad = (areaConcrete * fck + areaSteel * fy) * axial_load_ratio

    #loading control parameter
    # for item in dispControlPercentage:
    #     dispControl.append(item*length)
    #     dispControl.append(-item*length)
    # print('displist:'dispControl)

    #wipe and build a model
    ops.wipe()
    ops.model('basic', '-ndm', 2, '-ndf', 3)

    #node coordinates
    meshNumLength = 5
    meshVerticalSize = length / meshNumLength
    meshSteelSize = 10
    nodes = [(i + 1, meshVerticalSize * i)
             for i in range(int(length / meshVerticalSize) + 1)]
    for item in nodes:
        ops.node(item[0], 0, item[1])

    #boundary condition
    ops.fix(1, 1, 1, 1)
    # if bool(Fixed):
    #     ops.fix(int(length/meshVerticalSize)+1,0,0,1)  ##uppper constrain condition: free or no-rotation

    #mass defination(concentrate mass to nodes)
    nodeMassSteel = areaSteel * meshVerticalSize * densitySteel
    nodeMassConcrete = areaConcrete * meshVerticalSize * densityConcrete
    nodeMass = nodeMassSteel + nodeMassConcrete
    for i in range(len(nodes) - 1):
        arg = [0., nodeMass, 0.]
        ops.mass(i + 2, *arg)

    #transformation:
    ops.geomTransf('Linear', 1)

    #material defination
    ##steel

    ops.uniaxialMaterial('Hysteretic', 1001, *point1Steel, *point2Steel,
                         *point3Steel, *point1SteelNegative,
                         *point2SteelNegative, *point3SteelNegative, pinchX,
                         pinchY, damagedFactor, 0, 0.0)
    ##concrete
    ##using concrete01
    #peakPointConcrete,crushPointConcrete=[110.6,0.00544],[22.11,0.09145]
    #ops.uniaxialMaterial('Concrete01',1,*peakPointConcrete,*crushPointConcrete)
    ###using concrete02

    ops.uniaxialMaterial('Concrete02', 1, *peakPointConcrete,
                         *crushPointConcrete, unloadingLambda, tensileStrength,
                         tensilePostStiffness)

    #section defination
    ops.section('Fiber', 1)
    ##inner concrete fiber
    fiberPointI, fiberPointJ = [
        -(secHeight - 2 * thickness) / 2, -(secWidth - 2 * thickness) / 2
    ], [(secHeight - 2 * thickness) / 2, (secWidth - 2 * thickness) / 2]
    ops.patch('rect', 1, 10, 1, *fiberPointI, *fiberPointJ
              )  # https://opensees.berkeley.edu/wiki/index.php/Patch_Command
    ##outside steel fiber
    steelFiberProperty = {
        'height': meshSteelSize,
        'area': meshSteelSize * thickness
    }
    steelFiberPropertyLeftAndRight = {
        'height': secWidth,
        'area': secWidth * thickness
    }
    ###left and right
    leftEdgeFiberY, rightEdgeFiberY = -(
        secHeight - 2 * thickness) / 2 - thickness / 2, (
            secHeight -
            2 * thickness) / 2 + thickness / 2  #rightEdgeFiberY might be wrong
    leftandRightEdgeFiberZ = [
        -secWidth / 2 + steelFiberPropertyLeftAndRight['height'] * (1 / 2 + N)
        for N in range(int(secWidth /
                           steelFiberPropertyLeftAndRight['height']))
    ]
    ###up and down
    upEdgeFiberZ, downEdgeFiberZ = -(
        secWidth - 2 * thickness) / 2 - thickness / 2, (
            secWidth - 2 * thickness) / 2 + thickness / 2
    upandDownEdgeFiberY = [
        -secHeight / 2 + thickness + steelFiberProperty['height'] * (1 / 2 + N)
        for N in range(
            int((secHeight - 2 * thickness) / steelFiberProperty['height']))
    ]
    for i in leftandRightEdgeFiberZ:
        i = float(i)
        ops.fiber(float(leftEdgeFiberY), i,
                  steelFiberPropertyLeftAndRight['area'], 1001)
        ops.fiber(float(rightEdgeFiberY), i,
                  steelFiberPropertyLeftAndRight['area'], 1001)
    for j in upandDownEdgeFiberY:
        j = float(j)
        ops.fiber(j, float(upEdgeFiberZ), steelFiberProperty['area'], 1001)
        ops.fiber(j, float(downEdgeFiberZ), steelFiberProperty['area'], 1001)
    #beamInergration defination
    ops.beamIntegration('NewtonCotes', 1, 1, 5)

    #element defination
    for i in range(len(nodes) - 1):
        ops.element('dispBeamColumn', i + 1, i + 1, i + 2, 1, 1)

    #recorders
    ops.recorder('Node', '-file', 'topLateralDisp.txt', '-time', '-node',
                 int(length / meshVerticalSize + 1), '-dof', 1, 2, 'disp')
    ops.recorder('Node', '-file', 'topLateralForce.txt', '-time', '-node',
                 int(length / meshVerticalSize + 1), '-dof', 1, 2, 'reaction')
    ops.recorder('Element', '-file', 'topElementForce.txt', '-time', '-ele',
                 int(length / meshVerticalSize), 'force')

    #gravity load
    ops.timeSeries('Linear', 1)
    ops.pattern('Plain', 1, 1)
    ops.load(int(length / meshVerticalSize + 1), 0, axialLoad, 0)
    ops.constraints('Plain')
    ops.numberer('RCM')
    ops.system('BandGeneral')
    ##convertage test
    tolerant, allowedIteralStep = 1 / 1000000, 6000
    ops.test('NormDispIncr', tolerant, allowedIteralStep)
    ops.algorithm('Newton')
    ops.integrator('LoadControl', 0.1)
    ops.analysis('Static')
    ops.analyze(10)
    ops.loadConst('-time', 0)

    #lateraldisp analysis
    ops.pattern('Plain', 2, 1)
    ops.load(int(length / meshVerticalSize + 1), 100, 0, 0)
    for i in range(len(dispControl)):
        if i == 0:
            ops.integrator('DisplacementControl',
                           int(length / meshVerticalSize + 1), 1, 0.1)
            ops.analyze(int(dispControl[i] / 0.1))
            # print('Working on disp round',i)
        else:
            if dispControl[i] >= 0:
                ops.integrator('DisplacementControl',
                               int(length / meshVerticalSize + 1), 1, 0.1)
                ops.analyze(int(
                    abs(dispControl[i] - dispControl[i - 1]) / 0.1))
                # print('Working on disp round',i)
            else:
                ops.integrator('DisplacementControl',
                               int(length / meshVerticalSize + 1), 1, -0.1)
                ops.analyze(int(
                    abs(dispControl[i] - dispControl[i - 1]) / 0.1))
Example #11
0
# ----------------------------
# Start of model generation
# ----------------------------
# remove existing model
ops.wipe()
ops.model("BasicBuilder", "-ndm", 3, "-ndf", 6)

# set default units
ops.defaultUnits("-force", "kip", "-length", "in", "-time", "sec", "-temp",
                 "F")

# Define the section
# ------------------
#                                       secTag  E     nu     h    rho
ops.section("ElasticMembranePlateSection", 1, 3.0E3, 0.25, 1.175, 1.27)

# Define geometry
# ---------------
# these should both be even

nx = 10
ny = 2

# loaded nodes
mid = int(((nx + 1) * (ny + 1) + 1) / 2)
side1 = int((nx + 2) / 2)
side2 = int((nx + 1) * (ny + 1) - side1 + 1)

# generate the nodes and elements
#          numX numY startNode startEle eleType eleArgs? coords?
Example #12
0
ops.node(12, 2 * L, 0.0)
ops.node(13, 2 * L, Hb)

# ids for meshing
wall_id = 1
beam_id = 2
water_bound_id = -1
water_body_id = -2

# transformation
transfTag = 1
ops.geomTransf('Corotational', transfTag)

# section
secTag = 1
ops.section('Elastic', secTag, E, A, Iz)

# beam integration
inteTag = 1
numpts = 2
ops.beamIntegration('Legendre', inteTag, secTag, numpts)

# beam mesh
beamTag = 6
ndf = 3
ops.mesh('line', beamTag, 2, 12, 13, beam_id, ndf, h, 'dispBeamColumn',
         transfTag, inteTag)

ndmass = bmass / len(ops.getNodeTags('-mesh', beamTag))

for nd in ops.getNodeTags('-mesh', beamTag):
Example #13
0
#########################################################################################################################################################################

#----------------------------------------------------------
#  create elastic pile section
#----------------------------------------------------------

secTag = 1
E = 25000000.0
A = 0.785
Iz = 0.049
Iy = 0.049
G = 9615385.0
J = 0.098

matTag = 3000
op.section('Elastic', 1, E, A, Iz, Iy, G, J)

# elastic torsional material for combined 3D section
op.uniaxialMaterial('Elastic', 3000, 1e10)

# create combined 3D section
secTag3D = 3
op.section('Aggregator', secTag3D, 3000, 'T', '-section', 1)

#########################################################################################################################################################################

##########################################################################################################################################################################

# elastic pile section
#import elasticPileSection
Example #14
0
def RunAnalysis():
    AnalysisType = 'Pushover'
    #  Pushover  Gravity

    ## ------------------------------
    ## Start of model generation
    ## -----------------------------
    # remove existing model
    ops.wipe()

    # set modelbuilder
    ops.model('basic', '-ndm', 2, '-ndf', 3)

    import math

    ############################################
    ### Units and Constants  ###################
    ############################################

    inch = 1
    kip = 1
    sec = 1

    # Dependent units
    sq_in = inch * inch
    ksi = kip / sq_in
    ft = 12 * inch

    # Constants
    g = 386.2 * inch / (sec * sec)
    pi = math.acos(-1)

    #######################################
    ##### Dimensions
    #######################################

    # Dimensions Input
    H_story = 10.0 * ft
    W_bayX = 16.0 * ft
    W_bayY_ab = 5.0 * ft + 10.0 * inch
    W_bayY_bc = 8.0 * ft + 4.0 * inch
    W_bayY_cd = 5.0 * ft + 10.0 * inch

    # Calculated dimensions
    W_structure = W_bayY_ab + W_bayY_bc + W_bayY_cd

    ################
    ### Material
    ################

    # Steel02 Material

    matTag = 1
    matConnAx = 2
    matConnRot = 3

    Fy = 60.0 * ksi
    # Yield stress
    Es = 29000.0 * ksi
    # Modulus of Elasticity of Steel
    v = 0.2
    # Poisson's ratio
    Gs = Es / (1 + v)
    # Shear modulus
    b = 0.10
    # Strain hardening ratio
    params = [18.0, 0.925, 0.15]  # R0,cR1,cR2
    R0 = 18.0
    cR1 = 0.925
    cR2 = 0.15
    a1 = 0.05
    a2 = 1.00
    a3 = 0.05
    a4 = 1.0
    sigInit = 0.0
    alpha = 0.05

    ops.uniaxialMaterial('Steel02', matTag, Fy, Es, b, R0, cR1, cR2, a1, a2,
                         a3, a4, sigInit)

    # ##################
    # ## Sections
    # ##################

    colSecTag1 = 1
    colSecTag2 = 2
    beamSecTag1 = 3
    beamSecTag2 = 4
    beamSecTag3 = 5

    # COMMAND: section('WFSection2d', secTag, matTag, d, tw, bf, tf, Nfw, Nff)

    ops.section('WFSection2d', colSecTag1, matTag, 10.5 * inch, 0.26 * inch,
                5.77 * inch, 0.44 * inch, 15, 16)  # outer Column
    ops.section('WFSection2d', colSecTag2, matTag, 10.5 * inch, 0.26 * inch,
                5.77 * inch, 0.44 * inch, 15, 16)  # Inner Column

    ops.section('WFSection2d', beamSecTag1, matTag, 8.3 * inch, 0.44 * inch,
                8.11 * inch, 0.685 * inch, 15, 15)  # outer Beam
    ops.section('WFSection2d', beamSecTag2, matTag, 8.2 * inch, 0.40 * inch,
                8.01 * inch, 0.650 * inch, 15, 15)  # Inner Beam
    ops.section('WFSection2d', beamSecTag3, matTag, 8.0 * inch, 0.40 * inch,
                7.89 * inch, 0.600 * inch, 15, 15)  # Inner Beam

    # Beam size - W10x26
    Abeam = 7.61 * inch * inch
    IbeamY = 144. * (inch**4)
    # Inertia along horizontal axis
    IbeamZ = 14.1 * (inch**4)
    # inertia along vertical axis

    # BRB input data
    Acore = 2.25 * inch
    Aend = 10.0 * inch
    LR_BRB = 0.55

    # ###########################
    # ##### Nodes
    # ###########################

    # Create All main nodes
    ops.node(1, 0.0, 0.0)
    ops.node(2, W_bayX, 0.0)
    ops.node(3, 2 * W_bayX, 0.0)

    ops.node(11, 0.0, H_story)
    ops.node(12, W_bayX, H_story)
    ops.node(13, 2 * W_bayX, H_story)

    ops.node(21, 0.0, 2 * H_story)
    ops.node(22, W_bayX, 2 * H_story)
    ops.node(23, 2 * W_bayX, 2 * H_story)

    ops.node(31, 0.0, 3 * H_story)
    ops.node(32, W_bayX, 3 * H_story)
    ops.node(33, 2 * W_bayX, 3 * H_story)

    # Beam Connection nodes

    ops.node(1101, 0.0, H_story)
    ops.node(1201, W_bayX, H_story)
    ops.node(1202, W_bayX, H_story)
    ops.node(1301, 2 * W_bayX, H_story)

    ops.node(2101, 0.0, 2 * H_story)
    ops.node(2201, W_bayX, 2 * H_story)
    ops.node(2202, W_bayX, 2 * H_story)
    ops.node(2301, 2 * W_bayX, 2 * H_story)

    ops.node(3101, 0.0, 3 * H_story)
    ops.node(3201, W_bayX, 3 * H_story)
    ops.node(3202, W_bayX, 3 * H_story)
    ops.node(3301, 2 * W_bayX, 3 * H_story)

    # ###############
    #  Constraints
    # ###############

    ops.fix(1, 1, 1, 1)
    ops.fix(2, 1, 1, 1)
    ops.fix(3, 1, 1, 1)

    # #######################
    # ### Elements
    # #######################

    # ### Assign beam-integration tags

    ColIntTag1 = 1
    ColIntTag2 = 2
    BeamIntTag1 = 3
    BeamIntTag2 = 4
    BeamIntTag3 = 5

    ops.beamIntegration('Lobatto', ColIntTag1, colSecTag1, 4)
    ops.beamIntegration('Lobatto', ColIntTag2, colSecTag2, 4)
    ops.beamIntegration('Lobatto', BeamIntTag1, beamSecTag1, 4)
    ops.beamIntegration('Lobatto', BeamIntTag2, beamSecTag2, 4)
    ops.beamIntegration('Lobatto', BeamIntTag3, beamSecTag3, 4)

    # Assign geometric transformation

    ColTransfTag = 1
    BeamTranfTag = 2

    ops.geomTransf('PDelta', ColTransfTag)
    ops.geomTransf('Linear', BeamTranfTag)

    # Assign Elements  ##############

    # ## Add non-linear column elements
    ops.element('forceBeamColumn', 1, 1, 11, ColTransfTag, ColIntTag1, '-mass',
                0.0)
    ops.element('forceBeamColumn', 2, 2, 12, ColTransfTag, ColIntTag2, '-mass',
                0.0)
    ops.element('forceBeamColumn', 3, 3, 13, ColTransfTag, ColIntTag1, '-mass',
                0.0)

    ops.element('forceBeamColumn', 11, 11, 21, ColTransfTag, ColIntTag1,
                '-mass', 0.0)
    ops.element('forceBeamColumn', 12, 12, 22, ColTransfTag, ColIntTag2,
                '-mass', 0.0)
    ops.element('forceBeamColumn', 13, 13, 23, ColTransfTag, ColIntTag1,
                '-mass', 0.0)

    ops.element('forceBeamColumn', 21, 21, 31, ColTransfTag, ColIntTag1,
                '-mass', 0.0)
    ops.element('forceBeamColumn', 22, 22, 32, ColTransfTag, ColIntTag2,
                '-mass', 0.0)
    ops.element('forceBeamColumn', 23, 23, 33, ColTransfTag, ColIntTag1,
                '-mass', 0.0)

    #  ### Add linear main beam elements, along x-axis
    #element('elasticBeamColumn', 101, 1101, 1201, Abeam, Es, Gs, Jbeam, IbeamY, IbeamZ, beamTransfTag, '-mass', 0.0)

    ops.element('forceBeamColumn', 101, 1101, 1201, BeamTranfTag, BeamIntTag1,
                '-mass', 0.0)
    ops.element('forceBeamColumn', 102, 1202, 1301, BeamTranfTag, BeamIntTag1,
                '-mass', 0.0)

    ops.element('forceBeamColumn', 201, 2101, 2201, BeamTranfTag, BeamIntTag2,
                '-mass', 0.0)
    ops.element('forceBeamColumn', 202, 2202, 2301, BeamTranfTag, BeamIntTag2,
                '-mass', 0.0)

    ops.element('forceBeamColumn', 301, 3101, 3201, BeamTranfTag, BeamIntTag3,
                '-mass', 0.0)
    ops.element('forceBeamColumn', 302, 3202, 3301, BeamTranfTag, BeamIntTag3,
                '-mass', 0.0)

    # Assign constraints between beam end nodes and column nodes (RIgid beam column connections)
    ops.equalDOF(11, 1101, 1, 2, 3)
    ops.equalDOF(12, 1201, 1, 2, 3)
    ops.equalDOF(12, 1202, 1, 2, 3)
    ops.equalDOF(13, 1301, 1, 2, 3)

    ops.equalDOF(21, 2101, 1, 2, 3)
    ops.equalDOF(22, 2201, 1, 2, 3)
    ops.equalDOF(22, 2202, 1, 2, 3)
    ops.equalDOF(23, 2301, 1, 2, 3)

    ops.equalDOF(31, 3101, 1, 2, 3)
    ops.equalDOF(32, 3201, 1, 2, 3)
    ops.equalDOF(32, 3202, 1, 2, 3)
    ops.equalDOF(33, 3301, 1, 2, 3)

    AllNodes = ops.getNodeTags()
    massX = 0.49

    for nodes in AllNodes:
        ops.mass(nodes, massX, massX, 0.00001)

    ################
    ## Gravity Load
    ################
    # create TimeSeries
    ops.timeSeries("Linear", 1)

    # create a plain load pattern
    ops.pattern("Plain", 1, 1)

    # Create the nodal load
    ops.load(11, 0.0, -5.0 * kip, 0.0)
    ops.load(12, 0.0, -6.0 * kip, 0.0)
    ops.load(13, 0.0, -5.0 * kip, 0.0)

    ops.load(21, 0., -5. * kip, 0.0)
    ops.load(22, 0., -6. * kip, 0.0)
    ops.load(23, 0., -5. * kip, 0.0)

    ops.load(31, 0., -5. * kip, 0.0)
    ops.load(32, 0., -6. * kip, 0.0)
    ops.load(33, 0., -5. * kip, 0.0)

    ###############################
    ### PUSHOVER ANALYSIS
    ###############################

    if (AnalysisType == "Pushover"):

        print("<<<< Running Pushover Analysis >>>>")

        # Create load pattern for pushover analysis
        # create a plain load pattern
        ops.pattern("Plain", 2, 1)

        ops.load(11, 1.61, 0.0, 0.0)
        ops.load(21, 3.22, 0.0, 0.0)
        ops.load(31, 4.83, 0.0, 0.0)

        ControlNode = 31
        ControlDOF = 1
        MaxDisp = 0.15 * H_story
        DispIncr = 0.1
        NstepsPush = int(MaxDisp / DispIncr)

        Model = 'test'
        LoadCase = 'Pushover'
        dt = 0.2
        opp.createODB(Model, LoadCase, Nmodes=3)

        ops.system("ProfileSPD")
        ops.numberer("Plain")
        ops.constraints("Plain")
        ops.integrator("DisplacementControl", ControlNode, ControlDOF,
                       DispIncr)
        ops.algorithm("Newton")
        ops.test('NormUnbalance', 1e-8, 10)
        ops.analysis("Static")

        # 	analyze(NstepsPush)
        ops.analyze(100)

        print("Pushover analysis complete")
def get_Sections(fc, Es, fy, sec_dims, D, rebar_coords_YZ):
    '''
    Summary
    -------
    
    
    Parameters
    ----------
    fc : TYPE
        DESCRIPTION.
    Es : TYPE
        DESCRIPTION.
    fy : TYPE
        DESCRIPTION.
    sec_dims : TYPE
        DESCRIPTION.
    D : TYPE
        DESCRIPTION.
    rebar_coords_YZ : TYPE
        DESCRIPTION.

    Returns
    -------
    None.

    '''

    # Define standard materials:
    E_flex = 1.0
    E_rigid = 100.0 * 10**12

    ops.uniaxialMaterial('Elastic', 1, Es)
    ops.uniaxialMaterial('Elastic', 10, E_flex)
    ops.uniaxialMaterial('Elastic', 20, E_rigid)

    # Rebar material:

    b = 0.02
    params = [18.0, 0.925,
              0.15]  # Recommended values for the Menegotto-Pinto model.
    #   uniaxialMaterial('Steel02', matTag, Fy, E0, b, *params)
    ops.uniaxialMaterial('Steel02', 101, fy, Es, b, *params)

    # Concrete material:

    fc *= -1  # Value from concrete lab, NTUA.
    fcu = 0.2 * fc  # Value from concrete lab, NTUA.
    eps_c0 = -2 / 10**3  # Value from concrete lab, NTUA.
    eps_u = -3.5 / 10**3  # Value from concrete lab, NTUA.

    #   uniaxialMaterial('Concrete01', matTag, fpc,  epsc0, fpcu,  epsU)
    ops.uniaxialMaterial('Concrete01', 201, fc, eps_c0, fcu, eps_u)

    # Geometry preprocessing:
    vertices = np.zeros((4, 2))
    vertices[:2, :] = -sec_dims / 2
    vertices[2:, :] = sec_dims / 2
    vertices[0, 0] *= -1
    vertices[2, 0] *= -1

    N_fiber_Y = 50
    N_fiber_Z = 1

    A_bar = np.pi * D**2 / 4

    #print(vertices)
    # Define sections:
    #   For the rebar/concrete part we use the fiber/patch command
    # Define test sections:

    #   section('Fiber', secTag)
    ops.section('Fiber', 1)

    #   patch('quad', matTag, numSubdivIJ, numSubdivJK,          *crdsI,          *crdsJ,          *crdsK,          *crdsL)
    ops.patch('quad', 1, N_fiber_Z, N_fiber_Y, *vertices[0, :],
              *vertices[1, :], *vertices[2, :], *vertices[3, :])

    n = rebar_coords_YZ.shape[0]
    #    fiber(                 yloc,                  zloc,     A, matTag)
    #ops.fiber(rebar_coords_YZ[i, 0], rebar_coords_YZ[i, 1], A_bar,      1)
    [
        ops.fiber(rebar_coords_YZ[i, 0], rebar_coords_YZ[i, 1], A_bar, 1)
        for i in range(n)
    ]

    # Define actual sections:

    #   section('Fiber', secTag)
    ops.section('Fiber', 10)

    #   patch('quad', matTag, numSubdivIJ, numSubdivJK,          *crdsI,          *crdsJ,          *crdsK,          *crdsL)
    ops.patch('quad', 201, N_fiber_Z, N_fiber_Y, *vertices[0, :],
              *vertices[1, :], *vertices[2, :], *vertices[3, :])

    n = rebar_coords_YZ.shape[0]
    #    fiber(                 yloc,                  zloc,     A, matTag)
    #ops.fiber(rebar_coords_YZ[i, 0], rebar_coords_YZ[i, 1], A_bar,    101)
    [
        ops.fiber(rebar_coords_YZ[i, 0], rebar_coords_YZ[i, 1], A_bar, 101)
        for i in range(n)
    ]

    # Geometric tranformation:
    #   geomTransf(transfType, transfTag, *transfArgs)
    ops.geomTransf('Linear', 1)  # test
    ops.geomTransf('PDelta', 10)  # actual

    # Integrator:
    N = 4
    #   beamIntegration('Lobatto', tag, secTag, N)
    ops.beamIntegration('Lobatto', 1, 1, N)  # test
    ops.beamIntegration('Lobatto', 10, 10, N)  # actual
def main():
    """
    Create a Cantilever Problem
    """

    ops.wipe()
    ops.model('basic', '-ndm', 2, '-ndf', 3)
    height = 5.0
    nElem = 20

    ElemLength = height / nElem
    nodeID = []
    Ycoord = 0
    for i in range(nElem + 1):
        nodeID.append(i)
        ops.node(i, 0.0, Ycoord)
        Ycoord += ElemLength
    IDctrlNode = i

    ops.fix(0, 1, 1, 1)
    ops.geomTransf('Linear', 1)

    concrete = 'Concrete04'
    steel = 'Steel02'

    matTAGConc = 319
    matTAGSteel = 312
    fcc = -20000
    ec2c = -0.002
    ecu2c = -0.0035
    Ec = 30000000
    fct = 2200
    et = 0.001
    fy = 500000
    E0 = 200000000
    b = 0.01
    ops.uniaxialMaterial(concrete, matTAGConc, fcc, ec2c, ecu2c, Ec, fct, et)
    ops.uniaxialMaterial(steel, matTAGSteel, fy, E0, b, 20, 0.925, 0.15, 0, 1, 0, 1, 0)

    # Core Fibers
    ops.section('Fiber', 105)
    ops.patch('rect', 319, 11, 11, -0.20, -0.20, 0.20, 0.20)
    # Cover Fibers
    ops.patch('rect', 319, 15, 2, 0.250000, 0.200000, -0.250000, 0.250000)
    ops.patch('rect', 319, 15, 2, 0.250000, -0.250000, -0.250000, -0.200000)
    ops.patch('rect', 319, 2, 11, -0.250000, -0.200000, -0.200000, 0.200000)
    ops.patch('rect', 319, 2, 11, 0.200000, -0.200000, 0.250000, 0.200000)
    # create corner bars
    ops.layer('straight', 312, 4, 0.00025450, 0.200000, 0.200000, -0.200000, 0.200000)
    ops.layer('straight', 312, 4, 0.00025450, 0.200000, -0.200000, -0.200000, -0.200000)
    ops.beamIntegration('Lobatto', 100, 105, 3)

    for i in range(len(nodeID) - 1):
        ops.element('forceBeamColumn', i, nodeID[i], nodeID[i + 1], 1, 100, '-iter', 10, 1e-6)

    # Add Vertical Load at Top
    ops.timeSeries('Linear', 101)
    ops.pattern('Plain', 100, 101)
    ops.load(IDctrlNode, 0, -500, 0)

    # Solve Gravity First
    ops.system('UmfPack')
    ops.numberer('Plain')
    ops.constraints('Transformation')
    ops.integrator('LoadControl', 0.1)
    ops.test('RelativeTotalNormDispIncr', 0.001, 100, 2)
    ops.algorithm('Newton')
    ops.analysis('Static')
    LoadControlSubStep(10, 0.1, True)

    # Displacement Control Analysis(Pushover)
    ops.pattern('Plain', 200, 101)
    ops.load(IDctrlNode, 1, 0, 0)
    ops.system('UmfPack')
    ops.numberer('Plain')
    ops.constraints('Transformation')
    ops.test('RelativeTotalNormDispIncr', 1e-2, 500, 2)
    ops.algorithm('Newton')
    ops.analysis('Static')
    DispControlSubStep(100, IDctrlNode, 1, 1.0)
Example #17
0
def RunAnalysis():
    # ----------------------------
    # Start of model generation
    # ----------------------------
    # remove existing model
    ops.wipe()
    ops.model("BasicBuilder", "-ndm", 3, "-ndf", 6)

    # set default units
    ops.defaultUnits("-force", "kip", "-length", "in", "-time", "sec", "-temp",
                     "F")

    # Define the section
    # ------------------
    #                                       secTag  E     nu     h    rho
    ops.section("ElasticMembranePlateSection", 1, 3.0E3, 0.25, 1.175, 1.27)

    # Define geometry
    # ---------------
    # these should both be even

    nx = 10
    ny = 2

    # loaded nodes
    mid = int(((nx + 1) * (ny + 1) + 1) / 2)
    side1 = int((nx + 2) / 2)
    side2 = int((nx + 1) * (ny + 1) - side1 + 1)

    # generate the nodes and elements
    #          numX numY startNode startEle eleType eleArgs? coords?
    ops.block2D(nx, ny, 1, 1, "ShellMITC4", 1, 1, -20.0, 0.0, 0.0, 2, -20.0,
                0.0, 40.0, 3, 20.0, 0.0, 40.0, 4, 20.0, 0.0, 0.0, 5, -10.0,
                10.0, 20.0, 7, 10.0, 10.0, 20.0, 9, 0.0, 10.0, 20.0)

    # define the boundary conditions
    ops.fixZ(0.0, 1, 1, 1, 0, 1, 1)
    ops.fixZ(40.0, 1, 1, 1, 0, 1, 1)

    ops.mass(20, 10.0, 10.0, 10.0, 0.0, 0.0, 0.0)

    # create a Linear time series
    ops.timeSeries("Linear", 1)

    # add some loads
    ops.pattern("Plain", 1, 1, "-fact", 1.0)
    ops.load(mid, 0.0, -0.50, 0.0, 0.0, 0.0, 0.0)
    ops.load(side1, 0.0, -0.25, 0.0, 0.0, 0.0, 0.0)
    ops.load(side2, 0.0, -0.25, 0.0, 0.0, 0.0, 0.0)

    # ------------------------
    # Start of static analysis
    # ------------------------
    # Load control with variable load steps
    #                            init  Jd  min  max
    ops.integrator("LoadControl", 1.0, 1, 1.0, 10.0)
    ops.test("EnergyIncr", 1.0E-10, 20, 0)
    ops.algorithm("Newton")
    ops.numberer("RCM")
    ops.constraints("Plain")
    ops.system("SparseGeneral", "-piv")
    ops.analysis("Static")
    ops.analyze(5)

    # ---------------------------------------
    # Create and Perform the dynamic analysis
    # ---------------------------------------
    # Remove the static analysis & reset the time to 0.0

    ops.wipeAnalysis()
    ops.setTime(0.0)

    # Now remove the loads and let the beam vibrate
    ops.remove("loadPattern", 1)

    Model = 'test'
    LoadCase = 'Transient'
    LoadCase2 = 'Transient_5s'
    opp.createODB(Model, LoadCase, Nmodes=3, recorders=[])
    opp.createODB(Model, LoadCase2, Nmodes=3, deltaT=5., recorders=[])

    # Create the transient analysis
    ops.test("EnergyIncr", 1.0E-10, 20, 0)
    ops.algorithm("Newton")
    ops.numberer("RCM")
    ops.constraints("Plain")
    ops.system("SparseGeneral", "-piv")
    ops.integrator("Newmark", 0.50, 0.25)
    ops.analysis("Transient")

    # Perform the transient analysis (20 sec)
    ops.analyze(100, 0.2)
Example #18
0
ops.nDMaterial('PlaneStressUserMaterial', 1, 40, 7, 20.7e6, 2.07e6, -4.14e6,
               -0.002, -0.006, 0.001, 0.08)
ops.nDMaterial('PlateFromPlaneStress', 4, 1, 1.25e10)

ops.uniaxialMaterial('Steel02', 7, 379e6, 202.7e9, 0.01, 18.5, 0.925, 0.15)
ops.uniaxialMaterial('Steel02', 8, 392e6, 200.6e9, 0.01, 18.5, 0.925, 0.15)

ops.nDMaterial('PlateRebar', 9, 7, 90)

ops.nDMaterial('PlateRebar', 10, 8, 90)

ops.nDMaterial('PlateRebar', 11, 8, 0)

ops.section('LayeredShell', 1, 10, 4, 0.0125, 11, 0.0002403, 11, 0.0003676, 4,
            0.024696, 4, 0.024696, 4, 0.024696, 4, 0.024696, 11, 0.0003676, 11,
            0.0002403, 4, 0.0125)

ops.section('LayeredShell', 2, 8, 4, 0.0125, 11, 0.0002403, 10, 0.0002356, 4,
            0.0495241, 4, 0.0495241, 10, 0.0002356, 11, 0.0002403, 4, 0.0125)

ops.node(1, 0.0, 0, 0)
ops.node(2, 0.2, 0, 0)
ops.node(3, 0.5, 0, 0)
ops.node(4, 0.8, 0, 0)
ops.node(5, 1.0, 0, 0)
ops.node(6, 0.0, 0.2, 0)
ops.node(7, 0.2, 0.2, 0)
ops.node(8, 0.5, 0.2, 0)
ops.node(9, 0.8, 0.2, 0)
ops.node(10, 1.0, 0.2, 0)
Example #19
0
def getSections():

    op.model('Basic', '-ndm', 2, '-ndf', 3)

    # Get material prorpeties
    Esteel = 200. * GPa
    Eflex = 1.
    Erigid = 100. * 10**12

    # define materials
    op.uniaxialMaterial('Elastic', 1, Esteel)
    op.uniaxialMaterial('Elastic', 10, Eflex)
    op.uniaxialMaterial('Elastic', 20, Erigid)

    # Define Steel Material
    Fy = 350. * MPa
    E0 = 200. * GPa
    b = 0.0005

    #  uniaxialMaterial('Steel02', matTag, Fy, E0, b)
    op.uniaxialMaterial('Steel02', 2, Fy, E0, b)

    fpc = -30. * 10**6
    fpcu = fpc * 0.1
    epsc0 = -0.002
    epsU = epsc0 * 8
    lam = 0.2
    ft = -fpc / 30
    Ets = 2 * fpc / (epsc0 * 20)

    # Define Concrete Material
    #  uniaxialMaterial('Concrete02', matTag, fpc, epsc0, fpcu, epsU, lambda, ft, Ets)
    op.uniaxialMaterial('Concrete02', 3, fpc, epsc0, fpcu, epsU, lam, ft, Ets)

    # Geometry preprocessing
    # Get Verticies
    h = 600 * mm
    w = 400 * mm
    vertices = np.array(
        [-h / 2, w / 2, -h / 2, -w / 2, h / 2, -w / 2, h / 2, w / 2])

    # Define Rebar Info
    rebarZ = np.array([-150, 0, 150]) * mm
    rebarY = np.array([150, 225]) * mm
    Abar = np.pi * (30 * mm / 2)**2

    Nbar = len(rebarZ) * len(rebarY)
    rebarYZ = np.zeros([Nbar, 2])

    for ii, Y in enumerate(rebarY):
        for jj, Z in enumerate(rebarZ):
            rebarYZ[ii * len(rebarZ) + jj, :] = [Y, Z]

    NfibeZ = 1
    NfibeY = 100

    # Define Sections
    # Test Sections
    #  section('Fiber', secTag)
    op.section('Fiber', 1)

    #  patch('quad', matTag, numSubdivIJ, numSubdivJK, *crdsI, *crdsJ, *crdsK, *crdsL)
    op.patch('quad', 1, NfibeZ, NfibeY, *vertices)

    for YZ in rebarYZ:
        #  fiber(yloc, zloc, A, matTag)
        op.fiber(*YZ, Abar, 1)

    # Actual Section
    #  section('Fiber', secTag)
    op.section('Fiber', 2)

    #  patch('quad', matTag, numSubdivIJ, numSubdivJK, *crdsI, *crdsJ, *crdsK, *crdsL)
    op.patch('quad', 3, NfibeZ, NfibeY, *vertices)

    for YZ in rebarYZ:
        #  fiber(yloc, zloc, A, matTag)
        op.fiber(*YZ, Abar, 2)

    # Define transform and integration
    op.geomTransf('Linear', 1)
    op.geomTransf('PDelta', 2)

    #  beamIntegration('Lobatto', tag, secTag, N)
    op.beamIntegration('Lobatto', 1, 1, 4)
    op.beamIntegration('Lobatto', 2, 2, 4)

    return rebarYZ
Example #20
0
#Column Section
EICol = Ec * IzCol  # EI, for moment-curvature relationship
EACol = Ec * ACol  # EA, for axial-force-strain relationship
MyCol = 130000.0  #yield Moment calculated
PhiYCol = 0.65e-4  # yield curvature
EIColCrack = MyCol / PhiYCol  # cracked section inertia
b = 0.01  # strain-hardening ratio (ratio between post-yield tangent and initial elastic tangent)

op.uniaxialMaterial(
    'Steel01', ColMatTagFlex, MyCol, EIColCrack, b
)  #steel moment curvature isused for Mz of the section only, # bilinear behavior for flexure
op.uniaxialMaterial(
    'Elastic', ColMatTagAxial, EACol
)  # this is not used as a material, this is an axial-force-strain response
op.section(
    'Aggregator', ColSecTag, ColMatTagAxial, 'P', ColMatTagFlex, 'Mz'
)  # combine axial and flexural behavior into one section (no P-M interaction here)

ColTransfTag = 1
op.geomTransf('Linear', ColTransfTag)
numIntgrPts = 5
eleTag = 1
op.element('nonlinearBeamColumn', eleTag, 1, 2, numIntgrPts, ColSecTag,
           ColTransfTag)

op.recorder('Node', '-file', 'Data-2b/DFree.out', '-time', '-node', 2, '-dof',
            1, 2, 3, 'disp')
op.recorder('Node', '-file', 'Data-2b/DBase.out', '-time', '-node', 1, '-dof',
            1, 2, 3, 'disp')
op.recorder('Node', '-file', 'Data-2b/RBase.out', '-time', '-node', 1, '-dof',
            1, 2, 3, 'reaction')
def test_PlanarTrussExtra():
    A = 10.0
    E = 3000.
    L = 200.0
    alpha = 30.0
    P = 200.0

    sigmaYP = 60.0

    pi = 2.0*asin(1.0)
    alphaRad = alpha*pi/180.
    cosA = cos(alphaRad)
    sinA = sin(alphaRad)


    # EXACT RESULTS per Popov
    F1 = P/(2*cosA*cosA*cosA + 1)
    F2 = F1*cosA*cosA
    disp = -F1*L/(A*E)


    b = 1.0
    d = A
    z = A
    y = 1.0

    numFiberY = 10  # note we only need so many to get the required accuracy on eigenvalue 1e-7!
    numFiberZ = 1

    # create the finite element model
    for sectType in ['Fiber', 'Uniaxial']:

        print("  - Linear (Example 2.14) sectType: ", sectType)
        
        testOK = 0

        ops.wipe()
        
        ops.model( 'Basic', '-ndm', 2, '-ndf', 2)
        
        dX = L*tan(alphaRad)
        
        ops.node(1,    0.0,          0.0)
        ops.node(2,    dX ,         0.0)
        ops.node(3,  2.0*dX,  0.0)
        ops.node(4,    dX,         -L     )
        
        ops.fix(1, 1, 1)
        ops.fix(2, 1, 1)
        ops.fix(3, 1, 1)
        
        if sectType == "Uniaxial":
            ops.uniaxialMaterial( 'Elastic', 1, A*E)
            ops.section( 'Uniaxial', 1, 1, 'P')
        else:
            ops.uniaxialMaterial( 'Elastic', 1, E)
            ops.section('Fiber', 1) 	
        #	    patch rect 1 numFiberY numFiberZ [expr -z/2.0] [expr -y/2.0] [expr z/2.0] [expr y/2.0]	    
            ops.patch( 'rect', 1, numFiberY, numFiberZ, -z, -y, 0., 0.)
        

        ops.element('Truss', 1, 1, 4, 1)
        ops.element('Truss', 2, 2, 4, 1)
        ops.element('Truss', 3, 3, 4, 1)
        
        ops.timeSeries( 'Linear', 1)
        ops.pattern( 'Plain', 1, 1) 
        ops.load( 4, 0., -P)
        
        
        ops.numberer( 'Plain')
        ops.constraints( 'Plain')
        ops.algorithm('Linear')
        ops.system('ProfileSPD')
        ops.integrator('LoadControl', 1.0)
        ops.analysis('Static')
        ops.analyze(1)
        
        #
        # print table of camparsion
        #          
        
        comparisonResults = F2, F1, F2
        print("\nElement Force Comparison:")
        tol = 1.0e-6
        print('{:>10}{:>15}{:>15}'.format('Element','OpenSees','Popov'))

        for i in range(1,4):
            exactResult = comparisonResults[i-1]
            eleForce =ops.eleResponse( i, 'axialForce')
            print('{:>10d}{:>15.4f}{:>15.4f}'.format(i, eleForce[0], exactResult))
            if abs(eleForce[0]-exactResult) > tol:
                testOK = -1
                print("failed force-> ", abs(eleForce[0]-exactResult), " ", tol)
        
        print("\nDisplacement Comparison:")
        osDisp = ops.nodeDisp( 4, 2)
        print('{:>10}{:>15.8f}{:>10}{:>15.8f}'.format('OpenSees:',osDisp,'Exact:', disp))
        if abs(osDisp-disp) > tol:
            testOK = -1
            print("failed linear disp")
        
        print("\n\n  - NonLinear (Example2.23) sectType: ", sectType)
        
        #EXACT
        # Exact per Popov
        
        PA =  (sigmaYP*A) * (1.0+2*cosA*cosA*cosA)
        dispA = PA/P*disp
        
        PB = (sigmaYP*A) * (1.0+2*cosA)
        dispB = dispA / (cosA*cosA)
        
        # create the new finite element model for nonlinear case
        #   will apply failure loads and calculate displacements
        
        ops.wipe()
        
        ops.model('Basic', '-ndm', 2, '-ndf', 2)

        ops.node( 1,    0.0,          0.0)
        ops.node( 2,    dX,          0.0)
        ops.node( 3, 2.0*dX,  0.0)
        ops.node( 4,    dX,         -L     )

        ops.fix( 1, 1, 1)
        ops.fix( 2, 1, 1)
        ops.fix( 3, 1, 1)


        if sectType == "Uniaxial":
            ops.uniaxialMaterial( 'ElasticPP', 1, A*E, sigmaYP/E)
            ops.section( 'Uniaxial', 1, 1, 'P')
        else:
            ops.uniaxialMaterial( 'ElasticPP', 1, E, sigmaYP/E)
            ops.section( 'Fiber', 1) 	
            ops.patch( 'rect', 1, numFiberY, numFiberZ, -z/2.0, -y/2.0, z/2.0, y/2.0)


        ops.element('Truss', 1, 1, 4, 1)
        ops.element('Truss', 2, 2, 4, 1)
        ops.element('Truss', 3, 3, 4, 1)

        ops.timeSeries( 'Path', 1, '-dt', 1.0, '-values', 0.0, PA, PB, PB)
        ops.pattern('Plain', 1, 1)
        ops.load( 4, 0., -1.0)
        
        ops.numberer('Plain')
        ops.constraints('Plain')
        ops.algorithm('Linear')
        ops.system('ProfileSPD')
        ops.integrator('LoadControl', 1.0)
        ops.analysis('Static')
        ops.analyze(1)

        osDispA = ops.nodeDisp( 4, 2)
        
        ops.analyze(1)
        osDispB = ops.nodeDisp( 4, 2)
        
        print("\nDisplacement Comparison:")
        print("elastic limit state:")
        osDisp = ops.nodeDisp( 4, 2)
        print('{:>10}{:>15.8f}{:>10}{:>15.8f}'.format('OpenSees:',osDispA,'Exact:',dispA))

        if abs(osDispA-dispA) > tol:
            testOK = -1
            print("failed nonlineaer elastic limit disp")

        print("collapse limit state:")
        print('{:>10}{:>15.8f}{:>10}{:>15.8f}'.format('OpenSees:',osDispB,'Exact:',dispB))

        if abs(osDispB-dispB) > tol:
            testOK = -1
            print("failed nonlineaer collapse limit disp")



    assert testOK == 0
Example #22
0
#             |                       |     |
#             |                       |     |
#             |   o     o     o    |     |    -- cover
#             ---------------------     --   --
#             |-------- B --------|
#
# RC section:

coverY = HCol / 2.0  # The distance from the section z-axis to the edge of the cover concrete -- outer edge of cover concrete
coverZ = BCol / 2.0  # The distance from the section y-axis to the edge of the cover concrete -- outer edge of cover concrete
coreY = coverY - coverCol
coreZ = coverZ - coverCol
nfY = 16  # number of fibers for concrete in y-direction
nfZ = 4  # number of fibers for concrete in z-direction

op.section('Fiber', ColSecTag)
op.patch('quad', IDconcU, nfZ, nfY, -coverY, coverZ, -coverY, -coverZ, coverY,
         -coverZ, coverY, coverZ)  # Define the concrete patch
op.layer('straight', IDreinf, numBarsCol, barAreaCol, -coreY, coreZ, -coreY,
         -coreZ)
op.layer('straight', IDreinf, numBarsCol, barAreaCol, coreY, coreZ, coreY,
         -coreZ)
ColTransfTag = 1
op.geomTransf('Linear', ColTransfTag)
numIntgrPts = 5
eleTag = 1

op.element('nonlinearBeamColumn', eleTag, 1, 2, numIntgrPts, ColSecTag,
           ColTransfTag)

op.recorder('Node', '-file', 'Data-3-inelastic/DFree.out', '-time', '-node', 2,
Example #23
0
def test_PinchedCylinder():

    P = 1
    R = 300.
    L = 600.
    E = 3e6
    thickness = R / 100.

    uExact = -164.24 * P / (E * thickness)

    formatString = '{:>20s}{:>15.5e}'
    print("\n  Displacement Under Applied Load:\n")

    formatString = '{:>20s}{:>10s}{:>15s}{:>15s}{:>15s}'
    print(
        formatString.format("Element Type", "   mesh  ", "OpenSees", "Exact",
                            "%Error"))

    for shellType in ['ShellMITC4', 'ShellDKGQ', 'ShellNLDKGQ']:
        for numEle in [4, 16, 32]:

            ops.wipe()

            # ----------------------------
            # Start of model generation
            # ----------------------------
            ops.model('basic', '-ndm', 3, '-ndf', 6)

            radius = R
            length = L / 2.

            E = 3.0e6
            v = 0.3
            PI = 3.14159

            ops.nDMaterial('ElasticIsotropic', 1, E, v)
            ops.nDMaterial('PlateFiber', 2, 1)
            ops.section('PlateFiber', 1, 2, thickness)
            #section ElasticMembranePlateSection  1   E v thickness 0.
            nR = numEle
            nY = numEle

            tipNode = (nR + 1) * (nY + 1)

            #create nodes
            nodeTag = 1
            for i in range(nR + 1):
                theta = i * PI / (2.0 * nR)
                xLoc = 300 * cos(theta)
                zLoc = 300 * sin(theta)

                for j in range(nY + 1):
                    yLoc = j * length / (1.0 * nY)
                    ops.node(nodeTag, xLoc, yLoc, zLoc)
                    nodeTag += 1

            #create elements
            eleTag = 1
            for i in range(nR):
                iNode = i * (nY + 1) + 1
                jNode = iNode + 1
                lNode = iNode + (nY + 1)
                kNode = lNode + 1
                for j in range(nY):
                    ops.element(shellType, eleTag, iNode, jNode, kNode, lNode,
                                1)
                    eleTag += 1
                    iNode += 1
                    jNode += 1
                    kNode += 1
                    lNode += 1

            # define the boundary conditions
            ops.fixX(radius, 0, 0, 1, 1, 1, 0, '-tol', 1.0e-2)
            ops.fixZ(radius, 1, 0, 0, 0, 1, 1, '-tol', 1.0e-2)
            ops.fixY(0., 1, 0, 1, 0, 0, 0, '-tol', 1.0e-2)
            ops.fixY(length, 0, 1, 0, 1, 0, 1, '-tol', 1.0e-2)

            #define loads
            ops.timeSeries('Linear', 1)
            ops.pattern('Plain', 1, 1)
            ops.load(tipNode, 0., 0., -1. / 4.0, 0., 0., 0.)

            ops.integrator('LoadControl', 1.0)
            ops.test('EnergyIncr', 1.0e-10, 20, 0)
            ops.algorithm('Newton')
            ops.numberer('RCM')
            ops.constraints('Plain')
            ops.system('Umfpack')
            ops.analysis('Static')

            ops.analyze(1)
            res = ops.nodeDisp(tipNode, 3)
            err = abs(100 * (uExact - res) / uExact)
            formatString = '{:>20s}{:>5d}{:>3s}{:>2d}{:>15.5e}{:>15.5e}{:>15.2f}'
            print(
                formatString.format(shellType, numEle, " x ", numEle, res,
                                    uExact, err))

    tol = 5.0
    if abs(100 * (uExact - res) / uExact) > tol:
        testOK = 1
    else:
        testOK = 0

    assert testOK == 0
    lvl_01_05_col_point_bottom_J = lvl_01_05_col.low_flange_main_point_2

    #   get main point for top flange
    lvl_01_05_col_point_top_I = lvl_01_05_col.top_flange_main_point_1
    lvl_01_05_col_point_top_J = lvl_01_05_col.top_flange_main_point_2

    #   get main point for left web
    lvl_01_05_col_point_web_left_I = lvl_01_05_col.web_main_left_point_1
    lvl_01_05_col_point_web_left_J = lvl_01_05_col.web_main_left_point_2

    #   get main point for right web
    lvl_01_05_col_point_web_right_I = lvl_01_05_col.web_main_right_point_1
    lvl_01_05_col_point_web_right_J = lvl_01_05_col.web_main_right_point_2

    #   opensees section:
    ops.section('Fiber', 1, '-torsion', 1)

    ops.patch("rect", 1, 5, 1, *lvl_01_05_col_point_bottom_I,
              *lvl_01_05_col_point_bottom_J)
    ops.patch("rect", 1, 5, 1, *lvl_01_05_col_point_top_I,
              *lvl_01_05_col_point_top_J)
    ops.patch("rect", 1, 1, 5, *lvl_01_05_col_point_web_left_I,
              *lvl_01_05_col_point_web_left_J)
    ops.patch("rect", 1, 1, 5, *lvl_01_05_col_point_web_right_I,
              *lvl_01_05_col_point_web_right_J)

    print("\n01-05层柱截面创建完毕")

    # =============================================================================
    # create section for columns from level 06 to level 10
    # =============================================================================
Example #25
0
Hkin = b / (1 - b) * Es

# Sensitivity-ready steel materials: Hardening, Steel01, SteelMP, BoucWen, SteelBRB, StainlessECThermal, SteelECThermal, ...
# Hardening Sensitivity Params: sigmaY/fy/Fy, E, H_kin/Hkin, H_iso/Hiso
ops.uniaxialMaterial("Hardening", matTag, Es, Fy, 0, Hkin)

# ops.uniaxialMaterial("Steel01", matTag, Fy, Es, b) # Sensitivity Params: sigmaY/fy/Fy, E, b, a1, a2, a3, a4
# ops.uniaxialMaterial("SteelMP", matTag, Fy, Es, b) # Sensitivity Params: sigmaY/fy, E, b

# Define sections
# ---------------
# Sections defined with "canned" section ("WFSection2d"), otherwise use a FiberSection object (ops.section("Fiber",...))
beamSecTag = 1
beamWidth, beamDepth = 10 * cm, 50 * cm
#                          secTag,     matTag, d,         tw,        bf,       tf, Nfw, Nff
ops.section("WFSection2d", beamSecTag, matTag, beamDepth, beamWidth, beamWidth,
            0, 20, 0)  # Beam section

# Define elements
# ---------------
beamTransTag, beamIntTag = 1, 1
# Linear, PDelta, Corotational
ops.geomTransf("Corotational", beamTransTag)

nip = 5
# Lobatto, Legendre, NewtonCotes, Radau, Trapezoidal, CompositeSimpson
ops.beamIntegration("Legendre", beamIntTag, beamSecTag, nip)

# Beam elements
numEle = 5
meshSize = L / numEle  # mesh size
def test_MomentCurvature():
    ops.wipe()

    # Define model builder
    # --------------------
    ops.model('basic', '-ndm', 2, '-ndf', 3)

    # Define materials for nonlinear columns
    # ------------------------------------------
    # CONCRETE                  tag   f'c        ec0   f'cu        ecu
    # Core concrete (confined)
    ops.uniaxialMaterial('Concrete01', 1, -6.0, -0.004, -5.0, -0.014)

    # Cover concrete (unconfined)
    ops.uniaxialMaterial('Concrete01', 2, -5.0, -0.002, 0.0, -0.006)

    # STEEL
    # Reinforcing steel
    fy = 60.0  # Yield stress
    E = 30000.0  # Young's modulus

    #                        tag  fy E0    b
    ops.uniaxialMaterial('Steel01', 3, fy, E, 0.01)

    # Define cross-section for nonlinear columns
    # ------------------------------------------

    # set some paramaters
    colWidth = 15
    colDepth = 24

    cover = 1.5
    As = 0.60
    # area of no. 7 bars

    # some variables derived from the parameters
    y1 = colDepth / 2.0
    z1 = colWidth / 2.0

    ops.section('Fiber', 1)

    # Create the concrete core fibers
    ops.patch('rect', 1, 10, 1, cover - y1, cover - z1, y1 - cover, z1 - cover)

    # Create the concrete cover fibers (top, bottom, left, right)
    ops.patch('rect', 2, 10, 1, -y1, z1 - cover, y1, z1)
    ops.patch('rect', 2, 10, 1, -y1, -z1, y1, cover - z1)
    ops.patch('rect', 2, 2, 1, -y1, cover - z1, cover - y1, z1 - cover)
    ops.patch('rect', 2, 2, 1, y1 - cover, cover - z1, y1, z1 - cover)

    # Create the reinforcing fibers (left, middle, right)
    ops.layer('straight', 3, 3, As, y1 - cover, z1 - cover, y1 - cover,
              cover - z1)
    ops.layer('straight', 3, 2, As, 0.0, z1 - cover, 0.0, cover - z1)
    ops.layer('straight', 3, 3, As, cover - y1, z1 - cover, cover - y1,
              cover - z1)

    # Estimate yield curvature
    # (Assuming no axial load and only top and bottom steel)
    # d -- from cover to rebar
    d = colDepth - cover
    # steel yield strain
    epsy = fy / E
    Ky = epsy / (0.7 * d)

    # Print estimate to standard output
    print("Estimated yield curvature: ", Ky)

    # Set axial load
    P = -180.0

    # Target ductility for analysis
    mu = 15.0

    # Number of analysis increments
    numIncr = 100

    # Call the section analysis procedure
    MomentCurvature(1, P, Ky * mu, numIncr)

    u = ops.nodeDisp(2, 3)
    assert abs(u - 0.00190476190476190541) < 1e-12
def test_EigenFrameExtra():

    eleTypes = [
        'elasticBeam', 'forceBeamElasticSection', 'dispBeamElasticSection',
        'forceBeamFiberSectionElasticMaterial',
        'dispBeamFiberSectionElasticMaterial'
    ]

    for eleType in eleTypes:

        ops.wipe()

        ops.model('Basic', '-ndm', 2)

        #    units kip, ft

        # properties
        bayWidth = 20.0
        storyHeight = 10.0

        numBay = 10
        numFloor = 9

        A = 3.0  #area = 3ft^2
        E = 432000.0  #youngs mod = 432000 k/ft^2
        I = 1.0  #second moment of area I=1ft^4
        M = 3.0  #mas/length = 4 kip sec^2/ft^2
        coordTransf = "Linear"  # Linear, PDelta, Corotational
        massType = "-lMass"  # -lMass, -cMass

        nPts = 3  # numGauss Points

        # an elastic material
        ops.uniaxialMaterial('Elastic', 1, E)

        # an elastic section
        ops.section('Elastic', 1, E, A, I)

        # a fiber section with A=3 and I = 1 (b=1.5, d=2) 2d bending about y-y axis
        #   b 1.5 d 2.0
        y = 2.0
        z = 1.5
        numFiberY = 2000  # note we only need so many to get the required accuracy on eigenvalue 1e-7!
        numFiberZ = 1
        ops.section('Fiber', 2)
        #   patch rect 1 numFiberY numFiberZ 0.0 0.0 z y
        ops.patch('quad', 1, numFiberY, numFiberZ, -y / 2.0, -z / 2.0, y / 2.0,
                  -z / 2.0, y / 2.0, z / 2.0, -y / 2.0, z / 2.0)

        # add the nodes
        #  - floor at a time
        nodeTag = 1
        yLoc = 0.
        for j in range(0, numFloor + 1):
            xLoc = 0.
            for i in range(numBay + 1):
                ops.node(nodeTag, xLoc, yLoc)
                xLoc += bayWidth
                nodeTag += 1

            yLoc += storyHeight

        # fix base nodes
        for i in range(1, numBay + 2):
            ops.fix(i, 1, 1, 1)

        # add column element
        transfTag = 1
        ops.geomTransf(coordTransf, transfTag)
        integTag1 = 1
        ops.beamIntegration('Lobatto', integTag1, 1, nPts)
        integTag2 = 2
        ops.beamIntegration('Lobatto', integTag2, 2, nPts)
        eleTag = 1
        for i in range(numBay + 1):
            end1 = i + 1
            end2 = end1 + numBay + 1
            for j in range(numFloor):

                if eleType == "elasticBeam":
                    ops.element('elasticBeamColumn', eleTag, end1, end2, A, E,
                                I, 1, '-mass', M, massType)
                elif eleType == "forceBeamElasticSection":
                    ops.element('forceBeamColumn', eleTag, end1, end2,
                                transfTag, integTag1, '-mass', M)
                elif eleType == "dispBeamElasticSection":
                    ops.element('dispBeamColumn', eleTag, end1, end2,
                                transfTag, integTag1, '-mass', M, massType)
                elif eleType == "forceBeamFiberSectionElasticMaterial":
                    ops.element('forceBeamColumn', eleTag, end1, end2,
                                transfTag, integTag2, '-mass', M)
                elif eleType == "dispBeamFiberSectionElasticMaterial":
                    ops.element('dispBeamColumn', eleTag, end1, end2,
                                transfTag, integTag2, '-mass', M, massType)
                else:
                    print("BARF")

                end1 = end2
                end2 = end1 + numBay + 1
                eleTag += 1

        # add beam elements
        for j in range(1, numFloor + 1):
            end1 = (numBay + 1) * j + 1
            end2 = end1 + 1
            for i in range(numBay):
                if eleType == "elasticBeam":
                    ops.element('elasticBeamColumn', eleTag, end1, end2, A, E,
                                I, 1, '-mass', M, massType)
                elif eleType == "forceBeamElasticSection":
                    ops.element('forceBeamColumn', eleTag, end1, end2,
                                transfTag, integTag1, '-mass', M)
                elif eleType == "dispBeamElasticSection":
                    ops.element('dispBeamColumn', eleTag, end1, end2,
                                transfTag, integTag1, '-mass', M, massType)
                elif eleType == "forceBeamFiberSectionElasticMaterial":
                    ops.element('forceBeamColumn', eleTag, end1, end2,
                                transfTag, integTag2, '-mass', M)
                elif eleType == "dispBeamFiberSectionElasticMaterial":
                    ops.element('dispBeamColumn', eleTag, end1, end2,
                                transfTag, integTag2, '-mass', M, massType)
                else:
                    print("BARF")

    #           element(elasticBeamColumn eleTag end1 end2 A E I 1 -mass M
                end1 = end2
                end2 = end1 + 1
                eleTag += 1

        # calculate eigenvalues
        numEigen = 3
        eigenValues = ops.eigen(numEigen)
        PI = 2 * asin(1.0)

        # determine PASS/FAILURE of test
        testOK = 0

        # print table of camparsion
        #                         Bathe & Wilson               Peterson                    SAP2000                  SeismoStruct

        comparisonResults = [[0.589541, 5.52695, 16.5878],
                             [0.589541, 5.52696, 16.5879],
                             [0.589541, 5.52696, 16.5879],
                             [0.58955, 5.527, 16.588]]
        print("\n\nEigenvalue Comparisons for eleType:", eleType)
        tolerances = [9.99e-7, 9.99e-6, 9.99e-5]
        formatString = '{:>15}{:>15}{:>15}{:>15}{:>15}'
        print(
            formatString.format('OpenSees', 'Bathe&Wilson', 'Peterson',
                                'SAP2000', 'SeismoStruct'))
        formatString = '{:>15.5f}{:>15.4f}{:>15.4f}{:>15.4f}{:>15.3f}'
        for i in range(numEigen):
            lamb = eigenValues[i]
            print(
                formatString.format(lamb, comparisonResults[0][i],
                                    comparisonResults[1][i],
                                    comparisonResults[2][i],
                                    comparisonResults[3][i]))
            resultOther = comparisonResults[2][i]
            tol = tolerances[i]
            if abs(lamb - resultOther) > tol:
                testOK = -1
                print("failed->", abs(lamb - resultOther), tol)

        assert testOK == 0

    solverTypes = [
        '-genBandArpack', '-fullGenLapack', '-UmfPack', '-SuperLU',
        '-ProfileSPD'
    ]

    for solverType in solverTypes:

        eleType = 'elasticBeam'

        ops.wipe()

        ops.model('Basic', '-ndm', 2)

        #    units kip, ft

        # properties
        bayWidth = 20.0
        storyHeight = 10.0

        numBay = 10
        numFloor = 9

        A = 3.0  #area = 3ft^2
        E = 432000.0  #youngs mod = 432000 k/ft^2
        I = 1.0  #second moment of area I=1ft^4
        M = 3.0  #mas/length = 4 kip sec^2/ft^2
        coordTransf = "Linear"  # Linear, PDelta, Corotational
        massType = "-lMass"  # -lMass, -cMass

        nPts = 3  # numGauss Points

        # an elastic material
        ops.uniaxialMaterial('Elastic', 1, E)

        # an elastic section
        ops.section('Elastic', 1, E, A, I)

        # a fiber section with A=3 and I = 1 (b=1.5, d=2) 2d bending about y-y axis
        #   b 1.5 d 2.0
        y = 2.0
        z = 1.5
        numFiberY = 2000  # note we only need so many to get the required accuracy on eigenvalue 1e-7!
        numFiberZ = 1
        ops.section('Fiber', 2)
        #   patch rect 1 numFiberY numFiberZ 0.0 0.0 z y
        ops.patch('quad', 1, numFiberY, numFiberZ, -y / 2.0, -z / 2.0, y / 2.0,
                  -z / 2.0, y / 2.0, z / 2.0, -y / 2.0, z / 2.0)

        # add the nodes
        #  - floor at a time
        nodeTag = 1
        yLoc = 0.
        for j in range(0, numFloor + 1):
            xLoc = 0.
            for i in range(numBay + 1):
                ops.node(nodeTag, xLoc, yLoc)
                xLoc += bayWidth
                nodeTag += 1

            yLoc += storyHeight

        # fix base nodes
        for i in range(1, numBay + 2):
            ops.fix(i, 1, 1, 1)

        # add column element
        transfTag = 1
        ops.geomTransf(coordTransf, transfTag)
        integTag1 = 1
        ops.beamIntegration('Lobatto', integTag1, 1, nPts)
        integTag2 = 2
        ops.beamIntegration('Lobatto', integTag2, 2, nPts)
        eleTag = 1
        for i in range(numBay + 1):
            end1 = i + 1
            end2 = end1 + numBay + 1
            for j in range(numFloor):

                if eleType == "elasticBeam":
                    ops.element('elasticBeamColumn', eleTag, end1, end2, A, E,
                                I, 1, '-mass', M, massType)

                elif eleType == "forceBeamElasticSection":
                    ops.element('forceBeamColumn', eleTag, end1, end2,
                                transfTag, integTag1, '-mass', M)

                elif eleType == "dispBeamElasticSection":
                    ops.element('dispBeamColumn', eleTag, end1, end2,
                                transfTag, integTag1, '-mass', M, massType)
                elif eleType == "forceBeamFiberSectionElasticMaterial":
                    ops.element('forceBeamColumn', eleTag, end1, end2,
                                transfTag, integTag2, '-mass', M)

                elif eleType == "dispBeamFiberSectionElasticMaterial":
                    ops.element('dispBeamColumn', eleTag, end1, end2,
                                transfTag, integTag2, '-mass', M, massType)
                else:
                    print("BARF")

                end1 = end2
                end2 = end1 + numBay + 1
                eleTag += 1

        # add beam elements
        for j in range(1, numFloor + 1):
            end1 = (numBay + 1) * j + 1
            end2 = end1 + 1
            for i in range(numBay):
                if eleType == "elasticBeam":
                    ops.element('elasticBeamColumn', eleTag, end1, end2, A, E,
                                I, 1, '-mass', M, massType)
                elif eleType == "forceBeamElasticSection":
                    ops.element('forceBeamColumn', eleTag, end1, end2,
                                transfTag, integTag1, '-mass', M)
                elif eleType == "dispBeamElasticSection":
                    ops.element('dispBeamColumn', eleTag, end1, end2,
                                transfTag, integTag1, '-mass', M, massType)
                elif eleType == "forceBeamFiberSectionElasticMaterial":
                    ops.element('forceBeamColumn', eleTag, end1, end2,
                                transfTag, integTag2, '-mass', M)
                elif eleType == "dispBeamFiberSectionElasticMaterial":
                    ops.element('dispBeamColumn', eleTag, end1, end2,
                                transfTag, integTag2, '-mass', M, massType)
                else:
                    print("BARF")

    #           element(elasticBeamColumn eleTag end1 end2 A E I 1 -mass M
                end1 = end2
                end2 = end1 + 1
                eleTag += 1

        # calculate eigenvalues
        numEigen = 3
        eigenValues = ops.eigen(solverType, numEigen)
        PI = 2 * asin(1.0)

        # determine PASS/FAILURE of test
        testOK = 0

        # print table of camparsion
        #                         Bathe & Wilson               Peterson                    SAP2000                  SeismoStruct

        comparisonResults = [[0.589541, 5.52695, 16.5878],
                             [0.589541, 5.52696, 16.5879],
                             [0.589541, 5.52696, 16.5879],
                             [0.58955, 5.527, 16.588]]
        print("\n\nEigenvalue Comparisons for solverType:", solverType)
        tolerances = [9.99e-7, 9.99e-6, 9.99e-5]
        formatString = '{:>15}{:>15}{:>15}{:>15}{:>15}'
        print(
            formatString.format('OpenSees', 'Bathe&Wilson', 'Peterson',
                                'SAP2000', 'SeismoStruct'))
        formatString = '{:>15.5f}{:>15.4f}{:>15.4f}{:>15.4f}{:>15.3f}'
        for i in range(numEigen):
            lamb = eigenValues[i]
            print(
                formatString.format(lamb, comparisonResults[0][i],
                                    comparisonResults[1][i],
                                    comparisonResults[2][i],
                                    comparisonResults[3][i]))
            resultOther = comparisonResults[2][i]
            tol = tolerances[i]
            if abs(lamb - resultOther) > tol:
                testOK = -1
                print("failed->", abs(lamb - resultOther), tol)

        assert testOK == 0
Example #28
0
# set concrete
ops.nDMaterial('PlaneStressUserMaterial', 1, 40, 7, 30.8e6, 3.08e6, -6.16e6,
               -0.002, -0.005, 0.001, 0.05)
ops.nDMaterial('PlateFromPlaneStress', 4, 1, 1.283e10)

# set steel
ops.uniaxialMaterial('Steel02', 7, 379e6, 202.7e9, 0.01, 18.5, 0.925, 0.15)
ops.uniaxialMaterial('Steel02', 8, 392e6, 200.6e9, 0.01, 18.5, 0.925, 0.15)
ops.nDMaterial('PlateRebar', 9, 7, 90)
ops.nDMaterial('PlateRebar', 10, 8, 90)
ops.nDMaterial('PlateRebar', 11, 8, 0)

# set section
ops.section('LayeredShell', 1, 10, 4, 0.0125, 11, 0.0003023, 11, 0.0004367, 4,
            0.0246305, 4, 0.0246305, 4, 0.0246305, 4, 0.0246305, 11, 0.0004367,
            11, 0.0003023, 4, 0.0125)
ops.section('LayeredShell', 2, 8, 4, 0.0125, 11, 0.0003023, 10, 0.0002356, 4,
            0.0494621, 4, 0.0494621, 10, 0.0002356, 11, 0.0003023, 4, 0.0125)

# set node
ops.node(1, 0.0, 0, 0)
ops.node(2, 0.2, 0, 0)
ops.node(3, 0.5, 0, 0)
ops.node(4, 0.8, 0, 0)
ops.node(5, 1.0, 0, 0)
ops.node(6, 0.0, 0.2, 0)
ops.node(7, 0.2, 0.2, 0)
ops.node(8, 0.5, 0.2, 0)
ops.node(9, 0.8, 0.2, 0)
ops.node(10, 1.0, 0.2, 0)
Example #29
0
#    z <--- |          +           |     H
#             |                       |     |
#             |                       |     |
#             |   o     o     o    |     |    -- cover
#             ---------------------     --   --
#             |-------- B --------|
#
# RC section:
coverY = HCol / 2.0  # The distance from the section z-axis to the edge of the cover concrete -- outer edge of cover concrete
coverZ = BCol / 2.0  # The distance from the section y-axis to the edge of the cover concrete -- outer edge of cover concrete
coreY = coverY - coverCol
coreZ = coverZ - coverCol
nfY = 16  # number of fibers for concrete in y-direction
nfZ = 4  # number of fibers for concrete in z-direction

op.section('Fiber', ColSecTag)
op.patch('quad', IDconcU, nfZ, nfY, -coverY, coverZ, -coverY, -coverZ, coverY,
         -coverZ, coverY, coverZ)  # Define the concrete patch
op.layer('straight', IDreinf, numBarsCol, barAreaCol, -coreY, coreZ, -coreY,
         -coreZ)
op.layer('straight', IDreinf, numBarsCol, barAreaCol, coreY, coreZ, coreY,
         -coreZ)

# BEAM section:
op.section('Elastic', BeamSecTag, Ec, ABeam, IzBeam)  # elastic beam section)

ColTransfTag = 1
BeamTransfTag = 2
op.geomTransf('Linear', ColTransfTag)
op.geomTransf('Linear', BeamTransfTag)
Example #30
0
def uniaxial_steel01_section(section_id, mat_id=None):
    if mat_id is None:
        mat_id = section_id
    uniaxial_steel01_material(mat_id)

    op.section("Uniaxial", section_id, mat_id, "Mz")