Fem: Add box and elliptical beam section types - fixes #12614

This commit is contained in:
marioalexis
2024-11-19 23:37:13 -03:00
committed by Chris Hennes
parent e34fd72956
commit b7ccf634af
5 changed files with 568 additions and 114 deletions

View File

@@ -45,7 +45,6 @@ def write_femelement_geometry(f, ccxwriter):
section_nor = "{:.13G}, {:.13G}, {:.13G}\n".format(
beam_axis_m[0], beam_axis_m[1], beam_axis_m[2]
)
print(section_nor)
if beamsec_obj.SectionType == "Rectangular":
# see meshtools.get_beam_main_axis_m(beam_direction, defined_angle)
# the method get_beam_main_axis_m() which calculates the beam_axis_m vector
@@ -66,12 +65,29 @@ def write_femelement_geometry(f, ccxwriter):
section_type = ", SECTION=CIRC"
section_geo = f"{diameter:.13G}\n"
section_def = f"*BEAM SECTION, {elsetdef}{material}{section_type}\n"
elif beamsec_obj.SectionType == "Elliptical":
axis1 = beamsec_obj.Axis1Length.getValueAs("mm").Value
axis2 = beamsec_obj.Axis2Length.getValueAs("mm").Value
section_type = ", SECTION=CIRC"
section_geo = f"{axis1:.13G},{axis2:.13G}\n"
section_def = f"*BEAM SECTION, {elsetdef}{material}{section_type}\n"
elif beamsec_obj.SectionType == "Pipe":
radius = 0.5 * beamsec_obj.PipeDiameter.getValueAs("mm").Value
thickness = beamsec_obj.PipeThickness.getValueAs("mm").Value
section_type = ", SECTION=PIPE"
section_geo = f"{radius:.13G},{thickness:.13G}\n"
section_def = f"*BEAM SECTION, {elsetdef}{material}{section_type}\n"
elif beamsec_obj.SectionType == "Box":
box_width = beamsec_obj.BoxWidth.getValueAs("mm").Value
box_height = beamsec_obj.BoxHeight.getValueAs("mm").Value
box_t1 = beamsec_obj.BoxT1.getValueAs("mm").Value
box_t2 = beamsec_obj.BoxT2.getValueAs("mm").Value
box_t3 = beamsec_obj.BoxT3.getValueAs("mm").Value
box_t4 = beamsec_obj.BoxT4.getValueAs("mm").Value
section_type = ", SECTION=BOX"
section_geo = f"{box_width:.13G},{box_height:.13G},{box_t1:.13G},{box_t2:.13G},{box_t3:.13G},{box_t4:.13G}\n"
section_def = f"*BEAM SECTION, {elsetdef}{material}{section_type}\n"
f.write(section_def)
f.write(section_geo)
f.write(section_nor)