sectionproperties

repository·master·Indexed 19 days ago

https://github.com/robbievanleeuwen/section-properties

A Python package for the analysis of arbitrary cross-sections using the finite element method. It enables the determination of section properties for structural design and the visualization of cross-sectional stresses from applied forces and bending moments. The library is organized into three primary modules: sectionproperties.pre for preprocessing and meshing, sectionproperties.analysis for geometric and structural analyses, and sectionproperties.post for post-processing and data extraction.

Tokens
60.3K
Snippets
215
Records
263
Agent score
66%

What's inside sectionproperties

  1. Overview of the sectionproperties workflow

    master

    The sectionproperties workflow is divided into three main stages: Pre-Processor, Cross-Section Analysis (Solver), and Post-Processor.

    1. Pre-Processor: Used for geometry manipulation (via Shapely), importing files (.dxf, Rhino .3dm), defining composite materials, and generating quadratic triangular meshes.
    2. Cross-Section Analysis (Solver): Performs geometric property calculations (Area, Mass, Moments of Inertia, etc.) and stress analysis using direct or CGS iterative solvers.
    3. Post-Processor: Used for visualizing results, such as plotting geometry, meshes, centroids, and cross-section stresses, or retrieving stress data.
  2. Explore the sectionproperties API modules

    master

    The sectionproperties library is organized into three primary functional modules:

    • sectionproperties.pre: Contains tools for preprocessing, such as geometry creation and meshing.
    • sectionproperties.analysis: Contains tools for running geometric and structural analyses on sections.
    • sectionproperties.post: Contains tools for post-processing results and extracting data.
  3. Explore sectionproperties example categories

    master

    The following categories of examples are available to help you learn the library's capabilities:

    • Geometry: Creating meshes, manipulating geometry, using CAD files, and working with section libraries.
    • Materials: Assigning materials and performing composite analysis.
    • Analysis: Geometric, plastic, warping, frame, and stress analyses.
    • Results: Displaying, retrieving, and plotting results (centroids, stress, etc.), and exporting fibre sections.
    • Validation: Benchmarking against known solutions like Pilkey (channel, arc, composite) and Peery.
    • Advanced: Advanced plotting and torsion analysis (rectangle/trapezoidal).
  4. Use a meshed geometry for section analysis

    master

    Once a mesh has been created using .create_mesh(), it is stored internally within the geometry object. You can then pass this geometry object directly to the Section class to perform cross-section analyses and mesh quality checks (such as plotting the mesh or viewing metrics).

    from sectionproperties.analysis.section import Section
    
    # 'geometry' already has a mesh created via geometry.create_mesh()
    section = Section(geometry)
    # Now you can perform analysis or mesh quality checks
  5. How mesh generation works in sectionproperties

    master

    The library uses the CyTriangle library to mesh cross-sections using quadratic superparametric triangular elements (Tri6).

    Key characteristics of the meshing process:

    • Element Type: Tri6 elements have straight edges and mid-nodes located at the midpoint between adjacent corner nodes.
    • Mesh Quality for Area Properties: For warping independent properties (area properties), mesh quality is less critical because superparametric elements have a constant Jacobian, resulting in an exact solution regardless of mesh quality.
    • Mesh Quality for Warping Properties: For warping dependent properties, mesh quality and refinement are critical. Users must ensure an adequate mesh is generated to achieve accurate results for torsion and warping constants.
  6. Calculate von Mises and Principal stresses

    master

    The library provides mathematical frameworks to derive complex stress states from basic axial and shear components:

    von Mises Stress

    Determined from the net axial stress ($\sigma_{zz}$) and shear stresses ($\tau_{zx}, \tau_{zy}$): $$\sigma_{vM} = \sqrt{{\sigma_{zz}}^2 + 3({\tau_{zx}}^2 + {\tau_{zy}}^2)}$$

    Principal Stresses

    For a cross-section subjected to axial force, shear in $x$ and $y$ axes, and moments about all three axes, the principal stresses ($\sigma_{1,3}$) are calculated as: $$\sigma_{1,3} = \frac{\sigma_{zz}}{2} \pm \sqrt{ \left(\frac{\sigma_{zz}}{2}\right)^2 + \tau_{zx}^2 + \tau_{zy}^2 }$$ Note that $\sigma_2 = 0$ in this specific stress tensor configuration.

  7. Understand the scope of cross-sectional analysis in sectionproperties

    master

    The sectionproperties library performs cross-sectional and stress analysis on arbitrary cross-sections. These sections can be defined by a series of points, segments, and holes.

    The analysis covers two main categories of properties:

    1. Warping independent properties: Includes the second moment of area and section moduli. These are crucial for structural analysis and stress verification.
    2. Warping dependent properties: Includes the Saint-Venant torsion constant and warping constant. These are essential for verifying slender steel structures where lateral-torsional buckling is a concern.

    Because calculating accurate properties for even basic sections requires solving boundary value partial differential equations, the library uses numerical methods (Finite Element Method) to extend these calculations to arbitrary complex sections.

  8. Calculate elastic section moduli

    master

    Elastic section moduli ($Z_{xx}, Z_{yy}$) are calculated using the second moments of area about the centroidal axis and the extreme coordinates (minimum and maximum) of the cross-section in the $x$ and $y$ directions.

    Formulas used:

    • $Z_{xx}^+ = \frac{I_{\overline{xx}}}{y_{max} - y_c}$
    • $Z_{xx}^- = \frac{I_{\overline{xx}}}{y_c - y_{min}}$
    • $Z_{yy}^+ = \frac{I_{\overline{yy}}}{x_{max} - x_c}$
    • $Z_{yy}^- = \frac{I_{\overline{yy}}}{x_c - x_{min}}$
  9. Understand the difference between Geometry and CompoundGeometry

    master

    In sectionproperties, cross-section geometry is represented by two primary classes depending on the complexity of the shape:

    1. Geometry: Used for simple geometries consisting of a single, contiguous region.
    2. CompoundGeometry: Used for complex geometries that are composed of two or more Geometry objects.

    Defining the geometry is a prerequisite for performing cross-section analysis, as it establishes the shape, dimensions, and the basis for assigning material properties in composite analyses.

  10. Calculate the shear centre

    master

    The library provides two methods for calculating the shear centre ($x_s, y_s$):

    1. Elasticity-based: Uses shear functions $\Psi$ and $\Phi$ (obtained by solving uncoupled PDEs via FEM) and the warping function $\omega$. This method is consistent with elasticity theory.
    2. Trefftz's Definition: Based on thin-wall assumptions, using sectorial products of area ($I_{x\omega}, I_{y\omega}$) and the warping function.

    $x_s = \frac{I_{\overline{xy}} I_{x \omega} - I_{\overline{yy}} I_{y \omega}}{I_{\overline{xx}} I_{\overline{yy}} - {I_{\overline{xy}}}^2}$ $y_s = \frac{I_{\overline{xx}} I_{x \omega} - I_{\overline{xy}} I_{y \omega}}{I_{\overline{xx}} I_{\overline{yy}} - {I_{\overline{xy}}}^2}$

  11. Calculate bending stress for biaxial bending

    master

    For unsymmetric sections subjected to biaxial bending, the peak stress $f_b$ can be computed over the FEM. The theoretical value follows the biaxial bending equation:

    $$f_b = \frac{M_x I_{xy} - M_y I_x}{I_x I_y - I_{xy}^2}x + \frac{M_y I_{xy} - M_x I_y}{I_x I_y - I_{xy}^2}y$$

    sectionproperties verifies these stress results against theoretical values to ensure FEM accuracy.