Section Library

This examples shows how to use sectionproperties’s section library to create geometry.

Circular Section

The following example calculates the geometric, warping and plastic properties of a 50 mm diameter circle. The circle is discretised with 64 points and a mesh size of 2.5 mm\(^2\).

Import Modules

We start by importing the circular_section function from the section library, and the Section() object for analysis.

[1]:
from sectionproperties.analysis import Section
from sectionproperties.pre.library import circular_section

Create Geometry

Create a 50 diameter circle discretised by 64 points and plot the geometry.

[2]:
geom = circular_section(d=50, n=64)
geom.plot_geometry()
../../_images/examples_geometry_section_library_5_0.svg
[2]:
<Axes: title={'center': 'Cross-Section Geometry'}>

Create Mesh and Section object

Create a mesh with a mesh size of 2.5 mm\(^2\), a Section() object. We also display some mesh information and plot the finite element mesh.

[3]:
geom.create_mesh(mesh_sizes=[2.5])
sec = Section(geometry=geom)
sec.display_mesh_info()
sec.plot_mesh(materials=False)
Mesh Statistics:
- 2557 nodes
- 1246 elements
- 1 region
../../_images/examples_geometry_section_library_7_5.svg
[3]:
<Axes: title={'center': 'Finite Element Mesh'}>

Perform an Analysis

We perform geometric, warping and plastic analyses. It is important to perform the geometric analysis first, as these results are required by the warping and plastic analyses.

[4]:
sec.calculate_geometric_properties()
sec.calculate_warping_properties()
sec.calculate_plastic_properties()

Display Results

Print the results to the terminal using display_results().

[5]:
sec.display_results()
     Section Properties      
┏━━━━━━━━━━━┳━━━━━━━━━━━━━━━┓
┃ Property           Value ┃
┡━━━━━━━━━━━╇━━━━━━━━━━━━━━━┩
│ area        1.960343e+03 │
│ perimeter   1.570166e+02 │
│ qx         -1.341505e-11 │
│ qy          1.045830e-12 │
│ ixx_g       3.058119e+05 │
│ iyy_g       3.058119e+05 │
│ ixy_g      -8.235190e-12 │
│ cx          5.334935e-16 │
│ cy         -6.843215e-15 │
│ ixx_c       3.058119e+05 │
│ iyy_c       3.058119e+05 │
│ ixy_c      -8.235190e-12 │
│ zxx+        1.223248e+04 │
│ zxx-        1.223248e+04 │
│ zyy+        1.223248e+04 │
│ zyy-        1.223248e+04 │
│ rx          1.248996e+01 │
│ ry          1.248996e+01 │
│ i11_c       3.058119e+05 │
│ i22_c       3.058119e+05 │
│ phi         0.000000e+00 │
│ z11+        1.223248e+04 │
│ z11-        1.223248e+04 │
│ z22+        1.223248e+04 │
│ z22-        1.223248e+04 │
│ r11         1.248996e+01 │
│ r22         1.248996e+01 │
│ j           6.116238e+05 │
│ x_se       -9.827132e-16 │
│ y_se        2.292866e-15 │
│ x1_se      -1.516207e-15 │
│ y2_se       9.136081e-15 │
│ x_st       -9.827132e-16 │
│ y_st        2.292866e-15 │
│ gamma       1.536103e-21 │
│ a_sx        1.680296e+03 │
│ a_sy        1.680296e+03 │
│ a_s11       1.680296e+03 │
│ a_s22       1.680296e+03 │
│ beta_x+    -1.354404e-14 │
│ beta_x-     1.354404e-14 │
│ beta_y+    -8.494733e-16 │
│ beta_y-     8.494733e-16 │
│ beta_11+   -1.354404e-14 │
│ beta_11-    1.354404e-14 │
│ beta_22+   -8.494733e-16 │
│ beta_22-    8.494733e-16 │
│ x_pc        5.334935e-16 │
│ y_pc       -6.843215e-15 │
│ x11_pc      5.334935e-16 │
│ y22_pc     -6.843215e-15 │
│ sxx         2.078317e+04 │
│ syy         2.078317e+04 │
│ s11         2.078317e+04 │
│ s22         2.078317e+04 │
│ sf_xx+      1.699016e+00 │
│ sf_xx-      1.699016e+00 │
│ sf_yy+      1.699016e+00 │
│ sf_yy-      1.699016e+00 │
│ sf_11+      1.699016e+00 │
│ sf_11-      1.699016e+00 │
│ sf_22+      1.699016e+00 │
│ sf_22-      1.699016e+00 │
└───────────┴───────────────┘

We can get the second moments of area and the torsion constant using the get_ic() and get_j() methods.

[6]:
ixx_c, iyy_c, ixy_c = sec.get_ic()
j = sec.get_j()
print(f"Ixx + Iyy + Ixy = {ixx_c + iyy_c + ixy_c:.3f}")
print(f"J = {j:.3f}")
Ixx + Iyy + Ixy = 611623.837
J = 611623.837

It is clear that for a circular section, the torsion constant is equal to the sum of second moments of area!

Tapered Flange Channel Section

The following example calculates the geometric, warping and plastic properties of an imperial tapered flange section.

Import Modules

We start by importing the tapered_flange_channel function from the section library (we have already imported the Section object).

[7]:
from sectionproperties.pre.library import tapered_flange_channel

Create Geometry

Create a 10 inch deep by 3.5 inch wide tapered flange channel section.

[8]:
geom = tapered_flange_channel(
    d=10,
    b=3.5,
    t_f=0.575,
    t_w=0.475,
    r_r=0.575,
    r_f=0.4,
    alpha=8,
    n_r=16,
)

Create Mesh and Section object

Create a mesh with a mesh size of 0.05 in\(^2\) and plot the mesh.

[9]:
geom.create_mesh(mesh_sizes=0.05)
sec = Section(geometry=geom)
sec.plot_mesh(materials=False)
../../_images/examples_geometry_section_library_21_0.svg
[9]:
<Axes: title={'center': 'Finite Element Mesh'}>

Perform an Analysis

We perform geometric and warping analyses on the tapered flange channel.

[10]:
sec.calculate_geometric_properties()
sec.calculate_warping_properties()

Plot Centroids

We can plot the various centroids with the plot_centroids() method.

[11]:
sec.plot_centroids()
../../_images/examples_geometry_section_library_25_0.svg
[11]:
<Axes: title={'center': 'Centroids'}>

Rectangular Timber CLT Section

The following example calculates the geometric properties of a rectangular timber crosslaminated section.

Import Modules

We start by importing the timber_rectangular_section() function from the section library, and the Material() object to define our timber material.

[12]:
from sectionproperties.analysis import Section
from sectionproperties.pre import Material
from sectionproperties.pre.library import clt_rectangular_section

Create Geometry

Create a 120 deep by 1000 wide cross-laminated timber slab.

The following material properties are used:

SPF-Timber - Parallel-to-grain

  • Elastic modulus = 9500 MPa

  • Poisson’s ratio = 0.35

  • Density = 4400 kg/m\(^3\)

  • Yield Strengh = 5.5 MPa

SPF-Timber - Perpendicular-to-grain

  • Elastic modulus = 317 MPa

  • Poisson’s ratio = 0.35

  • Density = 4400 kg/m\(^3\)

  • Yield Strengh = 5.5 MPa

[13]:
timber0 = Material(
    name="Timber0",
    elastic_modulus=9.5e3,
    poissons_ratio=0.35,
    density=4.4e-7,
    yield_strength=5.5,
    color="burlywood",
)

timber90 = Material(
    name="Timber90",
    elastic_modulus=317,
    poissons_ratio=0.35,
    density=4.4e-7,
    yield_strength=5.5,
    color="orange",
)

Create the geometry - Major (x-) axis bending

[14]:
geom_maj = clt_rectangular_section(
    d=[40, 40, 40], layer_mat=[timber0, timber90, timber0], b=1000
)

Create Mesh and Section object

Create a mesh with a mesh size of 200 mm\(^2\) and plot the mesh.

[15]:
geom_maj.create_mesh(mesh_sizes=[200])
sec_maj = Section(geometry=geom_maj)
sec_maj.plot_mesh()
../../_images/examples_geometry_section_library_34_0.svg
[15]:
<Axes: title={'center': 'Finite Element Mesh'}>

Perform an Analysis

We perform only a geometric analysis on the timber CLT section.

[16]:
sec_maj.calculate_geometric_properties()

Calculate Gross Effective Moment of Inertia

We can calculate the gross effective moment of inertia by obtaining the flexural rigidity (\(\sum E.I\)) of the section and dividing it by the elastic modulus of the reference timber (i.e. Timber0).

[17]:
ei_maj = sec_maj.get_eic(e_ref=timber0)
print(f"I_eff,x,major = {ei_maj[0]:.3e} mm4")
I_eff,x,major = 1.388e+08 mm4

Create the geometry - Minor (z-) axis bending

[18]:
geom_min = clt_rectangular_section(
    d=[40, 40, 40], layer_mat=[timber90, timber0, timber90], b=1000
)

Create Mesh and Section object

Create a mesh with a mesh size of 200 mm\(^2\) and plot the mesh.

[19]:
geom_min.create_mesh(mesh_sizes=[200])
sec_min = Section(geometry=geom_min)
sec_min.plot_mesh()
../../_images/examples_geometry_section_library_42_0.svg
[19]:
<Axes: title={'center': 'Finite Element Mesh'}>

Perform an Analysis

We perform only a geometric analysis on the timber CLT section.

[20]:
sec_min.calculate_geometric_properties()

Calculate Gross Effective Moment of Inertia

We can calculate the gross effective moment of inertia by obtaining the flexural rigidity (\(\sum E.I\)) of the section and dividing it by the elastic modulus of the reference timber (i.e. Timber0).

[21]:
ei_min = sec_min.get_eic(e_ref=timber0)
print(f"I_eff,x,minor = {ei_min[0]:.3e} mm4")
I_eff,x,minor = 9.960e+06 mm4

Rectangular Concrete Section

The following example calculates the geometric properties of a rectangular reinforced concrete section.

Import Modules

We start by importing the concrete_rectangular_section() function from the section library, and the Material() object to define our concrete and steel materials.

[22]:
from sectionproperties.pre import Material
from sectionproperties.pre.library import concrete_rectangular_section

Create Geometry

Create a 600 deep by 300 wide rectangular concrete beam, reinforced with:

  • 3 x 16 mm bars top (32 mm cover)

  • 3 x 20 mm bars bottom (42 mm cover)

  • 3 x 12 mm bars each side (57 mm cover)

The circular reinforcement is discretised with 16 points.

The following material properties are used:

32 MPa Concrete

  • Elastic modulus = 30.1 GPa

  • Poisson’s ratio = 0.2

  • Density = 2400 kg/m\(^3\) = 2.4 x 10\(^{-6}\) kg/mm\(^3\)

  • Yield Strengh = 32 MPa

500 MPa Steel

  • Elastic modulus = 200 GPa

  • Poisson’s ratio = 0.3

  • Density = 7850 kg/m\(^3\) = 7.85 x 10\(^{-6}\) kg/mm\(^3\)

  • Yield Strengh = 500 MPa

[23]:
# define the concrete material
concrete = Material(
    name="Concrete",
    elastic_modulus=30.1e3,
    poissons_ratio=0.2,
    density=2.4e-6,
    yield_strength=32,
    color="lightgrey",
)

# define the steel material
steel = Material(
    name="Steel",
    elastic_modulus=200e3,
    poissons_ratio=0.3,
    yield_strength=500,
    density=7.85e-6,
    color="grey",
)

# create the geometry
geom = concrete_rectangular_section(
    d=600,
    b=300,
    dia_top=16,
    area_top=200,
    n_top=3,
    c_top=32,
    dia_bot=20,
    area_bot=310,
    n_bot=3,
    c_bot=42,
    dia_side=12,
    area_side=110,
    n_side=3,
    c_side=57,
    n_circle=16,
    conc_mat=concrete,
    steel_mat=steel,
)

Create Mesh and Section object

Create a mesh with a mesh size of 200 mm\(^2\) and plot the mesh.

[24]:
geom.create_mesh(mesh_sizes=[200])
sec = Section(geometry=geom)
sec.plot_mesh()
../../_images/examples_geometry_section_library_53_0.svg
[24]:
<Axes: title={'center': 'Finite Element Mesh'}>

Perform an Analysis

We perform only a geometric analysis on the reinforced concrete section.

[25]:
sec.calculate_geometric_properties()

Calculate Gross Effective Moment of Inertia

We can calculate the gross effective moment of inertia by obtaining the flexural rigidity (\(\sum E.I\)) of the section and dividing it by the elastic modulus of the concrete. We compare this to the moment of inertia of a rectangular section of the same dimensions.

[26]:
ei = sec.get_eic(e_ref=concrete)
print(f"I_eff = {ei[0]:.3e} mm4")
print(f"I_rec = {(300 * 600**3 / 12):.3e} mm4")
I_eff = 5.991e+09 mm4
I_rec = 5.400e+09 mm4