Density-Based Solver
Theory: wave-speed disparity slows convergence
Overview
Density-based solvers are said to suit high-speed flow. What goes wrong at low speed?
Information in a flow travels either with the flow or as sound, forwards and backwards. A density-based solver handles both at once, so time step and convergence rate depend on the gap between the fastest acoustic wave and the slowest flow. At high speed the gap is small, but at low speed sound is far faster than the flow — tens or hundreds of times. The solver then tracks slow flow changes with a tiny acoustic time step and converges sluggishly. Numerical dissipation also grows at low Mach number, hurting accuracy. Preconditioning fixes this.
Wave speeds and stiffness
u is flow speed, c sound speed and N the number of cells along the flow. n_step is the number of explicit steps for flow to cross the domain once.
Weiss–Smith preconditioning
For an ideal gas. U_r is a reference speed: flow speed at low speed, capped at sound speed. At low Mach number the fastest wave is about 1.62 times flow speed (the golden ratio).
A method born in aeronautics
Density-based methods developed in the 1970s–80s for computing transonic and supersonic aircraft flows. Representative examples are MacCormack's method, Jameson's finite-volume scheme with Runge–Kutta time stepping, and Roe's approximate Riemann solver; their strength was capturing shocks sharply. They struggled at low speed, and in the 1980s–90s Turkel, Weiss and Smith and others proposed preconditioning so one solver could cover low-speed to supersonic flow.
Worked examples
Example 1: Mach number and convergence (200 cells, CFL 1, explicit)
| Mach | Wave-speed ratio (none) | Steps per flow-through | Preconditioned ratio | Preconditioned steps |
|---|---|---|---|---|
| 0.01 | 101 | 20,200 | 3.2 | 323 |
| 0.05 | 21 | 4,200 | 3.2 | 323 |
| 0.1 | 11 | 2,200 | 3.2 | 324 |
| 0.3 | 4.3 | 866 | 3.0 | 328 |
| 2.0 | 1.5 | 300 | (not needed) | 300 |
The preconditioned ratio is fastest wave (u′ + c′) over slowest (u′). At Mach 2 the reference speed is capped at sound speed, so preconditioning is inactive (and unnecessary).
Example 2: Mach 2 normal shock (γ = 1.4)
| Quantity | Theory |
|---|---|
| Pressure ratio p₂/p₁ | 4.500 |
| Density ratio ρ₂/ρ₁ | 2.667 |
| Temperature ratio T₂/T₁ | 1.687 |
| Downstream Mach | 0.577 |
| Total-pressure ratio p₀₂/p₀₁ | 0.721 |
Common verification values for density-based solvers. Also check the jump spans 2–3 cells without oscillation.
At Mach 0.01, preconditioning is more than 60 times faster.
In step count, yes. But preconditioning rewrites the time-derivative terms, so the intermediate transient is not physical; use it only for steady solutions. For unsteady work, pair it with dual time stepping — pseudo-time iterations within each physical time step — and precondition only those. Preconditioning doesn't affect shock capturing itself, so it pays off most in flows mixing low-speed and supersonic regions, such as stagnant zones near a supersonic nozzle exit. If the whole flow is slow with no compressibility effects, a pressure-based solver is often more straightforward.
Choosing and configuring
- Consider density-based when Mach exceeds about 0.3 or shocks exist.
- Enable preconditioning if low-speed regions exist.
- For unsteady flow use dual time stepping with preconditioning in pseudo-time only.
- Use implicit schemes or multigrid to raise CFL and speed convergence.
- Verify against shock-tube or normal-shock theory.
“A ventilation case whose residuals stalled”
A room-ventilation case was run with leftover density-based settings, and residuals barely fell after tens of thousands of iterations. Air speed was about 0.5 m/s, Mach about 0.0015, giving a wave-speed ratio near 680 — no wonder it wouldn't converge unpreconditioned. Enabling preconditioning converged it in a few hundred iterations, but switching to a pressure-based solver was faster still and more stable. Choose the solver from the Mach number.
Common mistakes
Mistakes and fixes
| Mistake | Effect | Fix |
|---|---|---|
| No preconditioning at low speed | No convergence, poor accuracy | Enable preconditioning |
| Preconditioning in physical time | Wrong transient | Dual time stepping |
| Oscillations at shocks | Negative pressure | Use limiters |
| CFL too high | Divergence | Ramp it up |
| Density-based for wholly slow flow | Slow solve | Consider pressure-based |
I'd like to learn related topics.
Related pages include the SIMPLE algorithm, coupled solvers, multigrid, time integration in CFD and finite-volume fundamentals.