Solid Mechanics in OpenFOAM - Structural Analysis and Coupled Solvers
Introduction
OpenFOAM's solid mechanics capabilities are functional but limited compared to dedicated FEA packages. For PhD-level researchers: treat OpenFOAM solid mechanics as a tool for tightly coupled fluid-structure problems where the fluid solver is the primary concern, and the structural response is a secondary component. If your research is primarily about structural mechanics, use ANSYS Mechanical, Abaqus, or Code_Aster instead. Understanding what OpenFOAM does well (and what it does not) is critical for building the right simulation architecture.
solidDisplacementFoam: Quasi-Static Linear Elastic Analysis
solidDisplacementFoam solves the linear elasticity equations for small deformations:
$$\nabla \cdot \boldsymbol{\sigma} + \mathbf{f}_b = 0$$
where the Cauchy stress tensor is related to displacement via Hooke's law:
$$\boldsymbol{\sigma} = \mathbf{C} : \boldsymbol{\varepsilon} = \mathbf{C} : \frac{1}{2}\left(\nabla\mathbf{u} + \nabla\mathbf{u}^T\right)$$
For isotropic materials, this reduces to:
$$\boldsymbol{\sigma} = \lambda \, \text{tr}(\boldsymbol{\varepsilon})\mathbf{I} + 2\mu\,\boldsymbol{\varepsilon}$$
with Lamé parameters $\lambda$ and $\mu$.
Solver Configuration
The constant/elasticProperties file defines material properties:
solidSystem
{
type totalStress;
rho 7800;
nu 0.3;
E 210e9;
}
The solver operates in system/fvSolution:
solvers
{
displacement
{
solver GAMG;
tolerance 1e-08;
relTol 0.1;
smoother symmetricGaussSeidel;
}
}
Boundary Conditions
Boundary conditions are critical and follow the standard OpenFOAM displacement/stress convention:
| Boundary Type | BC Type | Physical Meaning |
|---|---|---|
| Fixed support | fixedValue | Zero displacement |
| Applied traction | tractionBoundary | Surface force per area |
| Prescribed disp. | fixedValue | Known displacement |
| Symmetry | symmetryPlane | No normal displacement |
solidEquilibriumDisplacementFoam: Static Equilibrium
solidEquilibriumDisplacementFoam is a simplified variant that assumes no body forces and reaches static equilibrium directly. It solves:
$$\frac{\partial \sigma_{ij}}{\partial x_j} = 0$$
This is appropriate for problems where the deformation history is irrelevant — for example, a pressurized vessel where you only care about the final equilibrium state, not how it got there. It is a steady-state structural analysis without time stepping. The computational cost is lower than solidDisplacementFoam because there is no transient component.
Think of this solver as the structural equivalent of simpleFoam: it seeks the equilibrium state without caring about the path. It is elegant in its simplicity and occasionally frustrating in its limitations, which are identical.
Conjugate Heat Transfer: Solid-Fluid Coupling
Conjugate heat transfer (CHT) couples heat conduction in solids with convection in fluids. This is OpenFOAM's strongest solid-mechanics-adjacent capability.
chtMultiRegionFoam
chtMultiRegionFoam solves energy equations in both solid and fluid regions simultaneously:
- Fluid region: solves
rhoT(energy) coupled with momentum equations - Solid region: solves
T(temperature) via pure conduction
The heat flux continuity at the interface is enforced:
$$-k_f \left.\frac{\partial T_f}{\partial n}\right|_{wall} = -k_s \left.\frac{\partial T_s}{\partial n}\right|_{wall}$$
The mesh topology requires conforming or non-conforming interfaces between fluid and solid regions. In constant/, each region has its own set of physics files:
constant/
fluidRegion/
transportProperties
thermoPhysicalProperties
fvSolution
fvSchemes
solidRegion/
transportProperties (thermal: alpha, k)
fvSolution
fvSchemes
foamMultiRun
foamMultiRun is a driver that coordinates multiple solvers running in parallel for different regions. It manages the interface data exchange between regions at each coupling iteration. This is useful when you want tighter decoupling or when different regions need different solvers entirely.
Fluid-Structure Interaction (FSI) with 6DOF Motion
OpenFOAM supports basic FSI through dynamic mesh capabilities and solid solver coupling:
Coupled Approach
The solid region deformation is solved, mesh motion is applied via fvMotionSolver (typically solidBodyDisplacement or topologyScheme), and the mesh is deformed before the next fluid solve:
$$\mathbf{x}^{n+1} = \mathbf{x}^n + \boldsymbol{\Delta x}_{solid}$$
The fluid solver operates on the deformed mesh, computing new forces, which are then applied to the solid solver. This is a partitioned coupling approach, alternating between fluid and solid solves.
6DOF RigidBodyMotion
For rigid body motion, sixDoFRigidBodyMotion coupled with forceSum forces:
| Property | Description |
|---|---|
| centreOfMass | Reference point for rotations |
| mass | Rigid body mass |
| I | Inertia tensor (tensor dimension 3) |
| constraints | Degrees of freedom (6 dof or constrained subset) |
The six degrees of freedom translation-rotation equations of motion integrate via the solver's time loop:
$$m\dot{\mathbf{v}} = \sum\mathbf{F}_{fluid}, \quad \mathbf{I}\dot{\boldsymbol{\omega}} = \sum\mathbf{M}_{fluid}$$
ANSYS Comparison: Structural Capabilities
| Feature / Capability | OpenFOAM | ANSYS Mechanical | SolidWorks Simulation |
|---|---|---|---|
| Linear Elastic (static) | solidDisplacementFoam | Full (Static Structural) | Full |
| Linear Elastic (quasi-static) | solidDisplacementFoam | Full | Full |
| Modal Analysis | No | Full (Eigenvalue extraction) | Full |
| Transient Structural | Limited | Full | Full |
| Plasticity (von Mises, hardening) | No | Full (isotropic/kinematic) | Limited |
| Fracture Mechanics (LEFM/EPFM) | No | Full (XFEM, cohesive zone) | No |
| Creep / Viscoelasticity | No | Full | Limited |
| Composite Materials | No | Full (laminate layers) | Limited |
| ChT (fluid-solid thermal coupling) | chtMultiRegionFoam | System Coupling + Fluent | External Routes |
| FSI (partitioned) | Limited | System Coupling (strong) | Limited |
| Nonlinear geometry | No | Full (large deformation) | Limited |
| Contact (body-body) | No | Full (bonded, frictional) | Full |
| Integration with CFD | Native (same codebase) | Fluent/CFX coupling | External via COSMOSWorks |
The verdict: OpenFOAM solid mechanics covers the 20% of structural problems that are linear-elastic, small-deformation, and need fluid coupling. For anything else, reach for ANSYS. But if the coupling tightness is important and you want to avoid partitioned solvers talking to each other over the network, OpenFOAM's native coupling is elegant. There is a reason your graduate student who switched from ANSYS to OpenFOAM for FSI ended up writing a custom coupling scheme: the native coupling is clean until it is not.
Limitations
OpenFOAM's structural capabilities have hard limitations:
1. **No plasticity** — Material behavior is strictly linear elastic. Yield surfaces, hardening models, and plastic strain tracking are absent. 2. **No fracture mechanics** — Crack propagation, stress intensity factors, and J-integral calculations are not available. 3. **No geometric nonlinearity** — Large deformation (finite strain) formulations are not supported. The small-strain assumption is enforced. 4. **No contact mechanics** — Two bodies contacting each other is not a capability. 5. **No modal/dynamic analysis** — Eigenvalue extraction for vibration modes is absent. 6. **Material models** — Only isotropic linear elasticity. Anisotropic, orthotropic, and composite material models are not available.
These limitations are not bugs; they are design choices. OpenFOAM's core identity is fluid dynamics. Adding comprehensive structural mechanics would bloat the codebase and distract from the primary mission. The structural solvers exist to enable coupled problems, not to replace dedicated FEA packages.
Case Setup Overview
A solid mechanics case follows the standard OpenFOAM directory structure:
SolidCase/
0/
U # For solidDisplacementFoam, this is displacement 'U' (zero initially)
constant/
transportProperties # Fluid only
elasticProperties # E, nu for solid mechanics
polyMesh/
system/
fvSchemes
fvSolution
controlDict
Workflow Recommendations
| Scenario | Recommended Approach |
+---------------------------------------+---------------------------------------------+
| Pure structural analysis | Use ANSYS Mechanical or Abaqus |
| CHT without fluid dynamics | chtMultiRegionFoam with no flow |
| CHT with coupled fluid-solid flow | chtMultiRegionFoam (primary choice) |
| Lightweight FSI (small deformation) | solidDisplacementFoam + fluid solver loop |
| Heavy FSI (large deformation, contact) | ANSYS System Coupling (MCH) or Abaqus CPE4 |
| Rigid body + fluid (hydrodynamics) | 6DOF RBD + pimpleFoam with dynamic mesh |
References
- Jasak, H. "Error Analysis and Estimation for the Finite Volume Method with Applications to Fluid Flow," Ph.D. Thesis, Imperial College London, 1996.
- Weller, H.G., Tabor, G.R., Jasak, H. & Fureby, C. "A Tensorial Approach to Computational Modelling Using Object-Oriented Finite Volume Methods," Computational Physics, Vol. 12, 1998.
- OpenFOAM Foundation. OpenFOAM User Guide — Solid Mechanics Solvers, 2024.
- OpenFOAM Foundation. OpenFOAM User Guide — CHT and Multi-Region Solvers, 2024.
- ANSYS Inc. ANSYS Mechanical APDL Theory Reference, ANSYS Help Rev. 2024 R2.
- Zienkiewicz, O.C. & Taylor, R.L. The Finite Element Method for Solid and Structural Mechanics. 7th Edition, Butterworth-Heinemann, 2013.
- Bathe, K.J. Finite Element Procedures. Prentice Hall, 1996.