OpenFOAM Specialized Solvers - Non-Standard and Niche CFD Applications
Introduction
Beyond the mainstream incompressible and compressible solvers, OpenFOAM contains (or has contained) a collection of specialized solvers for niche physical phenomena. Some are maintained in the main repository; others exist in community extensions. For PhD researchers, knowing what these solvers do — and what they do not — is as important as knowing when to reach for something else entirely.
DNS: dnsFoam (Direct Numerical Simulation)
dnsFoam is a simplified DNS solver for incompressible flow. It solves the Navier-Stokes equations without any turbulence model — all scales of turbulence are resolved directly. This requires a mesh fine enough to capture the Kolmogorov length scale:
$$\eta = \left(\frac{\nu^3}{\varepsilon}\right)^{1/4}$$
where $\nu$ is kinematic viscosity and $\varepsilon$ is the dissipation rate. The corresponding Reynolds number based on grid spacing must satisfy $\Delta x < \eta$. For a channel flow at Re_τ = 590, this requires on the order of 10⁸–10⁹ cells.
Typical boundary conditions for DNS:
| Boundary | BC Type | Velocity BC | Pressure BC |
|---|---|---|---|
| Inlet | fixedValue | U = U_inlet (turbulent inflow) | fixedGradient (p = 0) |
| Outlet | zeroGradient | zeroGradient | fixedValue (p = 0) |
| Wall | noSlip | U = 0 | fixedGradient (p = 0) |
| Periodic | periodic | periodic | periodic |
The canonical test case is periodic turbulent channel flow. The flow is driven by a constant pressure gradient, and statistics are collected in the streamwise and spanwise homogeneous directions. dnsFoam requires small deltaT to satisfy the CFL condition at the smallest grid scale:
controlDict
{
deltaT 1e-7; // Adjust for Re based on delta
maxCo 0.49; // Strict CFL limit for DNS
adjustTimeStep yes;
}
dnsFoam is useful for validating turbulence models at low to moderate Reynolds numbers. At Re > 10⁴, it becomes computationally intractable. At those Reynolds numbers, you are not doing DNS; you are doing very expensive turbulence-generating CFD that nobody will believe.
DSMC: dsmcFoam (Molecular Regime Flow)
dsmcFoam implements the Direct Simulation Monte Carlo method for rarefied gas dynamics. When the Knudsen number exceeds 0.1, the continuum assumption breaks down:
$$Kn = \frac{\lambda}{L}$$
where $\lambda$ is the molecular mean free path and $L$ is the characteristic length scale. In the DSMC regime (Kn > 0.1), the Boltzmann equation must be solved probabilistically rather than the Navier-Stokes equations deterministically.
| Regime | Kn Range | Governing Equation | Solver Approach |
|---|---|---|---|
| Continuum | Kn < 0.001 | Navier-Stokes | rhoCentralFoam, etc. |
| Slip flow | 0.001 < Kn < 0.1 | NS + slip BCs | Standard FOAM |
| Transition | 0.1 < Kn < 10 | Boltzmann | dsmcFoam |
| Free molecular | Kn > 10 | Collisionless Boltzmann | dsmcFoam |
The DSMC method divides the flow field into cells and tracks representative particles within each cell. Collisions are sampled probabilistically using the Variable Hard Sphere (VHS) model. The simulation advances in time steps that must resolve the mean collision time:
$$\Delta t < \min\left(\frac{1}{\nu_{max}}, \frac{L_{cell}}{c_{max}}\right)$$
where $\nu_{max}$ is the maximum collision frequency and $c_{max}$ is the maximum molecular speed.
dsmcFoam is primarily applicable to high-altitude aerodynamics, micro-electromechanical systems (MEMS), and vapor deposition processes. It is not applicable to standard aerodynamic applications — running DSMC for subsonic flow over a road car would be like using an electron microscope to check oil levels in your engine.
LBM: latticeBoltzmannFoam
Lattice Boltzmann methods solve a discretized form of the Boltzmann equation on a lattice with discrete velocity directions. The method has gained popularity for its excellent parallel scaling and natural handling of complex boundaries.
latticeBoltzmannFoam was available in some OpenFOAM distributions but is not part of core FOAM extensions v14. Community implementations exist (e.g., PALABOS, OpenLB) that can be interfaced with OpenFOAM. LBM is particularly effective for:
- Porous media flow
- Multiphase flow with complex interfaces
- Microfluidic flows
- Large-scale parallel simulations
The lattice Boltzmann method trades kinetic theory elegance for computational simplicity: on a GPU, lattice Boltzmann can outperform Navier-Stokes solvers by a factor of 5-10 for certain problem classes. But if you need accurate turbulence modeling, LBM currently trails behind RANS/LES approaches based on finite volume discretization.
Electrostatics: electrostaticFoam
electrostaticFoam solves the Poisson equation for electric potential:
$$-\nabla \cdot (\epsilon \nabla \phi) = \rho_e$$
where $\epsilon$ is the electric permittivity and $\rho_e$ is the charge density. The electric field is then:
$$\mathbf{E} = -\nabla \phi$$
and the electrostatic force density is:
$$\mathbf{f}_e = \rho_e \mathbf{E} - \frac{1}{2} E^2 \nabla \epsilon + \nabla \left(\frac{1}{2} \rho_e T \frac{\partial \epsilon}{\partial T}\right)$$
The last term is the electrostrictive contribution (usually negligible).
electrostaticFoam is useful for:
- Electret simulations
- Corona discharge modeling (coupled with fluid flow)
- MEMS electrostatic actuators
- Dielectrophoresis in microfluidic devices
Configuration example:
// constant/epsilon
epsilon
{
type uniform;
value 8.854e-12; // vacuum permittivity (F/m)
}
// 0/phi (electric potential)
boundaryField
{
electrode
{
type fixedValue;
value uniform 100; // 100 V
}
ground
{
type fixedValue;
value uniform 0;
}
default zeroGradient;
}
See Incompressible Flow for context on coupling electrostatic forces into fluid solvers via source terms.
MHD: mhdFoam (Magnetohydrodynamics)
mhdFoam solves the coupled Navier-Stokes and Maxwell's equations for conducting fluids in magnetic fields. The governing equations add the Lorentz force and induced electric field:
$$\mathbf{f}_L = \mathbf{J} \times \mathbf{B}$$
where $\mathbf{J}$ is the current density and $\mathbf{B}$ is the magnetic field. The induction equation (magnetic Reynolds number regime dependent):
$$\frac{\partial \mathbf{B}}{\partial t} = \nabla \times (\mathbf{u} \times \mathbf{B}) + \frac{1}{\mu_0 \sigma} \nabla^2 \mathbf{B}$$
where $\sigma$ is electrical conductivity and $\mu_0$ is permeability of free space.
mhdFoam is applicable to:
- Liquid metal flow (NaK, GaInSn, lead-bismuth)
- Magnetic field-assisted casting
- Fusion reactor blanket modeling (liquid lithium, molten盐)
- Electromagnetic pumping
The Hartmann number determines the importance of Lorentz forcing:
$$Ha = B L \sqrt{\frac{\sigma}{\mu}}$$
When Ha >> 1, the flow becomes highly anisotropic (Hartmann layers form along field lines, parabolic profiles in cross-field direction). Resolving Hartmann layers is the primary mesh challenge — boundary layers of thickness O(1/Ha) require extreme near-wall resolution.
DPMFoam: Lagrangian Discrete Phase Modeling
DPMFoam solves Eulerian fluid flow with Lagrangian particle tracking. The fluid phase is solved with a standard solver (e.g., simpleFoam or pimpleFoam), and particles are tracked through the velocity field:
$$\frac{d\mathbf{u}_p}{dt} = \mathbf{F}_D(\mathbf{u} - \mathbf{u}_p) + \frac{\mathbf{g}(\rho_p - \rho_f)}{\rho_p} + \mathbf{F}_{other}$$
where $\mathbf{F}_D$ is the drag force per unit acceleration, $\mathbf{g}$ is gravity, and $\mathbf{F}_{other}$ includes lift, Saffman force, Basset history, and virtual mass effects.
| Feature | DPMFoam Capability |
+-----------------------+------------------------------+
| Particle-particle interaction | Neglected (dilute) |
| Particle-wall collision | Specular/Damnian reflection |
| Evaporation/Combustion | No (not in standard DPMFoam) |
| Breakup/Collision | No |
| Multi-size distributions | Yes (via parcels) |
| 2-way coupling | Yes |
| 4-way coupling | No |
DPMFoam is appropriate for spray combustion droplet tracking (when uncoupled from chemistry), dust transport, and particle-laden flows where the volume fraction of particles is < ~10⁻⁴. For higher volume fractions, Eulerian-Eulerian multiphase solvers are more appropriate.
See Multiphase Flows for comparison with Eulerian multiphase approaches.
Radiation Models
OpenFOAM provides multiple radiation models for participating media:
| Model | Method | Applicability |
+----------------------------+---------------------+----------------------------+
| viewFactor (radiationVIEW) | View factor-based | Enclosures, participating media (gray) |
| DO (Diffusion Approximation) | Diffusion model | Optically thick media (τ >> 1) |
| P1 | Order-1 spherical harmonics | Semi-transparent media |
| Discrete Ordinates (S^n) | Angular discretization | General purpose (moderate cost) |
| Rosseland | Diffusion approx. | Very optically thick (τ → ∞) |
The viewFactor model computes angle factors between surfaces and is the most accurate for non-participating (non-scattering) enclosures. The DO model solves the radiative transfer equation (RTE) with angular discretization — it is the most general but also the most expensive.
ANSYS Comparison: Specialized Modules
| OpenFOAM Solver | ANSYS Equivalent | Star-CCM+ Equivalent |
+-----------------------+-------------------------------------+----------------------------|
| dsmcFoam | ANSYS Fluent DSMC (limited availability) | ANSYS SpaceClaim (mesher only) |
| electrostaticFoam | ANSYS Maxwell (electromagnetics) | SIMPOLE (electrostatic only) |
| mhdFoam | ANSYS Mechanical + Maxwell (coupled) | User-Defined Function (MHD) |
| DPMFoam | ANSYS Fluent DPM (comprehensive) | Discrete Phase Model |
| dnsFoam | Not available (custom code needed) | LES/DNS modes |
| latticeBoltzmannFoam | Not available (no native LBM) | No native LBM |
| viewFactor radiation | ANSYS Radiation (S²S, DTRM) | Radiation Model (same) |
ANSYS provides specialized modules (ANSYS Maxwell for electromagnetics, Fluent UDF/Macro for custom physics) that are broadly more capable for niche applications. Star-CCM+ has a more unified multi-physics platform with user-defined functions in Java/C++. OpenFOAM's specialized solvers require more custom code to extend, but offer full source-level transparency.
The tradeoff: ANSYS provides polished, well-documented modules that work out of the box for most niche applications. OpenFOAM provides solvers that work well if you understand their derivations and will require significant code modification to extend beyond their original scope. One approach is not objectively better; the question is whether you are the type of researcher who reads source code for fun or for compliance.
Workflow Recommendations
| Physical Phenomenon | Primary OpenFOAM Solver | Alternative Consideration |
+----------------------------------+----------------------------+------------------------------------+
| DNS turbulence (low Re) | dnsFoam | OpenFOAM + PALABOS LBM |
| Rarefied gas | dsmcFoam | MONACO, PiMCC (community) |
| Particle tracking (dilute) | DPMFoam | ANSYS Fluent DPM |
| Electrostatics | electrostaticFoam | ANSYS Maxwell (industrial) |
| MHD (liquid metal) | mhdFoam | COMSOL, ANSYS Maxwell-Mechanical |
| Radiation (enclosure) | radiationVIEW + solver | ANSYS S²S model |
| Radiation (general RTE) | DO model + solver | ANSYS DTRM, Star-CCM+ S²S |
| LBM (porous/microfluidics) | PALABOS/OpenLB (external) | ANSYS (limited LBM via UDF) |
References
- 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 — Specialized Solvers, 2024.
- OpenFOAM Foundation. OpenFOAM User Guide — Lagrangian Solids and Particles, 2024.
- Higuera, F.J., Succi, S. & Benzi, R. "Lattice Boltzmann Method with Complex Interactions," Physics Letters A, Vol. 105, No. 6, 1985.
- Hadjiconstantinou, N.G. "Lattice-Boltzmann Theory for Rarefied Gas Flows," Journal of Statistical Physics, Vol. 92, 1998.
- Bird, G.A. Molecular Gas Dynamics and the Direct Simulation of Gas Flows. Oxford University Press, 1994.
- Poole, R.J. & Sevilla, A. "Validation of a Lattice-Boltzmann Channel Flow Solver for Direct-Simulation Monte-Carlo Coupled Methods," International Journal for Numerical Methods in Fluids, Vol. 59, 2009.
- Anderson, J.D. Computational Fluid Dynamics: The Basics with Applications. McGraw-Hill, 1995.
- Anderson, J.D. & Tannehill, J.C. Computational Fluid Mechanics and High-Speed Flows. Wiley, 1982.