Contents
Validation
Examples

Validation / 2 of 10

Bar under end pressure

The axial bar again, now compressed by a uniform pressure on its end face. Pressure pushes along the inward normal, so a positive pressure must shorten the bar. The example checks the sign of pressure loads and that a pressure is treated as a force per area, not as a total force.

Bar under end pressure: displacement magnitude |u| on the deformed shape, displacements drawn 20,000 times enlarged
0.00 mm0.00474 mm
Displacement magnitude |U|, deformed shape, displacements drawn 20,000 times enlarged. Drawn from the analysis file that Open in KoFEM loads.
Tip displacement u; reference u = −p·L / E
Reference KoFEM Difference
−4.7619 × 10−3 mm −4.7358 × 10−3 mm −0.55 %
within ±2 %

Open in KoFEMOpens the solved model in the app.

The problem

𝑝 |𝑢| 𝐿 𝑥𝑦 𝑊 𝐻 section 𝐴 = 𝑊 𝐻
Prismatic bar of length L along x, W × H section. Sketch, not to scale; thin lines show the element mesh.
L1000 mm
W×H100 × 100 mm
E210 GPa
ν0.3
p1 MPa
Supportsx = 0 face fixed (Ux, Uy, Uz).
LoadPressure p on the x = L face.
MeasuredMean x-displacement of the x = L face.

Analytical solution

On the end face the outward normal is n=ex, so the traction is t=−pn=−pex. The bar carries an axial force N=−pA and a uniform compressive stress σxx=−p. Following the axial bar derivation,

u(L)=NLEA=−pLE.

The cross-section cancels: an end pressure shortens a bar by the same amount whatever its size. With p=1 MPa, the tip moves by u(L)=−4.7619×10−3 mm.

Finite element model

Mesh20 × 4 × 4 grid: 320 linear 8-node hexahedra (P1)
Unknowns525 nodes, 1,575 degrees of freedom
MaterialLinear elastic, isotropic
SolverKoFEM engine (MFEM), the WebAssembly build the app runs: engine-5ceb743373dd

The pressure is integrated over the end face with the same boundary integrator as the axial bar's force, with the traction t=−pn built from each face's normal.

Results

Quantitytip displacement u
Referenceu = −p·L / E = −4.7619 × 10−3 mm (Gere & Goodno, Mechanics of Materials)
KoFEM−4.7358 × 10−3 mm
Difference−0.55 % within ±2 %

Discussion

The difference, −0.55 %, matches the axial bar in tension (−0.55 %). That is what linearity predicts: the resultant here is pA=10 kN instead of P=1000 kN, and every displacement scales with the load. An identical relative difference shows that the pressure path builds the same load vector as the force path with t=−pn, so both its sign and its area scaling are right.

The two ways this could go wrong are easy to spot. A flipped sign would stretch the bar instead (about −200 %). Treating p as a total force instead of a force per area would be off by a factor of A=1.0000×104 mm2.

Reproduce

In the app: open the model, then Studies → Static 1 → Run static solve, select the result plot and set Field to Ux. The Result summary shows Min Ux -4.736e-3 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 surface-pressure
Case                                  Quantity                                  FE   Reference     Err%  Tol%  Status
Bar under end pressure                tip displacement u                -4.7358e-3  -4.7619e-3    -0.55     2  PASS

References

  1. 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.