Understanding Compressible Flow Solvers in OpenFOAM

Compressible flows are fundamentally different from incompressible flows because density can no longer be assumed constant. As pressure and temperature change, density changes as well, and these variations strongly influence the flow physics. Problems involving shock waves, blast waves, high-speed aerodynamics, supersonic nozzles, and gas dynamics all fall into the category of compressible flow.

In OpenFOAM, compressible CFD is handled using specialized solvers such as rhoCentralFoam and rhoPimpleFoam. Although both solve the compressible Navier–Stokes equations, they rely on very different numerical approaches and are suitable for different classes of problems.

Understanding Why Compressibility Matters

“In compressible CFD, pressure is no longer just a correction variable. It directly affects density, temperature, and energy.”

In incompressible CFD, density is usually treated as constant, which simplifies the governing equations significantly. But once compressibility becomes important, the solver must track how density evolves in time and space.

The continuity equation becomes:

ρt+(ρ𝐮)=0\frac{\partial \rho}{\partial t} + \nabla \cdot (\rho \mathbf{u}) = 0

The momentum equation describes how pressure forces and viscous stresses influence the motion of the fluid.

(ρ𝐮)t+(ρ𝐮𝐮+p𝐈)=𝝉\frac{\partial (\rho \mathbf{u})}{\partial t} + \nabla \cdot \left( \rho \mathbf{u} \otimes \mathbf{u} + p \mathbf{I} \right) = \nabla \cdot \boldsymbol{\tau}

Unlike incompressible flow, compressible solvers must also solve an energy equation because thermal effects strongly influence density and pressure.

(ρE)t+[𝐮(ρE+p)]=(𝝉𝐮)𝐪\frac{\partial (\rho E)}{\partial t} + \nabla \cdot \left[ \mathbf{u} (\rho E + p) \right] = \nabla \cdot (\boldsymbol{\tau} \cdot \mathbf{u}) – \nabla \cdot \mathbf{q}

The total energy is composed of internal and kinetic energy.

E=e+12|𝐮|2E = e + \frac{1}{2} \left| \mathbf{u} \right|^2

To close the equations, a thermodynamic relation is required.

p=(γ1)ρep = (\gamma – 1)\rho e

Density-Based vs Pressure-Based Solvers

“Both solvers solve the same physics, but they approach the equations in completely different ways.”

One of the most important concepts in compressible CFD is understanding the difference between density-based and pressure-based solvers.

rhoCentralFoam belongs to the density-based family. It directly advances conserved variables such as density, momentum, and total energy. This makes it naturally suited for capturing discontinuities like shock waves.

rhoPimpleFoam belongs to the pressure-based family. Instead of directly updating conserved quantities through explicit flux transport, it solves pressure correction equations using the PIMPLE algorithm.

This numerical difference strongly affects stability, efficiency, and mesh sensitivity.

The Working Principle of rhoCentralFoam

“rhoCentralFoam is designed for problems where shocks and discontinuities dominate the physics.”

rhoCentralFoam uses a central-upwind numerical method inspired by the Kurganov–Tadmor scheme. One of its defining characteristics is explicit time integration.

Un+1=UnΔtF(Un)U^{n+1} = U^n – \Delta t \, \nabla \cdot F(U^n)

This means the next solution state is computed directly from the current solution without solving a large coupled matrix system.

The advantage of this approach is that each iteration becomes computationally inexpensive. The solver can sharply capture shock waves and contact discontinuities, making it highly effective for transient compressible flows.

However, explicit methods come with strict stability restrictions.

CFL Restriction and Explicit Stability

“The major limitation of explicit compressible solvers is the very small allowable time step.”

The time step in rhoCentralFoam is controlled by the CFL condition.

Δt=CFL×Δx|𝐮|+c\Delta t = \mathrm{CFL} \times \frac{\Delta x}{|\mathbf{u}| + c}

As the mesh becomes finer, the stable time step becomes smaller. This can significantly increase computational cost, especially for low-speed flows or large industrial meshes.

Another important limitation is mesh quality sensitivity. Central schemes generally perform best on structured and nearly uniform grids. On highly stretched or irregular meshes, numerical errors may increase.

Why rhoPimpleFoam is Widely Used in Industry

“Pressure-based solvers are usually more robust for practical engineering CFD problems.”

Although density-based methods are excellent for shocks, most industrial compressible CFD simulations rely on pressure-based solvers such as rhoPimpleFoam.

The main reason is numerical robustness.

Pressure-based methods can usually work with larger time steps and handle non-uniform meshes more effectively. This makes them more suitable for realistic engineering geometries involving turbulence, boundary layers, and complex mesh topologies.

rhoPimpleFoam combines the SIMPLE and PISO algorithms through the PIMPLE framework, providing a balance between stability and transient accuracy.

Thermophysical Modeling in Compressible CFD

“Thermodynamics forms the backbone of every compressible flow simulation.”

In compressible CFD, pressure, density, temperature, and energy are tightly coupled. Because of this, the solver requires a thermodynamic framework capable of consistently relating all these quantities.

In OpenFOAM, this is defined using the thermoType dictionary.

thermoType
{
    type            hePsiThermo;
    mixture         pureMixture;
    transport       const;
    thermo          hConst;
    equationOfState perfectGas;
    specie          specie;
    energy          sensibleInternalEnergy;
}

The hePsiThermo framework computes density, compressibility, and energy relations for compressible flows. The perfectGas model applies the ideal gas equation.

p=ρRTp = \rho R T

These thermodynamic models ensure that pressure, density, and temperature remain physically consistent throughout the simulation.

The Shock Tube Problem

“The shock tube problem is often the first real test of a compressible solver.”

The shock tube case begins with two regions of gas separated by a diaphragm. One side has high pressure, while the other side has low pressure.

Once the diaphragm is removed, the flow rapidly develops into a shock wave, expansion fan, and contact discontinuity.

This problem is extremely important because it tests whether a numerical method can correctly capture discontinuities without generating oscillations or excessive numerical diffusion.

For this reason, rhoCentralFoam is commonly used for shock tube simulations.

Choosing the Right Compressible Solver

“Understanding solver behavior is more important than simply running tutorials.”

Solver selection strongly affects numerical stability, computational cost, and solution accuracy.

rhoCentralFoam is typically preferred for shock-dominated flows and high-speed compressible transients. rhoPimpleFoam is usually more suitable for practical engineering simulations involving complex meshes and lower Mach numbers.

Learning compressible CFD is not only about understanding equations. It is also about understanding how numerical methods behave under different physical and computational conditions.