grokkingstuff Home Blog Projects Wiki Calculators About

Solid Mechanics in OpenFOAM - Structural Analysis and Coupled Solvers

date2026-07-28tags:openfoam: :training: :supplements: :solid-mechanics:

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 TypeBC TypePhysical Meaning
Fixed supportfixedValueZero displacement
Applied tractiontractionBoundarySurface force per area
Prescribed disp.fixedValueKnown displacement
SymmetrysymmetryPlaneNo 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:

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:

PropertyDescription
centreOfMassReference point for rotations
massRigid body mass
IInertia tensor (tensor dimension 3)
constraintsDegrees 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 / CapabilityOpenFOAMANSYS MechanicalSolidWorks Simulation
Linear Elastic (static)solidDisplacementFoamFull (Static Structural)Full
Linear Elastic (quasi-static)solidDisplacementFoamFullFull
Modal AnalysisNoFull (Eigenvalue extraction)Full
Transient StructuralLimitedFullFull
Plasticity (von Mises, hardening)NoFull (isotropic/kinematic)Limited
Fracture Mechanics (LEFM/EPFM)NoFull (XFEM, cohesive zone)No
Creep / ViscoelasticityNoFullLimited
Composite MaterialsNoFull (laminate layers)Limited
ChT (fluid-solid thermal coupling)chtMultiRegionFoamSystem Coupling + FluentExternal Routes
FSI (partitioned)LimitedSystem Coupling (strong)Limited
Nonlinear geometryNoFull (large deformation)Limited
Contact (body-body)NoFull (bonded, frictional)Full
Integration with CFDNative (same codebase)Fluent/CFX couplingExternal 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

ScenarioRecommended Approach

+---------------------------------------+---------------------------------------------+

Pure structural analysisUse ANSYS Mechanical or Abaqus
CHT without fluid dynamicschtMultiRegionFoam with no flow
CHT with coupled fluid-solid flowchtMultiRegionFoam (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