Warping Analysis#

This example demonstrates how to perform a warping analysis in sectionproperties.

Channel Section#

This example will conduct a warping analysis on a 250PFC section.

First we create the cross-section geometry.

[1]:
from sectionproperties.pre.library import channel_section


geom = channel_section(d=250, b=90, t_f=15, t_w=8, r=12, n_r=8)

Next we must create a finite element mesh and a Section object. Unlike geometric and plastic analyses, the warping results are mesh dependent. As a general rule of thumb, we would like all plate sections to be at least several elements thick in order to resolve the variations in the warping and shear functions.

[2]:
from sectionproperties.analysis import Section


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

We can now perform the warping analysis by calling calculate_warping_properties(), note that a geometric analysis must be performed first. We also compare the "direct" solver with the "cgs" solver for speed.

[3]:
import time


sec.calculate_geometric_properties()

# direct solver
start = time.time()
sec.calculate_warping_properties(solver_type="direct")
end = time.time()
print(f"Direct Solver Time = {end - start:.4f} secs")

# cgs solver
start = time.time()
sec.calculate_warping_properties(solver_type="cgs")
end = time.time()
print(f"CGS Solver Time = {end - start:.4f} secs")
Direct Solver Time = 1.0581 secs
CGS Solver Time = 0.5944 secs

We can plot the centroids to display the geometric centroid and shear centre using plot_centroids().

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

We can also obtain the some relevant warping properties:

  • J - torsion constant

  • Iw/Gamma - warping constant

  • As_y - shear area for loading along the y-axis

[5]:
print(f"J = {sec.get_j():.3e} mm4")
print(f"Iw = {sec.get_gamma():.3e} mm6")
print(f"As_y = {sec.get_as()[1]:.1f} mm2")
J = 2.382e+05 mm4
Iw = 3.555e+10 mm6
As_y = 1823.4 mm2

Unconnected Sections#

Unlike geometric and plastic analysis, cross-sections analysed for warping must have strict connectivity. sectionproperties checks for connectivity prior to conducting a warping analysis and will throw an error if there is not full connectivity between all regions of the mesh.

[6]:
from sectionproperties.pre.library import rectangular_section


# create an unconnected mesh
rect = rectangular_section(d=10, b=10)
geom = rect + rect.shift_section(x_offset=20)
geom.create_mesh(mesh_sizes=1)
sec = Section(geometry=geom)
sec.plot_mesh(materials=False)
../../_images/examples_analysis_warping_analysis_14_0.svg
[6]:
<Axes: title={'center': 'Finite Element Mesh'}>
[7]:
# geometric and plastic analyses can be conducted
sec.calculate_geometric_properties()
sec.calculate_plastic_properties()
[8]:
# warping analysis will fail
sec.calculate_warping_properties()
/home/docs/checkouts/readthedocs.org/user_builds/sectionproperties/envs/latest/lib/python3.10/site-packages/sectionproperties/analysis/section.py:347: UserWarning:
The section geometry contains disjoint regions which is invalid for warping analysis.
 Please revise your geometry to ensure there is connectivity between all regions.
 Please see https://sectionproperties.rtfd.io/en/stable/user_guide/analysis.html#warping-analysis for more information.
  warnings.warn(msg)