grokkingstuff Home Blog Projects Wiki Calculators About

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

ModelMethodUse Case
-------------------------
solidBodyUniform rigid body motionRigid body translation/rotation
velocityMotionPrescribed mesh velocityMoving boundaries
displacementMotionPrescribed mesh displacementPrescribed deformation
dynamicFvMeshGeneral dynamic meshMesh deformation via smoothing
dynamicLagrangianMeshDeforming mesh with subcyclingFast 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:

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:

SolverDescription
---------------------
pimpleDyMFoamTransient, incompressible, PIMPLE with dynamic mesh
pisoDyMFoamTransient, incompressible, PISO with dynamic mesh
sonicDyMFoamTransient, compressible, density-based with dynamic mesh
reactiveDyMFoamReacting flow with dynamic mesh
interDyMFoamTwo-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:

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