Compressible flow

Two numbers that do not change

One-dimensional unsteady gas flow carries two quantities that are exactly constant along two families of curves. That single fact turns a pair of coupled partial differential equations into a family of straight lines, and gives an exact speed at which a gas outruns its own expansion.

Worth reading first: Every compression becomes a shock in the end · What a signal travels at.

What a signal travels at establishes that disturbances in a gas move at the local sound speed relative to the fluid. This essay is about what rides along with them, which turns out to be exactly two numbers and to be the reason a whole class of unsteady problems can be solved on paper.

The invariants

For one-dimensional unsteady isentropic flow of a perfect gas, the equations of mass and momentum can be combined into

(t+(u±a)x)(u±2aγ1)=0.\left(\frac{\partial}{\partial t} + (u \pm a)\frac{\partial}{\partial x}\right) \left(u \pm \frac{2a}{\gamma-1}\right) = 0.

Read that as it stands: the quantity J±=u±2a/(γ1)J_\pm = u \pm 2a/(\gamma-1) has zero rate of change for an observer moving at u±au \pm a. So it is exactly constant along the curves dx/dt=u+adx/dt = u+a and dx/dt=uadx/dt = u-a, which are the two families of characteristics.

That is an identity satisfied by the equations, not an approximation valid for small disturbances, and everything below follows from it.

A simple wave, and why it is straight

A simple wave is a region reached by characteristics of one family from a uniform state. Every one of those characteristics carries the same value of its invariant, so throughout the region one invariant is a single number belonging to the whole flow.

One invariant constant through the wave, and one not. A centred expansion fan driven by a piston withdrawn at half the sound speed. Through the whole wave the C− invariant u − 2a/(gamma − 1) is the same number to four parts in 10¹⁶, and the C+ invariant varies by twenty per cent. That is what a simple wave is: a region reached by characteristics from a uniform state, in which one of the two invariants is a constant of the whole flow.
Fig. 1 The two invariants through a centred expansion fan.

Computed for a piston withdrawn at half the sound speed: JJ_- is the same to four parts in 101610^{16} across the whole wave, while J+J_+ varies by twenty per cent. The second is what carries the disturbance; the first is what makes the problem soluble.

The consequence is dramatic. With one invariant fixed, the state at any point depends on a single remaining quantity, so uu and aa are functions of one another, so u+au + a is a function of uu — and therefore constant along each characteristic of the other family, which makes those characteristics straight lines. A pair of coupled nonlinear partial differential equations has become a one-parameter family of straight lines whose slopes are read off the boundary.

The fan, as a function of one variable. Velocity and sound speed against x/t across the wave. Both are linear in the similarity variable — which is what makes a centred fan the simplest unsteady solution in gas dynamics — and the whole flow is a straight line between the undisturbed state at the head and the piston at the tail.
Fig. 2 The fan, as a function of one variable.

For a centred fan the construction is explicit. Two relations hold at once — u+a=x/tu + a = x/t from the characteristic through the origin, and u2a/(γ1)=2a0/(γ1)u - 2a/(\gamma-1) = -2a_0/(\gamma-1) from the undisturbed gas — which is two linear equations for two unknowns. Both uu and aa come out linear in x/tx/t.

And the field it produces solves the equations. Inside the fan two relations hold at once — the characteristic through the origin and the invariant from the undisturbed gas — which is two linear equations for the two unknowns, so the field is explicit. Substituting it back into Euler's equations leaves a residual of a part in ten million of the terms it is made of, which is the finite difference used to evaluate the derivatives.
Fig. 3 And the field that construction produces, substituted back into Euler’s equations.

The residual is a part in ten million of the terms it is made of, which is the finite difference used to evaluate the derivatives. The construction has not been checked against a numerical solution; it has been checked against the equations it claims to solve, which is better.

One sign error is worth recording because it produced a plausible answer. The gas lies to the right of the piston and the waves run right, so the characteristics carrying information from the undisturbed gas back into the wave are the CC_- family, and the constant is JJ_-. Using J+J_+ instead gives a=(J0u)(γ1)/2a = (J_0 - u)(\gamma-1)/2, which for a withdrawing piston makes the sound speed rise — an expansion that heats the gas, correct at u=0u = 0 and wrong at every other point, with nothing about the field looking odd.

What the two families mean

The two characteristic directions have a physical reading that makes the algebra feel less like a trick.

At any point in the gas, information travels in exactly three ways: with the fluid, at speed uu; and as sound, at u±au \pm a. The last two are the two characteristic families, and they are the only routes by which a disturbance somewhere else can reach here.

An invariant is what a messenger carries. J+J_+ is carried by the messengers travelling to the right and JJ_- by those travelling to the left, and the state at a point is decided by the two messages that arrive there — one from each side. Given the two invariants, uu and aa follow by solving two linear equations, so the point’s whole state is exactly the pair of messages it has received.

That is why the method works at a boundary and why it decides how many conditions a boundary may be given. At an outflow where the gas is leaving subsonically, one messenger is arriving from outside and one leaving, so exactly one condition may be imposed and the other quantity has to be whatever the interior sends out. At a supersonic outflow both messengers are leaving, so nothing may be imposed at all — and imposing something is the standard way to make a compressible code reflect waves off its own edge.

The same counting is what how many things a flow must be told is about in the incompressible case, where the answer is different because the signal speed is infinite.

The escape speed

Exactly five sound speeds, and the gas cannot follow. The sound speed at the tail of the fan, against how fast the piston is withdrawn. The C− invariant forces a = 0 at exactly u = −2a0/(gamma − 1), which for air is five times the undisturbed sound speed — so a piston pulled away faster than that leaves a vacuum behind it, and the gas expanding into it is doing the fastest thing it can do.
Fig. 4 The sound speed at the tail of the fan, against how fast the piston is withdrawn.

On the CC_- characteristic from the undisturbed gas, u2a/(γ1)=2a0/(γ1)u - 2a/(\gamma-1) = -2a_0/(\gamma-1). Set a=0a = 0 and the gas velocity is

uescape=2a0γ1,u_{\text{escape}} = -\frac{2a_0}{\gamma-1},

which for air is exactly five times the undisturbed sound speed. Pull the piston away faster than that and the gas cannot follow: a vacuum opens behind it, and the gas expanding into the vacuum is doing the fastest thing it knows how to do.

And it is a property of the gas, not of the piston. The escape speed in units of the undisturbed sound speed, against the ratio of specific heats. It is exactly 2/(gamma − 1): twenty for a nearly isothermal gas, five for air, three for a monatomic one, and two for shallow water — which is a gas of gamma two, and where the same number is the speed at which a dam break outruns its own front.
Fig. 5 And it is a property of the gas.

The number is 2/(γ1)2/(\gamma-1) and nothing else: twenty for a nearly isothermal gas, five for air, three for a monatomic one, and two for shallow water — which is a gas of γ=2\gamma = 2, and where the same number is the speed at which a dam break outruns its own front. It is one of the cleanest exact results in the subject, it takes one line to derive, and it puts an absolute ceiling on what an expansion can achieve.

Where the smooth solution ends

The other family of problems is a piston pushed into the gas, and there the straight lines converge.

A compression piston, and where its characteristics first cross. Sixty C+ characteristics from an accelerating piston, drawn in the distance-time plane. Each is a straight line, because the invariant makes the state along it constant; later ones are faster, because the gas ahead of them has been compressed; so they converge, and the first crossing is the shock. The envelope formula gives 2.7529 and the first actual crossing is at 2.7510.
Fig. 6 An accelerating compression piston, and where its characteristics first cross.

Each characteristic leaves the piston face at time τ\tau carrying the piston’s own velocity, and is straight from there with slope λ(τ)=up(τ)+a(τ)\lambda(\tau) = u_p(\tau) + a(\tau). A later one is faster, because the gas ahead of it has already been compressed and its sound speed raised, so it catches the earlier ones. Where two of them meet, the solution has become double-valued — and a double-valued solution is where a shock is.

The time is exact and needs no solving. Differentiating the family with respect to τ\tau gives the envelope:

ts=τ+a(τ)λ(τ),t_s = \tau + \frac{a(\tau)}{\lambda'(\tau)},

minimised over τ\tau. For a piston accelerating as 0.25t20.25t^2 this gives 2.7529, and the first actual crossing found by intersecting all pairs of lines is at 2.7510 — 0.07 per cent apart, the difference being the resolution of the family.

The formation time, against how hard the piston pushes. Shock formation happens at t = tau + a/lambda′ — an exact statement about when a smooth solution ceases to exist, obtained by differentiating a family of straight lines and without solving anything. A piston that accelerates twice as hard forms its shock about forty per cent sooner.
Fig. 7 The formation time, against how hard the piston pushes.

That is a statement about when a smooth solution ceases to exist, obtained by differentiating a family of straight lines. It is the same calculation as every compression becomes a shock in the end done for a piston rather than for a wave.

Reverse the piston and the family spreads instead. The gas behind each wave is cooler and slower, so later characteristics are slower than earlier ones, and no two of them ever meet. An expansion cannot steepen into a shock, which is the kinematic version of the asymmetry that the entropy states thermodynamically.

A number worth having: how long a fan takes to arrive

The method delivers small practical answers as well as large conceptual ones, and one of them is worth a paragraph because it is the sort of thing a design calculation needs.

Open a valve at the end of a pipe of gas at rest. The head of the expansion travels into the gas at a0a_0; the tail travels at up+apu_p + a_p, which for a withdrawal at half the sound speed is 0.50.4=0.10.5 - 0.4 = 0.1 of the original sound speed in the opposite direction. So the wave is not a front, it is a spreading region — after a time tt it occupies a length 1.1a0t1.1\,a_0 t — and a station at distance LL sees the pressure begin to fall at L/a0L/a_0 and finish falling much later.

That spreading is exactly what a shock does not do, and it is why a valve opening is a gentle event and a valve closing is a violent one. The site’s account of the violent case is stopping water costs more than moving it, where the same characteristic bookkeeping in a liquid gives Joukowsky’s pressure rise.

And where the invariants stop

Where the invariants stop, and by exactly the same cube. The fractional change in the C+ invariant across a normal shock, against its strength. A shock is not isentropic, so nothing is carried across it — and the amount by which the invariant fails to be carried is third order in the strength, with a measured exponent of 2.997. So a weak shock preserves the invariants to a very good approximation and preserves them exactly nowhere.
Fig. 8 The fractional change in an invariant across a shock, against its strength.

A shock is not isentropic, and the invariants were derived assuming isentropy — so nothing is carried across one. Evaluating J+J_+ on both sides of a normal shock in the shock frame, the fractional change goes as the cube of the strength, with a measured exponent of 2.997.

That is the same cube as the entropy’s, and for the same reason: a vanishing shock is a sound wave, a sound wave is isentropic, and the first two orders of the deviation cancel. So a weak shock preserves the invariants very well and preserves them exactly nowhere, which is what makes shock-capturing schemes based on characteristics work at all and what limits their accuracy.

Two numbers that do not change, as computed. The constancy of one invariant through a simple wave, the field's residual in Euler's equations, the escape speed, the shock-formation time, and the cube by which a shock breaks the invariants.
Fig. 9 The constancy, the residual, the escape speed, the formation time and the cube, as computed.

Why there are exactly two

The count is not an accident and it is worth naming, because it generalises.

A system of nn first-order partial differential equations in one space dimension is hyperbolic when its coefficient matrix has nn real eigenvalues, and each eigenvalue is a characteristic speed with its own invariant. Isentropic gas dynamics has two equations — mass and momentum, with the energy equation replaced by the isentropic relation — so it has two speeds and two invariants.

Put the energy equation back and there are three: u+au+a, uau-a and uu, the last being the particle path, along which the entropy is carried. That third family is why a flow containing shocks needs more bookkeeping: the entropy is no longer uniform, the isentropic relation between pp and ρ\rho no longer holds everywhere, and J±J_\pm stop being invariants of anything.

Shallow water has two as well, with aa replaced by gh\sqrt{gh} and γ\gamma effectively two — which is why a hydraulic jump is a shock and why every result in this essay has a water analogue. Magnetohydrodynamics has seven. The number of invariants is the number of ways information can travel, and it is a property of the equations rather than of the fluid.

Where the straight lines come from, said carefully

The claim that the characteristics of a simple wave are straight deserves more than an assertion, because it is the step that makes the whole method work.

Along a C+C_+ characteristic, J+J_+ is constant — that is the identity. In a simple wave JJ_- is also constant, but constant over the whole region rather than along one curve. So along a given C+C_+ characteristic both invariants are constant, and therefore uu and aa are individually constant, and therefore the characteristic’s own slope u+au + a is constant.

A curve whose slope does not change is a straight line. There is no approximation anywhere in that chain and no smallness assumed.

What makes it a method rather than an observation is that the slopes can be read off the boundary. Each C+C_+ characteristic leaves the piston at some time carrying the piston’s velocity, and the invariant fixes the sound speed from that velocity — so the slope is known before the line is drawn. The solution is then a ruler-and-pencil construction, and it was one for the first fifty years of the subject.

The construction fails exactly when two of the lines meet, which is the next section, and it also fails if the region is not reached from a uniform state — a wave reflected off a closed end, for instance, is not simple and its characteristics are curved. One diaphragm, every wave is the case where several simple regions meet and the interactions between them have to be worked out.

What the method is actually for

Three things, and the third is the one that gets forgotten.

Exact solutions of a nonlinear problem. A centred fan, a piston on any path, a shock tube’s expansion — all of them come out in closed form, and one diaphragm, every wave is what happens when several are put together.

Boundary conditions for a numerical scheme. At an open boundary, the number of conditions that may be imposed equals the number of characteristics entering the domain, and the quantities that must be left alone are the invariants leaving it. Getting that wrong is the commonest cause of a compressible code reflecting spurious waves off its own outflow.

And knowing when the smooth theory has stopped. The envelope formula gives a shock’s birth without any shock-capturing at all, which means a calculation can be checked against it — and a scheme that forms its shock at the wrong time is doing something visible.

What the escape speed is actually about

The five deserves a second look, because it is a limit on something rather than a value of something, and limits of that kind are rare enough to be worth reading carefully.

It says: no expansion, however violent, can accelerate a gas past 2a0/(γ1)2a_0/(\gamma-1). Not “no expansion anybody has built”, not “no expansion at ordinary pressures” — none, ever, within the model. The gas has a finite amount of internal energy per unit mass, a02/[γ(γ1)]a_0^2/[\gamma(\gamma-1)], and converting all of it to directed kinetic energy 12u2\tfrac12 u^2 gives exactly that speed. The invariant and the energy budget agree, which they must.

Two consequences follow that are not obvious from the derivation.

A rocket nozzle has a ceiling that has nothing to do with its shape. However long the expansion, however perfect the contour, the exit velocity cannot exceed 2a0/(γ1)2a_0/(\gamma-1) evaluated with the chamber’s sound speed — which is why nozzle design is about approaching a limit rather than about exceeding it, and why the chamber temperature, not the area ratio, is the quantity that actually buys performance.

And a gas with γ\gamma near one is far better at it. The escape speed diverges as γ1\gamma \to 1 because a gas with many internal degrees of freedom stores much more energy at the same sound speed. That is the argument for hydrogen and for high-molecular-complexity working fluids, and it is the one number that decides in a different chapter of the same subject.

The same structure with space in place of time

Everything above is unsteady and one-dimensional, and there is a second problem with the identical shape: steady and two-dimensional, above Mach one.

A steady supersonic flow is hyperbolic in the streamwise coordinate — the streamwise direction plays the role time played here — and its characteristics are the Mach lines. There are two families again, inclined at the Mach angle either side of the local flow direction, and each carries an invariant: the Prandtl–Meyer angle plus the flow direction on one family, minus it on the other. Two quantities constant along two families of curves, and a solution built by intersecting them.

That construction is how a supersonic nozzle contour is actually drawn, and it is the answer to a question the nozzle essay raises and leaves. Specify what is wanted at the exit — uniform, parallel, at the design Mach number — run the characteristics back upstream, and the wall is the streamline that cancels every wave arriving at it. A wall that does not cancel them reflects them, the exit flow is neither uniform nor parallel, and the divergence is thrust thrown away. A conical flare is exactly that compromise: simple to make, and reflecting everything it is sent.

The boundary counting carries over too, and gets simpler. At a supersonic inflow both messengers are entering, so everything may be imposed; at a supersonic outflow both are leaving, so nothing may be.

What is not claimed

One dimension, unsteady, perfect gas, isentropic. All four are needed for the invariants to exist in this form. In two dimensions the characteristics are surfaces and there are no Riemann invariants of this kind; with heat addition or friction the invariants pick up source terms and stop being invariant.

No entropy gradients. The derivation assumes the entropy is uniform, which is true ahead of the first shock and false behind it. A flow containing shocks has a third characteristic family — the particle paths, carrying entropy — and the two-invariant picture is a special case.

The envelope gives the first crossing, not the shock’s subsequent path. After formation the shock moves at a speed set by the Rankine–Hugoniot conditions rather than by the characteristics, and nothing here follows it.

The piston paths are chosen for the arithmetic. A constant withdrawal speed gives a centred fan and a quadratic acceleration gives a clean envelope; a real piston’s path is neither, and the method handles it at the cost of the closed forms.

And the fan’s residual is a finite-difference check. It confirms that the constructed field satisfies the equations to the accuracy of the differencing, which is a strong statement about the construction and not an independent derivation of it.

What links here

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

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.

CharacteristicsConservationDiscontinuityExact solutionExpansion fanIsentropicMeasurementPistonRiemann invariantsShock waveSimple waveSpeed of sound