Stress Analysis#

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

In this example we model a 150 x 100 x 6 RHS and subject it to various load cases.

Create Geometry and Section#

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


geom = rectangular_hollow_section(d=100, b=150, t=6, r_out=15, n_r=8)
geom.create_mesh(mesh_sizes=[2])
sec = Section(geometry=geom)
sec.plot_mesh(materials=False)
../../_images/examples_analysis_stress_analysis_4_0.svg
[1]:
<Axes: title={'center': 'Finite Element Mesh'}>

Geometric and Warping Analysis#

Because we will be subjecting this box section to torsion and shear, we must first conduct a geometric and warping analysis.

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

Perform Stress Analysis#

The first load case applies the following loads:

  • Mxx = 5 kN.m

  • Vy = -10 kN

  • Mzz = 3 kN.m

The second load case applies the following loads:

  • Myy = 15 kN.m

  • Vx = 30 kN

  • Mzz = 1.5 kN.m

[3]:
case1 = sec.calculate_stress(mxx=5e6, vy=-10e3, mzz=3e6)
case2 = sec.calculate_stress(myy=15e6, vx=30e3, mzz=1.5e6)

Plot Streses#

case1 and case2 obtained from the stress analysis are StressPost() objects. We can plot stresses by using the plot_stress() and plot_stress_vector() methods that belongs to this object.

Case 1#

[4]:
# bending stress
case1.plot_stress(stress="m_zz")
../../_images/examples_analysis_stress_analysis_11_0.svg
[4]:
<Axes: title={'center': 'Stress Contour Plot - $\\sigma_{zz,\\Sigma M}$'}>
[5]:
# torsion stress vectors
case1.plot_stress_vector(stress="mzz_zxy")
../../_images/examples_analysis_stress_analysis_12_0.svg
[5]:
<Axes: title={'center': 'Stress Vector Plot - $\\sigma_{zxy,Mzz}$'}>
[6]:
# von mises stress
case1.plot_stress(stress="vm", cmap="YlOrRd", normalize=False)
../../_images/examples_analysis_stress_analysis_13_0.svg
[6]:
<Axes: title={'center': 'Stress Contour Plot - $\\sigma_{vM}$'}>

Case 2#

[7]:
# shear stress
case2.plot_stress(stress="v_zxy")
../../_images/examples_analysis_stress_analysis_15_0.svg
[7]:
<Axes: title={'center': 'Stress Contour Plot - $\\sigma_{zxy,\\Sigma V}$'}>
[8]:
# von mises stress
case2.plot_stress(stress="vm", cmap="YlOrRd", normalize=False)
../../_images/examples_analysis_stress_analysis_16_0.svg
[8]:
<Axes: title={'center': 'Stress Contour Plot - $\\sigma_{vM}$'}>

Note that the colormap can be changed using one of those specified here. Sequential colormaps are arguably more suited to examining von Mises stresses (always positive), whereas diverging colormaps are more insightful for stresses that can be positive and negative.

The normalize=True argument places the centre of the colormap at zero stress.