Пример #1
0
def test_displacement(app2):
    """Cantilever beam with displacement support"""

    # get pipe objects
    pt10 = app2.points(10)
    pt20 = app2.points(20)
    run10 = app2.elements(10, 15)
    run20 = app2.elements(15, 20)

    # support
    anc1 = Anchor('A1', 10)
    anc1.apply([run10])

    disp1 = Displacement('D1', 1, 20, dx=1)
    disp1.apply([run20])

    # loads
    F1 = Force('F1', 1, 20, fy=-10000)
    F1.apply([run20])

    # loadcase
    L1 = LoadCase('L1', 'ope', [Force, Displacement], [1, 1])

    app2.models('simple').analyze()

    # check dx at 10
    assert compare(L1.movements[pt20].dx, 1)
Пример #2
0
def test_incline(app):
    """Skewed support test"""

    # get pipe objects
    pt10 = app.points(10)
    pt20 = app.points(20)

    run15 = app.elements(10, 15)
    run20 = app.elements(15, 20)

    anc10 = Anchor('anc10', 10)
    anc10.apply([run15])

    y20 = Inclined('y20', 20, (-0.7071, 0.7071, 0))
    y20.apply([run20])

    # loads
    F1 = Force('F1', 1, 15, fy=-10000)
    F1.apply([run15])

    W1 = Weight('W1', 1)
    W1.apply([run15, run20])

    # loadcase
    L1 = LoadCase('L1', 'ope', [Weight, Force], [1, 1])

    app.models('simple').analyze()

    # check reactions due to fy, mx
    assert compare(L1.reactions[pt10].fy, -7108.9)
    assert compare(L1.reactions[pt10].mz, -19067.105)

    # check reactions due to fx, fy
    assert compare(L1.reactions[pt20].fx, 3295.48)
    assert compare(L1.reactions[pt20].fy, -3295.48)
Пример #3
0
def test_limitstop(app):
    """Limit stop test"""

    # get pipe objects
    pt20 = app.points(20)

    run15 = app.elements(10, 15)
    run20 = app.elements(15, 20)

    anc10 = Anchor('anc10', 10)
    anc10.apply([run15])

    lim20 = LimitStop('lim20', 20)
    lim20.apply([run20])

    # loads
    T1 = Thermal('T1', 1, 500, 70)
    T1.apply([run15, run20])

    # loadcase
    L1 = LoadCase('L1', 'ope', [Thermal], [1])

    app.models('simple').analyze()

    # check reactions due to fx
    assert compare(L1.reactions[pt20].fx, 1002348.1)
Пример #4
0
def test_insulation():
    """Test combined weight of pipe and insulation with no contents"""
    # parameter
    L = 10 * 12

    app = App()
    mdl = Model('simple')

    # properties
    Pipe.from_file('pipe1', '10', '40')
    Insulation.from_file('insul1', 'minwool', 3)
    Material.from_file('mat1', 'A53A', 'B31.1')
    B31167('B31.1')

    pt10 = Point(10)
    run20 = Run(20, L)

    anc10 = Anchor('anc10', 10)
    anc10.apply([run20])

    app.elements.select()
    dw = Weight('dw', 1)
    dw.apply()

    lc1 = LoadCase('lc1', 'sus', [Weight], [1])

    mdl.analyze()

    assert compare(lc1.reactions[pt10].fy, -521.3947)
Пример #5
0
def test_anchor(app):
    """Cantilever beam with concentrated force"""

    # get pipe objects
    pt10 = app.points(10)
    run10 = app.elements(10, 15)
    run20 = app.elements(15, 20)

    # support
    anc1 = Anchor('A1', 10)
    anc1.apply([run10])

    # loads
    F1 = Force('F1', 1, 20, fy=-10000)
    F1.apply([run20])

    F2 = Force('F2', 2, 20, fx=-10000)
    F2.apply([run20])

    F3 = Force('F3', 3, 20, fz=-10000)
    F3.apply([run20])

    # loadcase
    L1 = LoadCase('L1', 'ope', [Force], [1])
    L2 = LoadCase('L2', 'ope', [Force], [2])
    L3 = LoadCase('L3', 'ope', [Force], [3])

    app.models('simple').analyze()

    # check reactions due to fy, mz
    assert compare(L1.reactions[pt10][1], -10000)
    assert compare(L1.reactions[pt10][5], -100000)

    # check reaction due to fx
    assert compare(L2.reactions[pt10][0], -10000)

    # check reaction due to fz, fy
    assert compare(L3.reactions[pt10][2], -10000)
    assert compare(L3.reactions[pt10][4], 100000)
Пример #6
0
def test_seismic_z(app):
    """Check displacements due to seismic loading in z direction."""
    # loads
    S1 = Seismic('S1', 1, gz=1.0)
    S1.apply()

    L1 = LoadCase('L1', 'occ', [Seismic], [1])

    app.models('loads').analyze()

    pt30 = app.points(30)
    dy, dz, rx = 1, 2, 3

    assert compare(L1.movements[pt30][dy], -0.330)
    assert compare(L1.movements[pt30][dz], 1.305)
    assert compare(L1.movements[pt30][rx], 0.3966)
Пример #7
0
def test_seismic_x(app):
    """Check displacements due to seismic loading in x direction."""
    # loads
    S1 = Seismic('S1', 1, gx=1.0)
    S1.apply()

    L1 = LoadCase('L1', 'occ', [Seismic], [1])

    app.models('loads').analyze()

    pt30 = app.points(30)
    dx, ry, rz = 0, 4, 5

    assert compare(L1.movements[pt30][dx], 1.436)
    assert compare(L1.movements[pt30][ry], -0.1830)
    assert compare(L1.movements[pt30][rz], -0.4091)
Пример #8
0
def test_thermal(app):
    """Check displacements due to thermal loading."""
    # loads
    T1 = Thermal('T1', 1, 900, 70)
    T1.apply()

    L1 = LoadCase('L1', 'exp', [Thermal], [1])

    app.models('loads').analyze()

    pt30 = app.points(30)
    dy, dz, rx = 1, 2, 3

    assert compare(L1.movements[pt30][dy], 0.758)
    assert compare(L1.movements[pt30][dz], 1.891)
    assert compare(L1.movements[pt30][rx], 0.1521)
Пример #9
0
def test_minus_y_positive_load(app):
    """Simply supported beam with central concentrated force and a non-linear
    -Y support.
    """

    # get pipe objects
    pt10 = app.points(10)
    pt15 = app.points(15)
    pt20 = app.points(20)

    run10 = app.elements(10, 15)
    run20 = app.elements(15, 20)

    # supports
    gblx10 = X('GblX10', 10)
    gblx10.apply([run10])

    gbly10 = Y('GblY10', 10)
    gbly10.apply([run10])

    gblz10 = Z('GblZ10', 10)
    gblz10.apply([run10])

    # constrain torsion
    gblrotx10 = X('GblRotX10', 10, is_rotational=True)
    gblrotx10.apply([run10])

    # nonlinear -Y
    gbly20 = Y('GblY20', 20, direction="-")
    gbly20.apply([run20])

    gblz20 = Z('GblZ20', 20)
    gblz20.apply([run20])

    # loads
    F1 = Force('F1', 1, 15, fy=10000)
    F1.apply([run10])

    # loadcase
    L1 = LoadCase('L1', 'ope', [Force], [1])

    app.models('simple').analyze()

    # check reactions due to fy
    assert compare(L1.reactions[pt10][1], 5000)
    assert compare(L1.reactions[pt20][1], 5000)
    assert compare(L1.movements[pt20][1], 0)
Пример #10
0
def test_deadweight(app):
    """Check deadweight displacements due to gravity."""
    # loads
    W1 = Weight('W1', 1)
    W1.apply()  # to selected elements

    # loadcase
    L1 = LoadCase('L1', 'sus', [Weight], [1])

    app.models('loads').analyze()

    pt30 = app.points(30)
    dy, dz, rx = 1, 2, 3

    assert compare(L1.movements[pt30][dy], 0.33)
    assert compare(L1.movements[pt30][dz], -1.31)
    assert compare(L1.movements[pt30][rx], -0.4)
Пример #11
0
def test_fluid(app):
    """Check deadweight displacement pipe fluid contents."""
    # loads
    W1 = Weight('W1', 1)
    W1.apply()  # to selected elements

    FL1 = Fluid.from_file('FL1', 1, 'water')
    FL1.apply()

    # loadcase
    L1 = LoadCase('L1', 'sus', [Weight, Fluid], [1, 1])

    app.models('loads').analyze()

    pt30 = app.points(30)

    assert compare(L1.movements[pt30].dz, -2.4078)
Пример #12
0
def test_global_y(app):
    """Simply supported beam with central concentrated force"""

    # get pipe objects
    pt10 = app.points(10)
    pt15 = app.points(15)
    pt20 = app.points(20)

    run10 = app.elements(10, 15)
    run20 = app.elements(15, 20)

    # supports
    gblx10 = X('GblX10', 10)
    gblx10.apply([run10])

    gbly10 = Y('GblY10', 10)
    gbly10.apply([run10])

    gblz10 = Z('GblZ10', 10)
    gblz10.apply([run10])

    # constrain torsion
    gblrotx10 = X('GblRotX10', 10, is_rotational=True)
    gblrotx10.apply([run10])

    gbly20 = Y('GblY20', 20)
    gbly20.apply([run20])

    gblz20 = Z('GblZ20', 20)
    gblz20.apply([run20])

    # loads
    F1 = Force('F1', 1, 15, fy=-10000)
    F1.apply([run10])

    # loadcase
    L1 = LoadCase('L1', 'ope', [Force], [1])

    app.models('simple').analyze()

    # check reactions due to fy
    assert compare(L1.reactions[pt10][1], -5000)
    assert compare(L1.reactions[pt20][1], -5000)

    # check max moment at the middle, mz
    assert compare(L1.forces[pt15][5], -25000)
Пример #13
0
def test_guide(app):
    # get pipe objects
    pt10 = app.points(10)
    pt20 = app.points(20)
    run15 = app.elements(10, 15)
    run20 = app.elements(15, 20)

    # supports
    gblx10 = X('GblX10', 10)
    gblx10.apply([run15])

    gbly10 = Y('GblY10', 10)
    gbly10.apply([run15])

    gblz10 = Z('GblZ10', 10)
    gblz10.apply([run15])

    gblrotx10 = X('GblRotX10', 10, is_rotational=True)
    gblrotx10.apply([run15])

    guide20 = Lateral('guide20', 20)
    guide20.apply([run20])
    guide20.flip()  # not required for horizontal elements

    # loads
    T1 = Thermal('T1', 1, 500, 70)
    T1.apply([run15, run20])

    F1 = Force('F1', 1, 15, fz=-10000)
    F1.apply([run15])

    # loadcase
    L1 = LoadCase('L1', 'ope', [Thermal, Force], [1, 1])

    app.models('simple').analyze()

    assert compare(L1.reactions[pt20].fx, 0)
    assert compare(L1.reactions[pt20].fy, 0)
    assert compare(L1.reactions[pt20].fz, -5000)
Пример #14
0
def app():
    app = App()
    points = app.points

    mdl = Model('sifs')
    mdl.settings.vertical = "z"

    Pipe.from_file('pipe1', '3.5', '40')
    Material.from_file('mat1', 'A53A', 'B31.1')
    B31167('code1')

    Point(10)
    run20 = Run(20, 5 * 12)
    Run(30, 5 * 12)

    points(20).activate()
    Run(40, 0, 0, 5 * 12)

    anc10 = Anchor('anc10', 10)
    anc10.apply([run20])

    app.elements.select()  # select all

    # loads
    W1 = Weight('W1', 1)
    W1.apply()  # to selected elements

    # loadcase
    L1 = LoadCase('L1', 'sus', [Weight], [1])

    app.models('sifs').analyze()

    pt30 = app.points(30)
    dy, dz, rx = 1, 2, 3

    assert compare(L1.movements[pt30][dz], -0.20901)

    return app
Пример #15
0
def test_pressure(app):
    """Check longitudinal stress due to pressure loading, pressure thrust and
    bourdon pressure effects.


    .. note::

        The internal hoop stress formula is (P*D)/2*t. A different code
        specific formula may be used by other softwares, however, the
        common formulation used is conservative.
    """
    P1 = Pressure('P1', 1, 250)
    P1.apply()

    # loadcase
    L1 = LoadCase('L1', 'sus', [Pressure], [1])

    app.models('loads').analyze()

    # check stress due to pressure
    pt30 = app.points(30)

    assert compare(L1.stresses[pt30].shoop, 3681.51)
    assert compare(L1.stresses[pt30].slp, 1655.45)
Пример #16
0
def test_pressure_thrust(app):
    """Check axial displacement due to pressure thrust.


    .. note::

        The pressure thrust force is based on the inner diameter and the pipe
        internal pressure, which may be the different from what some other
        piping softwares use internally.
    """
    app.models('loads').settings.pressure_thrust = True

    P1 = Pressure('P1', 1, 1000)
    P1.apply()

    # loadcase
    L1 = LoadCase('L1', 'sus', [Pressure], [1])

    app.models('loads').analyze()

    # check displacement due to pressure thrust
    pt40 = app.points(40)

    assert compare(L1.movements[pt40].dz, -0.0366)
Пример #17
0
def test_variable_spring(app):

    # get pipe objects
    pt10 = app.points(10)
    run10 = app.elements(10, 15)
    run20 = app.elements(15, 20)

    # supports
    anc1 = Anchor('A1', 10)
    anc1.apply([run10])

    spr20 = Spring('Spr20', 20, 1000, 1000)
    spr20.apply([run20])

    W1 = Weight('W1', 1)
    W1.apply([run10, run20])

    # loadcase
    L1 = LoadCase('L1', 'sus', [Weight], [1])

    app.models('simple').analyze()

    # check reactions due to fy
    assert compare(L1.reactions[pt10].fy, -100)
Пример #18
0
def test_minus_y_negative_load(app):
    """Simply supported beam with central concentrated force and a non-linear
    -Y support.
    """

    # get pipe objects
    pt10 = app.points(10)
    pt15 = app.points(15)
    pt20 = app.points(20)

    run10 = app.elements(10, 15)
    run20 = app.elements(15, 20)

    # supports
    anc10 = Anchor('Anc10', 10)
    anc10.apply([run10])

    # nonlinear -Y
    gbly20 = Y('GblY20', 20, direction="-")
    gbly20.apply([run20])

    gblz20 = Z('GblZ20', 20)
    gblz20.apply([run20])

    # loads
    F1 = Force('F1', 1, 15, fy=-10000)
    F1.apply([run10])

    # loadcase
    L1 = LoadCase('L1', 'ope', [Force], [1])

    app.models('simple').analyze()

    # check reactions due to fy
    assert compare(L1.reactions[pt10][1], -10000)
    assert compare(L1.reactions[pt20][1], 0)