def test_compound_stiffened_isection(): """ Tests that plates 1 and 2 can be eroded to nothing and a valid Section can still be generated without errors. """ uc = steel_sections.i_section(d=400, b=400, t_f=25, t_w=25, r=30, n_r=8) plate1 = (sections.rectangular_section(b=500, d=10).align_center(uc).align_to( uc, "top")) plate2 = (sections.rectangular_section(b=500, d=10).align_center(uc).align_to( uc, "bottom")) geom = uc + plate1 + plate2 new_geom = geom.offset_perimeter(-9) new_geom.create_mesh([100]) section = Section(new_geom) new_geom = geom.offset_perimeter(-10) new_geom.create_mesh([100]) section = Section(new_geom) new_geom = geom.offset_perimeter(-11) new_geom.create_mesh([100]) section = Section(new_geom)
def test_i_section(): i_section = steel_sections.i_section(d=308, b=305, t_f=15.4, t_w=9.9, r=16.5, n_r=16) i_section.create_mesh([100]) section = Section(i_section) section.calculate_geometric_properties() perim = ((2 * 305) + (4 * 15.4) + 2 * (305 - 9.9 - 2 * 16.5) + (2 * np.pi * 16.5) + 2 * (308 - 2 * 15.4 - 2 * 16.5)) check.almost_equal(section.get_perimeter(), perim, rel=r_tol)
def test_compound_rectangular_isection_perimeter2(): i_section = steel_sections.i_section(d=308, b=305, t_f=15.4, t_w=9.9, r=16.5, n_r=16) rect1 = (sections.rectangular_section( d=330, b=16).align_center(i_section).align_to(i_section, "left")) rect2 = (sections.rectangular_section( d=330, b=16).align_center(i_section).align_to(i_section, "right")) geom = i_section + rect1 + rect2 geom.create_mesh([100]) section = Section(geom) section.calculate_geometric_properties() assert section.get_perimeter( ) == 2 * 330 + 4 * 16 + 2 * 305 + 2 * (330 - 308)
def test_compound_rectangular_isection_perimeter1(): d = 300 b = 150 tf = 10 tw = 6 r = 12 b_p = 250 t_p = 16 ub = steel_sections.i_section(d=d, b=b, t_f=tf, t_w=tw, r=r, n_r=16) plate = (sections.rectangular_section( b=b_p, d=t_p).align_center(ub).align_to(ub, on="top")) geom = ub + plate geom.create_mesh([100]) section = Section(geom) section.calculate_geometric_properties() perim = (b + (4 * tf) + 2 * (b - tw - 2 * r) + (2 * np.pi * r) + 2 * (d - 2 * tf - 2 * r) + (b_p - b) + (2 * t_p) + b_p) check.almost_equal(section.get_perimeter(), perim, rel=r_tol)
def test_compound_rectangular_isection_offset_corrode(): d = 300 b = 150 tf = 10 tw = 8 r = 12 b_p = 250 t_p = 16 ub = steel_sections.i_section(d=d, b=b, t_f=tf, t_w=tw, r=r, n_r=16) plate = (sections.rectangular_section( b=b_p, d=t_p).align_center(ub).align_to(ub, on="top")) geom_test = ub + plate geom_test = geom_test.offset_perimeter(amount=-2, where="exterior") geom_test.create_mesh([100]) section_test = Section(geom_test) section_test.calculate_geometric_properties() ub_corroded = steel_sections.mono_i_section(d=298, b_t=146, b_b=146, t_ft=8, t_fb=6, t_w=4, r=14, n_r=16) plate_corroded1 = (sections.rectangular_section( b=146, d=2).align_center(ub_corroded).align_to(ub_corroded, "top")) plate_corroded2 = (sections.rectangular_section( b=246, d=12).align_center(ub_corroded).align_to(plate_corroded1, "top")) rad_l = (draw_radius(2, 8).align_to(plate_corroded1, "left").align_to(plate_corroded2, "bottom")) rad_r = (draw_radius(2, 8).mirror_section("y", [2, 0]).align_to( plate_corroded1, "right").align_to(plate_corroded2, "bottom")) geom_corroded = ub_corroded + plate_corroded1 + plate_corroded2 + rad_l + rad_r geom_corroded.create_mesh([100]) section_corroded = Section(geom_corroded) section_corroded.calculate_geometric_properties() check.almost_equal(section_test.get_area(), section_corroded.get_area(), rel=r_tol)
# Define mesh sizes mesh_size_list = [200, 100, 50, 20, 10, 5] nr_list = [4, 8, 12, 16, 20, 24, 32] # %% # Initialise result lists mesh_results = [] mesh_elements = [] nr_results = [] nr_elements = [] # %% # Calculate reference solution geometry = steel_sections.i_section(d=203, b=133, t_f=7.8, t_w=5.8, r=8.9, n_r=32) geometry.create_mesh(mesh_sizes=[5]) # create mesh section = Section(geometry) # create a Section object section.calculate_geometric_properties() section.calculate_warping_properties() j_reference = section.get_j() # get the torsion constant # %% # Run through mesh_sizes with n_r = 8 for mesh_size in mesh_size_list: geometry = steel_sections.i_section(d=203, b=133, t_f=7.8, t_w=5.8,
) timber = Material( name="Timber", elastic_modulus=8e3, poissons_ratio=0.35, yield_strength=20, density=0.78e-6, color="burlywood", ) # %% # Create 310UB40.4 ub = steel_sections.i_section(d=304, b=165, t_f=10.2, t_w=6.1, r=11.4, n_r=8, material=steel) # %% # Create timber panel on top of the UB panel = sections.rectangular_section(d=50, b=600, material=timber) panel = panel.align_center(ub).align_to(ub, on="top") # Create intermediate nodes in panel to match nodes in ub panel = (panel - ub) | panel # %% # Merge the two sections into one geometry object section_geometry = CompoundGeometry([ub, panel])