Contents
Validation
Examples

Validation / 6 of 10

Square beam under torsion

Twisting a bar with a square section is the simplest torsion problem that the circular-shaft formula gets wrong. The sections do not stay plane: they warp out of their plane, and the bar is softer in torsion than its polar moment of inertia suggests. The case checks that KoFEM captures this 3-D behaviour.

Square beam under torsion: displacement magnitude |u| on the deformed shape, displacements drawn 2,000 times enlarged
0.00 mm0.0614 mm
Displacement magnitude |U|, deformed shape, displacements drawn 2,000 times enlarged. Drawn from the analysis file that Open in KoFEM loads.
Angle of twist θ; reference θ = T·L / (G·K)
Reference KoFEM Difference
8.7912 × 10−4 rad 8.5783 × 10−4 rad −2.42 %
within ±5 %

Open in KoFEMOpens the solved model in the app.

The problem

𝑥 𝑇 𝐿 + − − + 𝑏 warping sign
Beam of length L along x, square b × b section; K = β·b⁴, β = 1/3 − 0.21·(1 − 1/12). Sketch, not to scale; thin lines show the element mesh.
L1000 mm
b100 mm
E210 GPa
ν0.3
T1 kN·m
Supportsx = 0 face fixed (Ux, Uy, Uz).
LoadTorque T about x as a moment on the x = L face.
MeasuredMean rotation of the x = L face about the axis.

Analytical solution

In a circular shaft the shear stress grows linearly with the radius and the torsional stiffness is GJ, with the polar moment J. Saint-Venant's theory (1855) covers any section. Each section rotates rigidly in its own plane by an angle that grows linearly along the bar, θ(x)=θ′x, and is free to warp axially by ux=θ′ω(y,z), with a warping function ω that depends on the shape of the section.

The shear stresses follow from Prandtl's stress function φ(y,z), with τxy=∂φ/∂z and τxz=−∂φ/∂y. Compatibility requires

∇2φ=−2Gθ′ in the section,φ=0 on its boundary,

and the torque is twice the volume under φ:

T=2∫AφdA=GKθ′.

This defines the torsion constant K. For a square of side b the series solution gives K≈0.1406b4 (Timoshenko and Goodier tabulate 0.141). The case uses Roark's closed-form fit for rectangles, evaluated for a square:

K=βb4,β=13−0.21(1−112)=0.1408.

The polar moment of the square, J=b4/6≈0.1667b4, would overestimate the stiffness by 18 %. The free end rotates by

θ=TLGK,G=E2(1+ν).

Here G=80.769 GPa, K=1.4083×107 mm4 and θ=8.7912×10−4 rad.

The warping is largest at the corners and changes sign from one quadrant of the section to the next (inset in the figure). The largest shear stress is at the middle of each side, not at the corners, where it is zero.

Finite element model

Mesh20 × 6 × 6 grid: 720 linear 8-node hexahedra (P1)
Unknowns1,029 nodes, 3,087 degrees of freedom
MaterialLinear elastic, isotropic
SolverKoFEM engine (MFEM), the WebAssembly build the app runs: engine-5ceb743373dd

The torque is applied as tangential nodal forces on the end face, proportional to each node's distance r from the axis and scaled so the net force is zero and the moment is T. That is how the app applies a moment to a face. It is not the exact Saint-Venant stress distribution over a square, but by Saint-Venant's principle the difference only affects the region near the loaded end. The twist is the mean in-plane rotation of the end-face nodes, (yuz−zuy)/r2.

Results

Quantityangle of twist θ
Referenceθ = T·L / (G·K) = 8.7912 × 10−4 rad (Timoshenko & Goodier, Theory of Elasticity; Roark)
KoFEM8.5783 × 10−4 rad
Difference−2.42 % within ±5 %

Discussion

KoFEM's twist differs from the reference by −2.42 %. The main reason is physical, not numerical. Saint-Venant's solution assumes that every section warps freely, but the clamp holds the x=0 section flat. Restraining the warping stiffens the bar over a length comparable to the section size, here a tenth of the bar, so the whole bar twists slightly less. A converged 3-D solution therefore lies below TL/(GK); the ±5 % band allows for that.

The reference itself carries Roark's fit: the series value β=0.1406 would raise it by 0.17 %.

Reproduce

In the app: open the model, then Studies → Static 1 → Run static solve, select the result plot and set Field to Displacement (magnitude). The Result summary shows Max |U| 6.144e-2 mm.

From a clone (Node.js 20+, bash, curl), this solves the model with the same engine and prints its line:

git clone https://github.com/mkofler96/KoFEM.git && cd KoFEM
bash scripts/fetch-wasm-engine.sh
node examples/validation/run.mjs --case beam-torsion
Case                                  Quantity                                  FE   Reference     Err%  Tol%  Status
Square beam under torsion             angle of twist θ                   8.5783e-4   8.7912e-4    -2.42     5  PASS

References

  1. S. P. Timoshenko and J. N. Goodier, Theory of Elasticity, 3rd ed., McGraw-Hill, 1970.
  2. W. C. Young and R. G. Budynas, Roark’s Formulas for Stress and Strain, 7th ed., McGraw-Hill, 2002.
  3. J. M. Gere and B. J. Goodno, Mechanics of Materials, Cengage Learning: axially loaded members, torsion, deflections of beams.

KoFEM is research software and is not certified for safety-critical design. It solves linear-static, linear-elastic problems. Check results that matter against your own references.