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.
| Reference | KoFEM | Difference |
|---|---|---|
| 8.7912 × 10−4 rad | 8.5783 × 10−4 rad | −2.42 % within ±5 % |
The problem
| 1000 mm | |
| 100 mm | |
| 210 GPa | |
| 0.3 | |
| 1 kN·m |
| Supports | x = 0 face fixed (Ux, Uy, Uz). |
|---|---|
| Load | Torque T about x as a moment on the x = L face. |
| Measured | Mean 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 , with the polar moment . 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, , and is free to warp axially by , with a warping function that depends on the shape of the section.
The shear stresses follow from Prandtl's stress function , with and . Compatibility requires
and the torque is twice the volume under :
This defines the torsion constant . For a square of side the series solution gives (Timoshenko and Goodier tabulate 0.141). The case uses Roark's closed-form fit for rectangles, evaluated for a square:
The polar moment of the square, , would overestimate the stiffness by 18 %. The free end rotates by
Here , and .
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
| Mesh | 20 × 6 × 6 grid: 720 linear 8-node hexahedra (P1) |
|---|---|
| Unknowns | 1,029 nodes, 3,087 degrees of freedom |
| Material | Linear elastic, isotropic |
| Solver | KoFEM 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 from the axis and scaled so the net force is zero and the moment is . 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, .
Results
| Quantity | angle of twist θ |
|---|---|
| Reference | θ = T·L / (G·K) = 8.7912 × 10−4 rad |
| KoFEM | 8.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 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 ; the ±5 % band allows for that.
The reference itself carries Roark's fit: the series value 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
- S. P. Timoshenko and J. N. Goodier, Theory of Elasticity, 3rd ed., McGraw-Hill, 1970.
- W. C. Young and R. G. Budynas, Roark’s Formulas for Stress and Strain, 7th ed., McGraw-Hill, 2002.
- 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.