yield_strength=500,
                 color='grey')
timber = Material(name='Timber',
                  elastic_modulus=8e3,
                  poissons_ratio=0.35,
                  yield_strength=20,
                  color='burlywood')

# create 310UB40.4
ub = sections.ISection(d=304, b=165, t_f=10.2, t_w=6.1, r=11.4, n_r=8)

# create timber panel on top of the UB
panel = sections.RectangularSection(d=50, b=600, shift=[-217.5, 304])

# merge the two sections into one geometry object
geometry = sections.MergedSection([ub, panel])
geometry.clean_geometry()  # clean the geometry
geometry.plot_geometry()  # plot the geometry

# create a mesh - use a mesh size of 5 for the UB, 20 for the panel
mesh = geometry.create_mesh(mesh_sizes=[5, 20])

# create a CrossSection object - take care to list the materials in the same order as entered into
# the MergedSection
section = CrossSection(geometry, mesh, materials=[steel, timber])
section.display_mesh_info()  # display the mesh information

# plot the mesh with coloured materials and a line transparency of 0.5
section.plot_mesh(materials=True, alpha=0.5)

# perform a geometric, warping and plastic analysis
예제 #2
0
    def calculate(self, loadProfileFromDB):
        '''Se ejecuta el calculo de las propiedades de la seccion.

        Referencia
        ----------
            rx, ry : radio de giro de la seccion | sqrt(I/A)
            ri : radio de giro en -y- de un solo perfil c
            c_x, c_y : coordenada del centroide de la seccion
            sc_x, sc_y : coordenada del centro de corte
            A : Area de la seccion
            Cw : Constante torsional de warping de la seccion
            J : Constante de torsion de St. Venant
            Si : modulo elastico
            j : mitad de la constante monociclica a compresion en eje -y- (beta22-)

        '''
        if loadProfileFromDB:
            try:
                self.load()
            except:
                loadProfileFromDB = False
                pass
        if not loadProfileFromDB:
            c0 = c_profile(H= self.H, B= self. B, t= self.t, r_out= self.r_out)
            c0.calculate(loadProfileFromDB)

            c1 = sections.CeeSection(d=self.H, b=self.B+self.r_out, l=self.r_out, t=self.t, r_out=self.r_out, n_r=8)
            c2 = deepcopy(c1)
        
            # corto los labios y el radio c1
            p1 = c1.add_point([self.B, 0])
            p2 = c1.add_point([self.B, self.t])
            p3 = c1.add_point([self.B, self.H])
            p4 = c1.add_point([self.B, self.H-self.t])

            c1.add_facet([p1, p2])
            c1.add_facet([p3, p4])
            c1.add_hole([self.B+self.r_out/10, self.t/2])  # add hole
            c1.add_hole([self.B+self.r_out/10, self.H-self.t/2])  # add hole
            c1.clean_geometry()  # clean the geometry

            c2 = deepcopy(c1)
            c2.mirror_section(axis= 'y', mirror_point=[0, 0])

            if self.s:
                c1.shift = [self.s/2, 0]
                c1.shift_section()

                c2.shift = [-self.s/2, 0]
                c2.shift_section()
            # soldadura en los extremos del alma
            if self.wld:
                h = self.wld*self.r_out # weld length
                a = self.wld*self.r_out*2 + self.s # base de la soldadura
                weld1 = sections.CustomSection(
                    points=[[a/2,0], [-a/2, 0], [0, h]],
                    facets=[[0,1], [1,2], [2,0]],
                    holes=[],
                    control_points=[[h / 3, h / 3]]
                )
                weld2 = deepcopy(weld1)

                weld2.mirror_section(axis= 'x', mirror_point=[0, 0])
                weld2.shift = [0, self.H]
                weld2.shift_section()

                geometry = sections.MergedSection([c1, c2, weld1, weld2])
                geometry.clean_geometry(verbose= False)

                if self.s:    
                    geometry.add_hole([0, self.H/2])
                mesh = geometry.create_mesh(mesh_sizes=[self.mesh_size, self.mesh_size, self.mesh_size, self.mesh_size])
            else:
                geometry = sections.MergedSection([c1, c2])
                geometry.clean_geometry()
                mesh = geometry.create_mesh(mesh_sizes=[self.mesh_size, self.mesh_size])
            
            section = CrossSection(geometry, mesh)

            #mesh_c1 = c1.create_mesh(mesh_sizes=[self.mesh_size])
            #section_c1 = CrossSection(c1, mesh_c1)

            #section_c1.calculate_geometric_properties()
            #section_c1.calculate_warping_properties()
            
            section.calculate_geometric_properties()
            section.calculate_warping_properties()

            (self.c_x, self.c_y) = section.get_c() # centroides
            (self.sc_x, self.sc_y) = section.get_sc() # shear center
            self.Cw = section.get_gamma() # warping
            (self.rx, self.ry) = section.get_rc() # radios de giro
            self.J = section.get_j()
            self.A = section.get_area()
            self.Ae = self.A
            self.ri = c0.ry # radios de giro y de c1
            (self.Ix, self.Iy, _) = section.get_ic()
            (self.Sx, _, _, _) = section.get_z()    # modulo elastico
            self.j = section.get_beta_p()[3]/2.0

            self.save(section)

            self.section = section
예제 #3
0
points = [[0, 0], [50, 0], [25, 50]]
facets = [[0, 1], [1, 2], [2, 0]]
holes = []
control_points = [[25, 25]]
triangle = sections.CustomSection(points, facets, holes, control_points,
                                  shift=[25, 150])

# create a 100x100x6 EA on the right of the RHS
angle = sections.AngleSection(d=100, b=100, t=6, r_r=8, r_t=5, n_r=8,
                              shift=[100, 25])

# create a list of the sections to be merged
section_list = [rhs, triangle, angle]

# merge the three sections into one geometry object
geometry = sections.MergedSection(section_list)

# clean the geometry - print cleaning information to the terminal
geometry.clean_geometry(verbose=True)
geometry.plot_geometry()  # plot the geometry

# create a mesh - use a mesh size of 2.5 for the RHS, 5 for the triangle and
# 3 for the angle
mesh = geometry.create_mesh(mesh_sizes=[2.5, 5, 3])

# create a CrossSection object
section = CrossSection(geometry, mesh)
section.display_mesh_info()  # display the mesh information
section.plot_mesh()  # plot the generated mesh

# perform a geometric, warping and plastic anaylsis, displaying the time info
예제 #4
0
# create a 200PFC and a 150PFC
pfc1 = sections.PfcSection(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=8)
pfc2 = sections.PfcSection(d=150,
                           b=133,
                           t_f=7.8,
                           t_w=5.8,
                           r=8.9,
                           n_r=8,
                           shift=[0, 26.5])

# mirror the 200 PFC about the y-axis
pfc1.mirror_section(axis='y', mirror_point=[0, 0])

# merge the pfc sections
geometry = sections.MergedSection([pfc1, pfc2])

# rotate the geometry counter-clockwise by 30 degrees
geometry.rotate_section(angle=30)

# clean the geometry - print cleaning information to the terminal
geometry.clean_geometry(verbose=True)
geometry.plot_geometry()  # plot the geometry

# create a mesh - use a mesh size of 5 for the 200PFC and 4 for the 150PFC
mesh = geometry.create_mesh(mesh_sizes=[5, 4])

# create a CrossSection object
section = CrossSection(geometry, mesh)
section.display_mesh_info()  # display the mesh information
section.plot_mesh()  # plot the generated mesh
예제 #5
0
def boxgenerator(b, d, t_w, t_f, d_stif, t_stif, n_stif):
    """
    This function allows for generation of a stiffened box section
    This only works with Pint units aware data in SI format at the moment.
    """
    import copy
    import sectionproperties.pre.sections as sections
    from sectionproperties.analysis.cross_section import CrossSection

    # Create the main box sections
    top_flange = sections.RectangularSection(d=t_f, b=b, shift=[0, d - t_f])
    bot_flange = sections.RectangularSection(d=t_f, b=b, shift=[0, 0])
    left_web = sections.RectangularSection(d=d - 2 * t_f,
                                           b=t_w,
                                           shift=[0, t_f])
    right_web = sections.RectangularSection(d=d - 2 * t_f,
                                            b=t_w,
                                            shift=[b - t_w, t_f])

    if n_stif == 3:
        #Create top stiffeners
        top_stif1 = sections.RectangularSection(d=d_stif,
                                                b=t_stif,
                                                shift=[(b - t_stif) / 2,
                                                       d - t_f - d_stif])

        top_stif2 = copy.deepcopy(top_stif1)
        top_stif3 = copy.deepcopy(top_stif1)
        top_stif2.shift = [-b / 4, 0]
        top_stif3.shift = [b / 4, 0]
        top_stif2.shift_section()
        top_stif3.shift_section()

        #Create left stiffeners
        left_stif1 = sections.RectangularSection(d=t_stif,
                                                 b=d_stif,
                                                 shift=[t_w, (d - t_stif) / 2])

        left_stif2 = copy.deepcopy(left_stif1)
        left_stif3 = copy.deepcopy(left_stif1)
        left_stif2.shift = [0, -d / 4]
        left_stif3.shift = [0, d / 4]
        left_stif2.shift_section()
        left_stif3.shift_section()

        #Create right stiffeners
        right_stif1 = copy.deepcopy(left_stif1)
        right_stif2 = copy.deepcopy(left_stif2)
        right_stif3 = copy.deepcopy(left_stif3)
        right_stif1.shift = [b - 2 * t_w - d_stif, 0]
        right_stif2.shift = [b - 2 * t_w - d_stif, 0]
        right_stif3.shift = [b - 2 * t_w - d_stif, 0]
        right_stif1.shift_section()
        right_stif2.shift_section()
        right_stif3.shift_section()

        # create a list of the sections to be merged
        section_list = [
            top_flange, bot_flange, left_web, right_web, top_stif1, top_stif2,
            top_stif3, left_stif1, left_stif2, left_stif3, right_stif1,
            right_stif2, right_stif3
        ]

    elif n_stif == 2:
        #Create top stiffeners
        top_stif1 = sections.RectangularSection(d=d_stif,
                                                b=t_stif,
                                                shift=[(b - t_stif) / 3.0,
                                                       d - t_f - d_stif])

        top_stif2 = copy.deepcopy(top_stif1)
        top_stif2.shift = [b / 3, 0]
        top_stif2.shift_section()

        #Create left stiffeners
        left_stif1 = sections.RectangularSection(d=t_stif,
                                                 b=d_stif,
                                                 shift=[t_w, (d - t_stif) / 3])

        left_stif2 = copy.deepcopy(left_stif1)
        left_stif2.shift = [0, d / 3]
        left_stif2.shift_section()

        #Create right stiffeners
        right_stif1 = copy.deepcopy(left_stif1)
        right_stif2 = copy.deepcopy(left_stif2)
        right_stif1.shift = [b - 2 * t_w - d_stif, 0]
        right_stif2.shift = [b - 2 * t_w - d_stif, 0]
        right_stif1.shift_section()
        right_stif2.shift_section()

        # create a list of the sections to be merged
        section_list = [
            top_flange, bot_flange, left_web, right_web, top_stif1, top_stif2,
            left_stif1, left_stif2, right_stif1, right_stif2
        ]
    else:
        print("Number of stiffeners not supported")

    # merge the three sections into one geometry object
    geometry = sections.MergedSection(section_list)

    geometry.clean_geometry(verbose=False)  # clean the geometry
    geometry.add_hole([b / 2, d / 2])
    fig, ax = plt.subplots()
    ax.set_aspect('equal')
    geometry.plot_geometry(ax=ax)  # plot the geometry

    # create a mesh - use a mesh size of 12 for the RHS, 6 for stiffeners
    rhs_mesh = d / 6
    stif_mesh = t_stif

    if n_stif == 3:
        mesh = geometry.create_mesh(mesh_sizes=[
            rhs_mesh, rhs_mesh, rhs_mesh, rhs_mesh, stif_mesh, stif_mesh,
            stif_mesh, stif_mesh, stif_mesh, stif_mesh, stif_mesh, stif_mesh,
            stif_mesh
        ])
    elif n_stif == 2:
        mesh = geometry.create_mesh(mesh_sizes=[
            rhs_mesh, rhs_mesh, rhs_mesh, rhs_mesh, stif_mesh, stif_mesh,
            stif_mesh, stif_mesh, stif_mesh, stif_mesh
        ])
    else:
        print("Number of stiffeners not supported")

    section = CrossSection(geometry, mesh)  # create a CrossSection object

    return section, fig, ax