Compressible flow

Energy instead of pressure

Bernoulli's equation is a statement that pressure and speed trade against each other at fixed density. Take the fixed density away and the trade is between heat and speed instead — and what survives is not a pressure at all.

Worth reading first: Where Bernoulli's equation applies · What a signal travels at.

Bernoulli’s equation is derived by integrating the momentum equation along a streamline, and the integration has a step in it that is easy to walk past: the density comes out of the integral.

dpρ    pρ\int \frac{\mathrm{d}p}{\rho} \;\longrightarrow\; \frac{p}{\rho}

That step is the incompressible assumption doing its work, and everything downstream of it inherits the assumption. Take a fluid whose density varies and the integral does not simplify — and the quantity that comes out the other side is not a pressure.

The energy is all there the whole way: enthalpy spent to buy speed. At each Mach number, the fraction of the stagnation enthalpy still held as heat and the fraction converted into directed motion. The two always sum to the total, which is the compressible replacement for Bernoulli's equation — an energy statement rather than a pressure one. At Mach 2 more than four fifths of the heat has become speed.
Fig. 1 The energy budget along an isentropic acceleration. At each Mach number, the fraction of the stagnation enthalpy still held as heat and the fraction converted into directed motion. The two always sum to the total, which is the line across the top. At Mach 2 more than four fifths of the gas’s heat has become speed.

What is actually conserved

For a steady, adiabatic flow of a gas — with or without friction, with or without shocks — the energy equation along a streamline says

h+12u2=h0=constanth + \tfrac{1}{2}u^2 = h_0 = \text{constant}

where hh is the enthalpy, cpTc_p T for a perfect gas. The constant h0h_0 is the stagnation enthalpy: the enthalpy the gas would have if it were brought to rest.

Notice what this does and does not require. It requires that no heat is added and no work is done. It does not require that the process is reversible, frictionless, or free of shocks. Enthalpy plus kinetic energy is conserved through a shock, through a boundary layer, through a rough pipe. That is much stronger than Bernoulli’s constant, which fails in every one of those places.

Since h=cpTh = c_p T, an equivalent and more useful statement is that the stagnation temperature is constant:

T0=T(1+γ12M2)T_0 = T\left(1 + \frac{\gamma - 1}{2}M^2\right)

Total temperature is the robust invariant of compressible flow. Total pressure is the fragile one.

The two totals behave completely differently

This is the distinction the whole field turns on, and it does not exist in the incompressible version, where the two are the same statement.

What an isentropic acceleration does to pressure, density and temperature. The three state ratios along an isentropic acceleration from rest, against Mach number. Pressure falls fastest, density next, temperature slowest — and the ordering is fixed by the exponents rather than being a property of any particular flow. By Mach 2 the pressure is an eighth of its stagnation value and the temperature is just over half of it.
Fig. 2 Pressure, density and temperature as fractions of their stagnation values, along an isentropic acceleration. The three curves are the same relation raised to three different exponents — 1 for temperature, 2.5 for density, 3.5 for pressure — so they cannot cross and their order is fixed.

Stagnation temperature is conserved by the energy equation. Nothing but heat transfer or shaft work can change it. A gas that shocks, separates, scrubs along a wall and shocks again arrives with exactly the stagnation temperature it started with.

Stagnation pressure is conserved only if the process is reversible. It is a measure of how much of the energy is still available as ordered motion, and every irreversible thing that happens destroys some. Friction destroys it. Shocks destroy it — 27.9 per cent of it at Mach 2, and 93.8 per cent at Mach 5.

An engine designer thinks in exactly these terms: the total temperature is the fuel’s contribution and the total pressure is what the machine has left to work with. The two quantities are conflated in incompressible flow because there p0=p+12ρU2p_0 = p + \frac{1}{2}\rho U^2 and there is only one of them.

That figure is the cleanest statement of the difference. Two totals, one process, and one of them survives it.

How much density change the incompressible assumption is ignoring. The density and pressure at a stagnation point, as percentages above their free-stream values, against Mach number. The conventional threshold at Mach 0.3 is where the density change reaches about five per cent — a convention rather than a boundary. Nothing happens there; the error simply stops being negligible.
Fig. 3 How much of the exchange the incompressible form is throwing away. The density and pressure at a stagnation point, as percentages above the free stream, against Mach number: the familiar 0.3 is where the density change reaches about five per cent, which is a convention rather than a boundary. Nothing happens there; the error simply stops being ignorable.

The stagnation state is a state, not a place

A persistent source of confusion is worth clearing up before the relations get used, because it causes real errors rather than merely muddle.

The stagnation state is not the state at some particular point in the flow. It is the state the gas would reach if it were brought to rest isentropically from wherever it currently is — a reference condition attached to each parcel, computable from that parcel’s own pressure, density and speed.

A flow with no stagnation point anywhere in it still has a stagnation pressure at every point of it. A flow with a stagnation point has, at that point, a static pressure equal to the stagnation pressure, which is where the name comes from and where the confusion starts.

The practical consequence: in an isentropic flow the stagnation state is the same everywhere, so it can be used as a datum and every ratio referred to it. That is why the tables in this field are tabulated against stagnation values, and why the moment a shock appears the tables have to be restarted — the datum itself has moved, and only downstream of the shock.

Why the incompressible form fails, precisely

The failure is not a matter of degree, and it is worth seeing why the obvious repair does not work.

The obvious repair is to keep writing p+12ρU2p + \frac{1}{2}\rho U^2 and use the local density at each point. This is wrong, and the reason is structural rather than numerical: ρ\rho was removed from an integral, so the answer depends on the whole path and not on the endpoints, and substituting a local value at each end does not recover the missing integral.

Expanding the exact result shows what the incompressible expression actually is:

p0p=12ρU2(1+M24+M440+)p_0 - p = \tfrac{1}{2}\rho U^2\left(1 + \frac{M^2}{4} + \frac{M^4}{40} + \cdots\right)

so 12ρU2\frac{1}{2}\rho U^2 is the leading term of a series and every correction is positive. The incompressible form is not an approximation that happens to be low; it is the first term of an expansion that the flow keeps adding to.

What an isentropic acceleration does to pressure, density and temperature. The three state ratios along an isentropic acceleration from rest, against Mach number. Pressure falls fastest, density next, temperature slowest — and the ordering is fixed by the exponents rather than being a property of any particular flow. By Mach 2 the pressure is an eighth of its stagnation value and the temperature is just over half of it.
Fig. 4 The same three ratios taken to Mach 5. Pressure falls fastest, density next, temperature slowest, and the ordering is fixed by the exponents rather than by any property of a particular flow — by Mach 2 the pressure is an eighth of its stagnation value, and there is nothing on any of the three curves that marks a transition.

Where the exchange goes, and how far

The bars in the first figure are the working content of this essay, and the numbers on them are worth reading.

At Mach 0.5 the gas has given up 4.8 per cent of its enthalpy to motion. At Mach 1, 16.7 per cent. At Mach 2, 55.6 per cent. At Mach 3, 64.3 per cent — and by Mach 5, 83.3.

The interesting feature is the shape rather than any one value. The conversion is quadratic at low Mach numbers and saturating at high ones, because T/T0=(1+γ12M2)1T/T_0 = (1 + \frac{\gamma-1}{2}M^2)^{-1} has an asymptote: the gas can give up all of its enthalpy, and no more, so there is a maximum speed a given stagnation state can reach. For air at 288.15 K it is

umax=2cpT0=2γRT0γ1=760.9 m/su_{\max} = \sqrt{2 c_p T_0} = \sqrt{\frac{2\gamma R T_0}{\gamma - 1}} = 760.9\ \text{m/s}

at which point the gas is at absolute zero and has nothing left to spend. That is a real limit on a nozzle, and it is why rocket exhaust velocity depends on chamber temperature and on the molecular weight of the products and on almost nothing else.

The one that follows from having a limit

The saturation has a consequence that is not obvious until it is stated: the speed of sound falls as the flow accelerates, so the Mach number climbs faster than the speed does.

At Mach 1 the local temperature is T0/1.2T_0/1.2, so the local speed of sound is a0/1.2=0.913a0a_0/\sqrt{1.2} = 0.913 a_0. At Mach 2 it is 0.745a00.745 a_0; at Mach 3, 0.535a00.535 a_0. A stream tube accelerating from rest reaches Mach 1 at 91.3 per cent of the stagnation speed of sound, not at 100 per cent of it.

This is the mechanism behind an oddity in the nozzle essays: the flow reaches sonic conditions sooner than the arithmetic of speed alone would suggest, because the target is moving down to meet it. The throat of a nozzle is where the two curves cross, and both of them are moving.

When Bernoulli is still exactly right

The compressible form does not throw the old one away, and it is worth being precise about what survives.

Along a streamline in a steady, adiabatic, isentropic flow, the compressible relation can be integrated in closed form and gives

γγ1pρ+12u2=constant\frac{\gamma}{\gamma-1}\frac{p}{\rho} + \frac{1}{2}u^2 = \text{constant}

which is a genuine Bernoulli equation with γγ1pρ\frac{\gamma}{\gamma-1}\frac{p}{\rho} in place of p/ρp/\rho. It reduces to the familiar form as M0M \to 0, and it holds exactly at any Mach number so long as no entropy is produced.

So the honest summary is that Bernoulli’s method survives and Bernoulli’s quantity does not. The integral along a streamline still gives a constant; the constant is an energy, and the incompressible expression is what that energy looks like when density has been pulled out of the integral.

The connection nobody expects: entropy makes vorticity

Here is a result that ties this field to one that appears to have nothing to do with it.

Crocco’s relation, obtained by combining the momentum equation with the second law, says that for steady flow

Ts=h0u×ωT\,\nabla s = \nabla h_0 - \mathbf{u} \times \boldsymbol{\omega}

Read it with the two gradients set to zero. If the stagnation enthalpy is uniform — which the energy equation guarantees for an adiabatic flow from a uniform reservoir — and the entropy is uniform too, then u×ω=0\mathbf{u} \times \boldsymbol{\omega} = 0 and the flow is irrotational.

That is the justification for the whole of ideal-flow theory, arriving from thermodynamics rather than from kinematics. A uniform stream is irrotational; nothing in it produces entropy; therefore it stays irrotational, and a velocity potential exists.

Now run it the other way. A curved shock produces a different entropy rise on every streamline that crosses it, because each streamline meets it at a different angle and therefore at a different normal Mach number. So s0\nabla s \neq 0 behind a curved shock, and the flow behind it is rotational — with vorticity generated by the shock, in a fluid that has no viscosity at all.

Past 23.0° at Mach 2.00 there is no attached shock. The same wedge at two half-angles. On the left the θ–β–M relation has a root and the shock sits on the nose. On the right it has none, and the solver throws rather than returning the nearest thing — which matters, because a solver that quietly clamped to the maximum would draw a neat attached shock on a body that cannot carry one. The bow shock on the right is indicative: its shape is not solved here.
Fig. 5 On the right, the bow shock a blunt or over-turned body carries. It is curved, so each streamline crosses it at a different angle and emerges with a different entropy — which by Crocco’s relation means the flow behind it carries vorticity. An inviscid flow that is not irrotational, produced by a shock rather than by a wall.

This is why blunt-body supersonic flow cannot be attacked with a velocity potential and why it needed computers. It is also a rare thing on this site: a mechanism for making vorticity that is not viscosity at a wall.

What the solver computes, and how it is checked

The state ratios are closed form, so the check has to be aimed at whether they are consistent rather than whether they converged.

assertIsentropicConsistent takes the ratios at a Mach number and verifies two independent things that were not used to produce them. The first is that p/ργp/\rho^\gamma is identical at the static and stagnation states, which is the definition of isentropic and involves the pressure and density exponents in combination. The second is that h+u2/2h + u^2/2 evaluates to the same number at both, which is the energy equation and involves the temperature ratio and the Mach number. Both agree to within 101010^{-10} at every Mach number drawn on this site, and the assertion runs before the bars in the first figure are laid out.

The rejection test is the interesting half. It feeds the assertion a set of relations carrying the most plausible error available: the density ratio given the pressure exponent, γ/(γ1)\gamma/(\gamma-1) where 1/(γ1)1/(\gamma-1) belongs. That produces a table which is smooth, monotone and entirely ordinary-looking, and which violates the energy equation at every row. The check refuses it, which means the check is measuring the physics rather than the arithmetic.

A dimensionless reading of the same statement

There is a way of writing the energy equation that makes its content obvious, and it is the form used whenever a nozzle or an intake is being sized.

Divide through by h0h_0 and everything becomes a function of Mach number alone:

TT0=(1+γ12M2)1,u2/2h0=γ12M21+γ12M2\frac{T}{T_0} = \left(1 + \frac{\gamma-1}{2}M^2\right)^{-1}, \qquad \frac{u^2/2}{h_0} = \frac{\frac{\gamma-1}{2}M^2}{1 + \frac{\gamma-1}{2}M^2}

The two add to one, which is the bar chart. But notice what has disappeared: the actual temperature, the actual pressure, the actual speed, and the gas’s identity apart from γ\gamma. Two flows at the same Mach number have the same proportions however different their absolute conditions, which is the compressible analogue of dynamic similarity at fixed Reynolds number and is why a wind tunnel can be run at reduced total temperature and still say something about full-scale flight.

It is also why the tables in this subject are one-dimensional. A single column indexed by Mach number carries every ratio anyone needs, for any gas with γ=1.4\gamma = 1.4, at any scale. Very little else in fluid mechanics collapses that far — and the reason it collapses here is that the density has stopped being an independent constant and become a function of the same one variable as everything else.

One area ratio, two Mach numbers — and the minimum is at Mach one. The area a stream tube must have, relative to the area it would have where it is sonic, against Mach number. The curve has its minimum at Mach one and rises on both sides, so a given area is satisfied by one subsonic and one supersonic solution. Nothing local to the station decides which of the two the flow is on.
Fig. 6 What the same conservation buys when it is asked about geometry rather than about speed. The area a stream tube must have, relative to its sonic area, has a minimum at Mach one and rises on both sides — so one area is satisfied by one subsonic and one supersonic state, and nothing local to the station decides which. The energy statement fixes the pair and not the choice.

The invariant inside a rotor

The energy equation’s hypothesis is that no work is done, and a compressor rotor is a machine for doing work. It looks as though the whole apparatus has to be abandoned inside one, and it does not: the invariant is replaced by a slightly different one, and the replacement is what every turbomachine is designed with.

Move into the frame rotating with the blades. The flow there is steady, which is the property the stationary frame has lost, and the blades do no work at all, because in their own frame they are not moving. What has appeared instead is the centrifugal force — and it is conservative, with potential 12Ω2r2-\tfrac12\Omega^2r^2, so it can be absorbed into the constant exactly as gravity is absorbed into a head. What survives is

I=h+12W212U2,I = h + \tfrac12 W^2 - \tfrac12 U^2,

with WW the relative velocity and U=ΩrU = \Omega r the local blade speed. It is called the rothalpy, it is constant along a streamline through the rotor, and it inherits the robustness of the quantity it generalises: like the stagnation enthalpy in a stationary duct, it survives friction and it survives shocks, which matters because a transonic compressor rotor has shocks standing in its passages as a matter of design.

The pay-off is that Euler’s equation falls out in one line. Write the rothalpy at inlet and outlet, use W2=V22UVθ+U2W^2 = V^2 - 2UV_\theta + U^2 to eliminate the relative speed, and subtract:

h02h01=U2Vθ2U1Vθ1.h_{02} - h_{01} = U_2 V_{\theta 2} - U_1 V_{\theta 1}.

Which is exactly the work a change of swirl is worth, obtained from an energy statement rather than from an angular-momentum one — and the three-term kinematic identity that essay checks against is this same substitution, written without the cancellation.

So the field’s two invariants are one invariant with a rotating frame in it. Stagnation enthalpy is what a flow conserves when nobody is doing work on it; rothalpy is what it conserves when the work is being done by something whose frame is available.

Where the model stops

Three boundaries, in increasing order of how often they bite.

Adiabatic is an assumption. Everything here requires no heat crossing the streamtube walls. A combustor is not adiabatic, and neither is a hypersonic vehicle’s boundary layer, where the heat transfer to the wall is the design problem.

Calorically perfect is an assumption. h=cpTh = c_p T with a constant cpc_p fails above roughly 600 K, where vibrational modes start absorbing energy. Since T0/TT_0/T at Mach 3 is 2.8, a stagnation temperature of 288 K corresponds to a stagnation state of 806 K, and the constant-cpc_p assumption is already suspect. This site does not draw above Mach 5 for that reason.

One-dimensional is an assumption. The energy equation applies along a streamline. Different streamlines can carry different stagnation enthalpies, and in a flow with heat addition or a rotating machine in it they generally do.

What the picture cannot show

The bar figure is a picture of an exchange, and the thing it cannot show is that the exchange is reversible.

Every bar in it could be read right to left as easily as left to right, and the isentropic relations are indifferent: a gas can be accelerated from Mach 0 to Mach 3 and decelerated back with every quantity retracing its path exactly. Nothing in the figure says which direction time runs.

That indifference is exactly what breaks at a shock, and it cannot be drawn either — entropy is the one quantity in this subject that has no picture. The figure is honest about isentropic flow and silent about everything else, which is why the caption names the hypothesis.

Who found it, and when

Bernoulli published in 1738, in a Hydrodynamica that predates the momentum equation his result is now derived from; the derivation used here is Euler’s, from twenty years later.

The compressible form belongs to the nineteenth century’s thermodynamics rather than to fluid mechanics. Once enthalpy existed as a concept — a state function combining internal energy with the work of displacement — the steady-flow energy equation was a short step, and it arrived through engineering thermodynamics for steam plant rather than through aerodynamics. That is why the vocabulary of compressible aerodynamics is a thermodynamicist’s: stagnation enthalpy, total temperature, entropy rise, availability.

Where the ladder goes next

Energy is the conserved thing, and a duct is a device for converting between its two forms. Once density is a variable, a duct does something to a supersonic flow that is precisely the reverse of what it does to a subsonic one, and the reason is in the exchange described here.

The other direction is the instrument. If the stagnation pressure a pitot tube reads is not 12ρU2\frac{1}{2}\rho U^2 above the static pressure, then everything an airspeed indicator says needs correcting — and the correction is exactly the series in this essay.

What links here

Computed from the collection rather than written here: the essays that point at this one.

Reads more easily once this is understood

Essays that name this one as worth reading first.

Shares its objects with

Essays naming at least two of the same things, that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

AdiabaticBernoulli's equationEnergy equationEntropyIsentropicMach numberThe second law of thermodynamicsStagnation enthalpyStagnation temperatureTotal pressure