OpenFOAM Dynamic Mesh
#+CATEGORY: openfoam
OpenFOAM Dynamic Mesh :: Moving Deforming Mesh Techniques
Dynamic mesh (also called moving mesh or deforming mesh) techniques allow the computational mesh to move and deform in response to prescribed motions or fluid-structure interactions. This is fundamentally different from remeshing (generating a new mesh at each time step): in dynamic mesh, the same mesh topology is maintained and nodes are continuously repositioned, with the ALE (Arbitrary Lagrangian-Eulerian) formulation governing the mesh motion.
ALE (Arbitrary Lagrangian-Eulerian) Formulation
In the ALE framework, the mesh velocity $\mathbf{u}_m$ is distinct from the fluid velocity $\mathbf{u}$:
The conservation equations are modified to account for mesh motion:
The relative velocity $(\mathbf{u} - \mathbf{u}_m)$ is the key quantity in the convective flux calculation for dynamic meshes. The Geometric Conservation Law (GCL) requires that the discretized form exactly satisfy:
OpenFOAM satisfies the GCL by ensuring that the cell volume change exactly equals the integrated face motion. This is essential for the conservation of mass, momentum, and energy in moving mesh simulations.
Dynamic Mesh Models
| Model | Method | Use Case |
| ------- | -------- | ---------- |
| solidBody | Uniform rigid body motion | Rigid body translation/rotation |
| velocityMotion | Prescribed mesh velocity | Moving boundaries |
| displacementMotion | Prescribed mesh displacement | Prescribed deformation |
| dynamicFvMesh | General dynamic mesh | Mesh deformation via smoothing |
| dynamicLagrangianMesh | Deforming mesh with subcycling | Fast deformations |
Mesh Smoothing
The most common dynamic mesh technique is mesh smoothing (also called laplacian smoothing or spring analogy):
Laplacian smoothing solves a Laplace equation for node displacement:
where $\mathbf{x}$ is the node position and $\gamma$ is a diffusivity. The diffusivity can be:
- linear: constant diffusivity
- inverseDistance: diffusivity proportional to 1/r (r = distance to fixed boundary) — prevents mesh inversion near fixed boundaries
- cellMean: cell-centered diffusivity
- faceMean: face-centered diffusivity
dynamicFvMesh Configuration
inverseDistance is preferred because it naturally handles the boundary condition issue: nodes near a moving boundary are influenced strongly by the boundary motion, while nodes far from the boundary (near fixed walls) are influenced weakly, preserving mesh quality in the bulk.
dynamicMeshDict
The primary configuration file for dynamic meshes is constant/dynamicMeshDict:
For multi-region cases (fluid + structure), the dynamic mesh dict specifies the motion for each region.
dynamicFvMesh Solver Extensions
Moving-mesh solvers are named with the DyMFoam suffix:
| Solver | Description |
| -------- | ------------- |
| pimpleDyMFoam | Transient, incompressible, PIMPLE with dynamic mesh |
| pisoDyMFoam | Transient, incompressible, PISO with dynamic mesh |
| sonicDyMFoam | Transient, compressible, density-based with dynamic mesh |
| reactiveDyMFoam | Reacting flow with dynamic mesh |
| interDyMFoam | Two-fluid VOF with dynamic mesh (free surface on floating body) |
Rigid Body Motion
For rigid body motion (rotation, translation, or coupled translation-rotation):
For complex rigid body motion (coupled fluid-structure interaction):
6DOF solver solves:
where the forces $\mathbf{F}$ and moments $\mathbf{M}$ come from the fluid stress integration on the body surface.
Mesh Quality Constraints in Dynamic Mesh
Mesh quality degrades over time in dynamic mesh simulations. Key metrics to monitor:
- Skewness: must remain below 0.95 (ideally < 0.9)
- Non-orthogonality: must remain below 60°
- Volume change: cell volume ratio (V_new/V_old) should be within 0.1–10
If mesh quality degrades below thresholds, the simulation will diverge. Mitigation strategies: 1. Limit maximum displacement per timestep 2. Increase smoothing iterations (nLaplacianIterations) 3. Use motionPreProcessor to re-smooth before solving 4. Use fvOptions source to correct field values if cells invert
Summary
1. Dynamic mesh uses ALE formulation where mesh velocity $\mathbf{u}_m$ is distinct from fluid velocity 2. Laplacian smoothing with inverseDistance diffusivity is the standard mesh deformation technique 3. The GCL (Geometric Conservation Law) must be satisfied for conservation in moving meshes 4. Solver extension: -DyM prefix (pimpleDyMFoam, interDyMFoam) 5. Rigid body motion via solidBodyMotionFunctions + 6DOF
See Also
- OpenFOAM Two-Phase VOF MethodsOpenFOAM