Gas from a stagnation chamber (p0, choked at the throat, M=1) accelerates through a converging-diverging duct. For isentropic flow the local Mach number M is fixed purely by the area ratio A/A*:
A/A* = (1/M) · [ (2/(γ+1))·(1+(γ-1)/2·M²) ]^((γ+1)/(2(γ-1)))
p/p0 = (1+(γ-1)/2·M²)^(-γ/(γ-1))
Each area ratio has two isentropic roots: a subsonic one and a supersonic one. Whether the nozzle runs subsonic, fully supersonic, or with a shock depends on the back pressure pb the exit must match:
- pb high — flow never reaches M=1; the whole duct behaves like a subsonic venturi.
- pb mid-range — the throat chokes and flow overshoots to supersonic, but a normal shock forms in the diverging section and jumps the flow back to subsonic so the exit pressure can rise to meet pb. The shock slides downstream as pb is lowered.
- pb low — the shock is pushed out of the nozzle entirely; the exit runs supersonic (over- or under-expanded, or perfectly expanded at one exact pb).
Across the shock, mass, momentum and energy conservation give the Rankine-Hugoniot normal-shock relations (M1 = upstream Mach, always >1):
M2² = [1+(γ-1)/2·M1²] / [γM1²-(γ-1)/2]
p2/p1 = 1 + 2γ/(γ+1)·(M1²-1)
p02/p01 = [(γ+1)M1² / ((γ-1)M1²+2)]^(γ/(γ-1)) · [(γ+1) / (2γM1²-(γ-1))]^(1/(γ-1))
The shock always jumps M > 1 down to M < 1 and raises static pressure — but it destroys some stagnation pressure (entropy rises), which is why the post-shock subsonic branch needs a smaller effective sonic area A2* to reach the required exit area ratio. The simulator solves for the shock position numerically each time you move a slider, matching the resulting exit pressure to your chosen pb/p0.
Real-world relevance: this exact mechanism sets rocket-nozzle and supersonic-wind-tunnel behavior at off-design altitude/back-pressure, and is why a rocket nozzle over-expanded at sea level can show a visible shock diamond pattern inside or just past the nozzle lip.