Compressible Flow
#+CATEGORY: cfd
Compressible Flow :: When Density Is Not Constant
Compressible flow occurs when density variations are dynamically significant, typically above Mach 0.3 and overwhelmingly above Mach 0.8. The energy equation must solve with conservation equations, and the equation of state provides closure. Wave phenomena dominate: shocks, expansion fans, and acoustic waves are common.
The system becomes hyperbolic PDEs, possibly mixed hyperbolic-parabolic. In incompressible flow, the system is elliptic-parabolic, changing solver strategy fundamentally.
This note covers compressible flow equations, shock physics, characteristic analysis, and the numerical strategies for shock-wave resolution.
The Full Compressible System
The conservative variables for 3D compressible flow are:
| Variable | Symbol | Physical Meaning | ||
| ---------- | -------- | ----------------- | ||
| Density | $rho$ | Mass per unit volume | ||
| Velocity vector | $u = (u,v,w)$ | Momentum per unit mass | ||
| Total energy | $E = e + 1/2 | u | ^2$ | Energy per unit mass |
| Pressure | $p$ | Thermodynamic pressure |
The conservative vector form:
The vector U contains rho, rho u, rho v, rho w, and rho E. The flux F includes inviscid convective fluxes. The flux F_v contains viscous and conductive fluxes.
The ideal gas law closes the system as p = rho R T. The caloric equation e = c_v T provides the second closure. Calorically imperfect gases use tabulated thermochemistry instead.
Shock Waves
Shock waves are discontinuous solutions of the compressible Euler equations arising when supersonic upstream flow must decelerate to subsonic for downstream boundary conditions.
Rankine-Hugoniot relations enforce mass, momentum, and energy conservation across the shock:
For an ideal gas with ratio of specific heats gamma:
Key properties: density ratio has a finite limit of (gamma + 1)/(gamma - 1), which is at most 6 for air with gamma = 1.4. Entropy increases across a shock, making shocks irreversible under the second law of thermodynamics. Upstream Mach number is greater than 1 while downstream Mach number is less than 1 for a normal shock.
Oblique shocks and expansion fans handle all 3D external aerodynamics, with Prandtl-Meyer functions describing expansion fans.
Characteristic Analysis
The Jacobian of the flux in any direction has real eigenvalues corresponding to wave speeds. The speed of sound a = sqrt(gamma R T). Physical interpretation: u minus a is the left-running acoustic wave, u is entropy and vorticity convected with the flow, u plus a is the right-running acoustic wave.
Characteristic counting determines required boundary conditions per boundary. Subsonic inlet needs 3 BCs (pressure, temperature, normal velocity). Supersonic inlet needs all 5 variables prescribed. Subsonic outlet needs 1 BC (fixed pressure is common). Supersonic outlet needs none. The wall imposes no-flow and thermal conditions.
Supersonic vs Subsonic Compressible Flow
| Feature | Subsonic (M less than 1) | Supersonic (M greater than 1) |
| --------- | -------------------------- | ------------------------------- |
| Information propagation | Upstream and downstream | Downstream only (inviscid) |
| Pressure waves travel | In all directions | Only downstream |
| Shock handling | N/A | Requires shock-capturing or shock-fitting scheme |
| Numerical methods | Pressure-based solvers handle this well | Density-based solvers handle this well |
| Boundary conditions | Mixed elliptic/hyperbolic | Purely hyperbolic |
Density-Based vs Pressure-Based Solvers
Density-based solvers (rhoSimpleFoam, rhoPimpleFoam, sonicFoam) use primitive conservative form with density as a primary unknown, suitable for all Mach numbers with peak efficiency at high Mach. Pressure-based solvers follow a traditional route now extended to low-speed compressible flow, updating density from EOS and continuity. OpenFOAM compressible solvers are not pressure-based by default.
Preconditioning
Low Mach numbers cause ill-conditioning for compressible solvers. At M much less than 1, acoustic eigenvalues are much larger than convective ones, making the system stiff. Preconditioning modifies the time-derivative term to equalize eigenvalue magnitudes, allowing a single solver to march from M = 0.001 to M greater than 1. Without it, the acoustic CFL number forces impractically small timesteps.
Viscous Compressible Flow
Viscous fluxes include viscous stress and heat conduction. Fourier's law applies for heat flux. Sutherland's law models viscosity for a Stokes fluid. The Prandtl number is about 0.72 for air but varies for other gases.
Compressible Turbulence
RANS closures for compressible flow require modeling additional terms absent in incompressible RANS: compressibility corrections to turbulent kinetic energy, turbulent heat flux requiring a turbulent Prandtl number or scalar transport equation, dilatation effects that standard RANS usually ignores, and Mach-number corrections to eddy-viscosity assumptions.
Compressible turbulence DNS uses fully compressible Navier-Stokes equations with no modeling. LES uses filtered compressible equations requiring subfilter-scale turbulence models.
Summary
Compressible flow requires solving all conservation equations simultaneously. Shocks are hyperbolic discontinuities handled by Riemann solvers and limiters. Characteristic analysis determines boundary conditions per Mach regime. Density-based solvers are standard for high-speed flows. Low-Mach preconditioning bridges to incompressible regimes. Compressible turbulence adds terms beyond the incompressible RANS closure.
See Also
- Governing Equations
- Incompressible Flow
- TVD Limiters
- Boundary Conditions
- OpenFOAM Solver Selection
- Stability Analysis
- ANSYS Fluent OverviewAnsys
- Conservation Laws and the Reynolds Transport TheoremCFD
- Governing Equations of Fluid MechanicsCFD
- Incompressible FlowCFD
- Stability Analysis for CFDCFD
- OpenFOAM Case Setup — Dictionaries, BCs, and Turbulence ConfigurationOpenFOAM
- OpenFOAM Compressible Fluid ModuleOpenFOAM
- OpenFOAM Shock-Capturing and Density-Based SolversOpenFOAM
- OpenFOAM Solver Selection GuideOpenFOAM