Rectangular tubes are one of the standard shapes of beams. This article shows how to create them in CalculiX GraphiX.
Steel profiles often have rounded corners because of the way they are manufactured. The following code generates such a profile. The basic concept is to create a line and sweep that to form 1/4 of the profile. This is then mirrored two times and merged. By default, the internal radius equals the wall thickness. This is generally considered the minimum value:
## Define the view rot y rot r 135 rot u 25 ## Parameters # Width, height and length in [m] valu B 0.10 valu H 0.15 valu L 0.25 # Wall thickness [m] valu t 0.004 # Number of elements in Y valu dy2 6 # Number of elements in Z valu dz2 8 # Twice the number of elements in the radius valu dr 8 # Twice the number of elements in X valu dl 24 # Calculated values valu B2 / B 2 valu H2 / H 2 valu B2i - B2 t valu H2i - H2 t valu Ri t valu cpy - B2i Ri valu cpz H2i valu ncpy - 0 cpy ## Geometry seto tube-section pnt ! 0 B2i 0 swep tube-section new tra 0 t 0 4 swep tube-section ln2 tra 0 0 cpz dz2 pnt cpt 0 cpy cpz swep ln2 ln3 rot cpt x 90 dr swep ln3 new tra 0 ncpy 0 dy2 copy tube-section new mir z copy tube-section new mir y setc merg p tube-section merg l tube-section ## Show the geometry valu showgeom 0 if showgeom > 0 capt Rounded rectangular profile face geometry. plot pa all plus la all plus sa all stop hcpy png rounded-rectangular-profile-geometry sys mogrify -trim roundedrectangular-profile-geometry.png endif ## Extrude the tube seto tube swep tube-section new tra L 0 0 dl setc comp tube do ## Mesh the tube elty all he20r mesh all ## Show the mesh valu showmesh 0 if showmesh > 0 frame capt Rectangular profile mesh. view elem plot e all n view surf stop hcpy png rounded-rectangular-profile-mesh sys mogrify -trim rounded-rectangular-profile-mesh.png endif
The profile and mesh look as follows.
For comments, please send me an e-mail.
- Meshing a circle with hex elements in CalculiX
- Folded leaf spring ball joint flexure
- Corrugation against buckling
- Approximating elliptical arcs in CalculiX Graphics
- Hex versus tet meshes in FEA