Example #1
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)
Example #2
0
    def build(self, point):
        """Each subrun has a different section associated with it with each run
        getting smaller and smaller to approximate the reducer geometry.
        """
        super(Reducer, self).build(point)
        edge = self.geometry

        if self.section2 is None:
            self.section2 = self.section

        v1, v2 = Vector3(*edge.v1.co), Vector3(*edge.v2.co)
        v = v2 - v1
        v.normalize()  # unit vector

        L = edge.length  # length of reducer
        D = self.section.od  # diameter at from point
        d = self.section2.od  # diameter at to point
        T = self.section.thk  # thickness at from point
        t = self.section2.thk  # thickness at to point

        mat = self.material
        insul = self.insulation
        code = self.code

        N = 9  # number of division

        for i in range(0, N):
            x_i = i * (L / N)  # element start length
            x_j = (i + 1) * (L / N)  # element end length

            # diameters
            de_i = (d - D) / L * x_i + D
            de_j = (d - D) / L * x_j + D
            de = (de_i + de_j) / 2

            # thickness
            te_i = (t - T) / L * x_i + T
            te_j = (t - T) / L * x_j + T
            te = (te_i + te_j) / 2

            # with redirect_stdout(sys.__stdout__):
            #     print(de, te)

            # create sections specific to the reducer
            # names and fix the runs, also section corrosion allowance
            sec = Pipe(str(self.name) + str(i), de, te)
            self._sections.append(sec)

            # create all new points and runs specific to reducer
            ve = v1 + x_j * v
            run = Run(str(self.name) + str(i),
                      dx=ve.x,
                      dy=ve.y,
                      dz=ve.z,
                      from_point=from_point,
                      section=sec,
                      material=mat,
                      insulation=insul,
                      code=code)
            self._runs.append(run)
Example #3
0
def app():
    # parameter
    L = 10 * 12

    app = App()
    Model('simple')

    # properties
    Pipe.from_file('PIPE1', '10', '40')
    Material.from_file('MAT1', 'A53A', 'B31.1')

    # geometry
    Point(10)
    run15 = Run(15, L / 2)
    run20 = Run(20, L / 2)

    # code
    b311 = B31167('B311')
    b311.apply([run15, run20])

    return app
Example #4
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
Example #5
0
def app():
    app = App()

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

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

    Point(10)
    run20 = Run(20, 0, 0, 10 * 12)
    Run(30, 0, 15 * 12)
    Run(40, 0, 0, -50 * 12)
    run50 = Run(50, 0, 25 * 12)

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

    app.elements.select()  # select all

    return app