Creating a Nastran Section

Calculate section properties of Nastran HAT1 section.

The following example demonstrates how to create a cross-section defined in a Nastran-based finite element analysis program. The following creates a HAT1 cross-section and calculates the geometric, warping and plastic properties. The HAT1 cross-section is meshed with a maximum elemental area of 0.005.

The geometry and mesh are plotted, and the mesh information printed to the terminal before the analysis is carried out. Detailed time information is printed to the terminal during the cross-section analysis stage. Once the analysis is complete, the cross-section properties are printed to the terminal. The centroidal axis second moments of area and torsion constant are saved to variables and it is shown that, for non-circular sections, the torsion constant is not equal to the sum of the second moments of area.

# sphinx_gallery_thumbnail_number = 1

from typing import get_origin
import sectionproperties.pre.library.nastran_sections as nsections
from sectionproperties.analysis.section import Section

Create a HAT1 section

geometry = nsections.nastran_hat1(DIM1=4.0, DIM2=2.0, DIM3=1.5, DIM4=0.1875, DIM5=0.375)
geometry.plot_geometry()  # plot the geometry
print(geometry.geom)
Cross-Section Geometry
MULTIPOLYGON (((-2 0.375, -0.5625 0.375, -0.5625 1.8125, 0.5625 1.8125, 0.5625 0.375, 2 0.375, 2 0.5625, 0.75 0.5625, 0.75 2, -0.75 2, -0.75 0.5625, -2 0.5625, -2 0.375)), ((-2 0, 2 0, 2 0.375, -2 0.375, -2 0)))

Create a mesh with a maximum elemental area of 0.005

geometry.create_mesh(mesh_sizes=[0.005])

section = Section(geometry, time_info=True)  # create a Section object
section.display_mesh_info()  # display the mesh information
section.plot_mesh()  # plot the generated mesh`
Finite Element Mesh
Mesh Statistics:
- 2038 nodes
- 926 elements
- 2 regions


<AxesSubplot: title={'center': 'Finite Element Mesh'}>

Perform a geometric, warping and plastic analysis, displaying the time info

section.calculate_geometric_properties()
section.calculate_warping_properties()
section.calculate_plastic_properties()

section.display_results()
╭───────────────────────────── Geometric Analysis ─────────────────────────────╮
│                                                                              │
│   ✅ Geometric analysis        ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 0.9310 s ] │
│   complete                                                                   │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────────── Warping Analysis ──────────────────────────────╮
│                                                                              │
│   ✅ Warping analysis          ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 5.4325 s ] │
│   completed                                                                  │
│   ✅ 2038x2038 stiffness       ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 1.1458 s ] │
│   matrix assembled                                                           │
│   ✅ Warping function solved   ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 0.0595 s ] │
│   (direct)                                                                   │
│   ✅ Shear function vectors    ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 1.2455 s ] │
│   assembled                                                                  │
│   ✅ Shear functions solved    ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 0.1092 s ] │
│   (direct)                                                                   │
│   ✅ Shear and warping         ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 0.8185 s ] │
│   integrals assembled                                                        │
│   ✅ Shear deformation         ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 1.1750 s ] │
│   coefficients assembled                                                     │
│   ✅ Monosymmetry integrals    ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 0.8734 s ] │
│   assembled                                                                  │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
╭────────────────────────────── Plastic Analysis ──────────────────────────────╮
│                                                                              │
│   ✅ Plastic analysis complete ━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100% [ 0.0714 s ] │
│                                                                              │
╰──────────────────────────────────────────────────────────────────────────────╯
     Section Properties
┏━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Property ┃         Value ┃
┡━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ A        │  2.789062e+00 │
│ Perim.   │  1.200000e+01 │
│ Qx       │  1.626709e+00 │
│ Qy       │ -2.268151e-16 │
│ cx       │ -8.132306e-17 │
│ cy       │  5.832458e-01 │
│ Ixx_g    │  1.935211e+00 │
│ Iyy_g    │  3.233734e+00 │
│ Ixy_g    │ -3.109492e-16 │
│ Ixx_c    │  9.864400e-01 │
│ Iyy_c    │  3.233734e+00 │
│ Ixy_c    │ -1.786602e-16 │
│ Zxx+     │  6.962676e-01 │
│ Zxx-     │  1.691294e+00 │
│ Zyy+     │  1.616867e+00 │
│ Zyy-     │  1.616867e+00 │
│ rx       │  5.947113e-01 │
│ ry       │  1.076770e+00 │
│ phi      │ -9.000000e+01 │
│ I11_c    │  3.233734e+00 │
│ I22_c    │  9.864400e-01 │
│ Z11+     │  1.616867e+00 │
│ Z11-     │  1.616867e+00 │
│ Z22+     │  1.691294e+00 │
│ Z22-     │  6.962676e-01 │
│ r11      │  1.076770e+00 │
│ r22      │  5.947113e-01 │
│ J        │  9.878443e-01 │
│ Iw       │  1.160810e-01 │
│ x_se     │  4.822719e-05 │
│ y_se     │  4.674792e-01 │
│ x_st     │  4.822719e-05 │
│ y_st     │  4.674792e-01 │
│ x1_se    │  1.157666e-01 │
│ y2_se    │  4.822719e-05 │
│ A_sx     │  1.648312e+00 │
│ A_sy     │  6.979733e-01 │
│ A_s11    │  6.979733e-01 │
│ A_s22    │  1.648312e+00 │
│ betax+   │ -2.746928e-01 │
│ betax-   │  2.746928e-01 │
│ betay+   │  9.645438e-05 │
│ betay-   │ -9.645438e-05 │
│ beta11+  │  9.645438e-05 │
│ beta11-  │ -9.645438e-05 │
│ beta22+  │  2.746928e-01 │
│ beta22-  │ -2.746928e-01 │
│ x_pc     │ -8.132306e-17 │
│ y_pc     │  3.486328e-01 │
│ Sxx      │  1.140530e+00 │
│ Syy      │  2.603760e+00 │
│ SF_xx+   │  1.638062e+00 │
│ SF_xx-   │  6.743533e-01 │
│ SF_yy+   │  1.610373e+00 │
│ SF_yy-   │  1.610373e+00 │
│ x11_pc   │ -6.695716e-17 │
│ y22_pc   │  3.486328e-01 │
│ S11      │  2.603760e+00 │
│ S22      │  1.140530e+00 │
│ SF_11+   │  1.610373e+00 │
│ SF_11-   │  1.610373e+00 │
│ SF_22+   │  6.743533e-01 │
│ SF_22-   │  1.638062e+00 │
└──────────┴───────────────┘

Get the second moments of area and the torsion constant

(ixx_c, iyy_c, ixy_c) = section.get_ic()
j = section.get_j()
print("Ixx + Iyy = {0:.3f}".format(ixx_c + iyy_c))
print("J = {0:.3f}".format(j))
Ixx + Iyy = 4.220
J = 0.988

Total running time of the script: ( 0 minutes 7.246 seconds)

Gallery generated by Sphinx-Gallery