Compressible and Expansion Flows: Shocks, Fans and Mach Number
Below about Mach 0.3, air behaves almost like an incompressible liquid — density barely changes and Bernoulli's equation works fine. Push a flow past that threshold and everything changes: density becomes a dynamic variable, information can no longer outrun the fluid itself, and the flow can organise into razor-thin discontinuities called shock waves, or fan out smoothly through expansion waves. This article builds the compressible-flow toolkit from the ground up — Mach number, isentropic relations, normal and oblique shocks, Prandtl-Meyer expansion fans — and ends with a working 1-D nozzle solver you can run in a browser.
1. Mach Number and Flow Regimes
The Mach number M = V/a compares local flow speed V to the local speed of sound a = √(γRT). It is the single most important parameter in compressible aerodynamics because it measures how fast the fluid moves relative to how fast pressure disturbances can propagate through it.
Incompressible, M < 0.3
Density changes < 5%. Bernoulli and potential flow are accurate.
Subsonic, 0.3 < M < 0.8
Compressibility matters; linearised Prandtl-Glauert corrections apply.
Transonic, 0.8 < M < 1.2
Mixed pockets of sub- and supersonic flow; local shocks can appear on a wing even at M < 1.
Supersonic, 1.2 < M < 5
Flow outruns its own pressure signals; shock waves and Mach cones form.
Above roughly M = 5 the flow is called hypersonic, where real-gas effects (dissociation, ionisation) become important — a separate regime beyond the scope of this article, which focuses on calorically perfect gas behaviour (γ constant).
2. Governing Equations for Compressible Flow
Compressible flow is governed by three conservation laws — mass, momentum, and energy — plus an equation of state. For steady, quasi-1-D flow through a duct of varying area A(x), these reduce to:
Differentiating continuity and combining with the momentum equation for isentropic flow yields the compressible Bernoulli-like relation, but the key new behaviour is that dV and dA can have the same sign once M > 1 — a converging duct decelerates subsonic flow but accelerates supersonic flow. This single fact is the reason rocket nozzles are shaped like an hourglass.
3. Isentropic Flow Relations
Away from shocks, compressible flow of a perfect gas is isentropic (no entropy change), which lets us relate static conditions (p, T, ρ) at any point to the stagnation (reservoir) conditions (p0, T0, ρ0) purely as functions of Mach number:
These "star" values at M = 1 are the critical conditions used to size a nozzle throat: whatever the reservoir pressure p0, the throat pressure can never drop below 0.528 p0 while remaining choked — a hard physical limit, not a design choice.
4. The Area-Mach Relation and Nozzles
The single most useful design equation in compressible flow links local duct area A to the throat (sonic) area A* purely through Mach number:
This relation is double-valued: for any A/A* > 1 there are two solutions — one subsonic (M < 1) and one supersonic (M > 1). A converging-diverging (de Laval) nozzle exploits this: flow accelerates subsonically through the converging section, hits M = 1 exactly at the minimum-area throat, then continues accelerating supersonically through the diverging section — provided the downstream (back) pressure is low enough to sustain the expansion.
- Over-expanded: back pressure too low relative to design — oblique shocks form outside the nozzle to recompress the jet.
- Under-expanded: back pressure too high — expansion fans continue outside the nozzle exit.
- Design condition: exit pressure exactly equals ambient pressure — maximum thrust efficiency for that expansion ratio.
5. Normal Shock Waves
A normal shock is a near-discontinuity, typically only a few mean free paths thick, across which supersonic flow becomes subsonic almost instantaneously. Entropy increases (shocks are irreversible), so isentropic relations no longer apply across the shock — instead we use the Rankine-Hugoniot jump conditions derived from conservation of mass, momentum and energy:
Subscript 1 denotes upstream (supersonic, M1 > 1); subscript 2 is downstream (always subsonic, M2 < 1, after a normal shock). Note the stagnation pressure ratio p02/p01 is always < 1 — the shock is a lossy process, and the loss grows rapidly with upstream Mach number. This is precisely why supersonic inlets on jet engines are designed to slow the flow with a series of weak oblique shocks rather than one strong normal shock.
6. Oblique Shocks and the θ-β-M Relation
When supersonic flow meets a wedge or compression corner, the shock forms at an angle β to the incoming flow rather than perpendicular to it. The flow is turned through a deflection angle θ. Decomposing velocity into components normal and tangential to the shock, only the normal component behaves like a normal shock — the tangential component is unchanged, which is what bends the streamline.
For a given upstream Mach number M1, the θ-β-M relation is a family of curves: for each deflection angle θ (up to a maximum θ_max) there are two possible shock angles β — a weak shock (smaller β, usually the physically realised solution in external flow) and a strong shock (larger β, closer to normal, occurring in confined ducts). If θ exceeds θ_max for the given M1, the shock detaches and forms a curved bow shock standing off the body — the situation seen ahead of blunt re-entry capsules and rounded nose cones.
7. Prandtl-Meyer Expansion Fans
Where an oblique shock compresses flow around a concave corner, a Prandtl-Meyer expansion fan accelerates flow smoothly and isentropically around a convex corner. Unlike a shock, an expansion fan has no thickness discontinuity — it is a continuous fan of infinitesimally weak Mach waves, each isentropic, so total pressure is conserved (no losses).
ν(M) is the Prandtl-Meyer function, tabulated or solved numerically since it cannot be inverted in closed form. Given an upstream Mach M1 and a turn angle θ (positive for expansion), you compute ν(M1), add θ to get ν(M2), then invert (e.g. via Newton-Raphson) to recover M2. Because the process is isentropic, all the isentropic p/p0, T/T0 relations from Section 3 still apply across the fan — only the direction of flow and the Mach number change.
8. A Minimal Quasi-1D Nozzle Solver
The area-Mach relation from Section 4 can be solved numerically with a simple bisection or Newton iteration. Below is a compact JavaScript solver that, given an area ratio A/A*, returns both the subsonic and supersonic Mach number roots — the core of any converging-diverging nozzle simulator.
// Solve A/A* = f(M) for M, given branch: 'sub' or 'super'
const GAMMA = 1.4;
function areaRatio(M, gamma = GAMMA) {
const g1 = (gamma + 1) / 2;
const g2 = (gamma - 1) / 2;
const exponent = (gamma + 1) / (2 * (gamma - 1));
const term = (1 / g1) * (1 + g2 * M * M);
return (1 / M) * Math.pow(term, exponent);
}
// Bisection root-find on M in a bracket, matching target A/A*
function solveMachFromArea(areaRatioTarget, branch = 'super') {
let lo = branch === 'sub' ? 1e-3 : 1.0 + 1e-6;
let hi = branch === 'sub' ? 1.0 - 1e-6 : 10.0;
for (let i = 0; i < 100; i++) {
const mid = (lo + hi) / 2;
const f = areaRatio(mid) - areaRatioTarget;
if (Math.abs(f) < 1e-8) return mid;
const fLo = areaRatio(lo) - areaRatioTarget;
if (Math.sign(fLo) === Math.sign(f)) lo = mid; else hi = mid;
}
return (lo + hi) / 2;
}
// Example: throat is minimum area; A/A* = 4 at the exit -> find exit Mach
const Msub = solveMachFromArea(4.0, 'sub'); // ~0.147
const Msup = solveMachFromArea(4.0, 'super'); // ~2.94
console.log(`subsonic branch: M = ${Msub.toFixed(3)}`);
console.log(`supersonic branch: M = ${Msup.toFixed(3)}`);
// Given M, recover static pressure/temperature ratios from Section 3
function isentropicRatios(M, gamma = GAMMA) {
const base = 1 + (gamma - 1) / 2 * M * M;
return {
T0overT: base,
p0overP: Math.pow(base, gamma / (gamma - 1)),
rho0overRho: Math.pow(base, 1 / (gamma - 1)),
};
}
Sweeping this solver across a nozzle's area profile A(x) — using the subsonic branch before the throat and the supersonic branch after it — produces the full Mach, pressure and temperature distribution along the nozzle axis, exactly what a real 3-D simulation would show as a colour-mapped flow field.
9. Applications in Aerospace Design
Rocket nozzles
De Laval geometry accelerates combustion gases from subsonic chamber conditions to supersonic exhaust, converting thermal energy into directed kinetic energy (thrust).
Supersonic inlets
A series of weak oblique shocks decelerates intake air with minimal stagnation-pressure loss before it reaches the compressor face.
Transonic wing design
Supercritical airfoils are shaped to keep the local shock on the upper surface weak, delaying drag divergence near M = 1.
Re-entry bow shocks
Blunt heat shields deliberately detach the shock far from the surface, so the hottest gas stays away from the vehicle skin.
Every one of these designs comes back to the same handful of relations derived above: Mach number sets the flow regime, the area-Mach relation sizes the duct, shock relations tell you the losses, and the Prandtl-Meyer function tells you how far a convex corner can turn the flow before it separates. Together they form the backbone of compressible aerodynamics used from hypersonic re-entry vehicles down to the intake of a turbofan engine.