Flow Lab

Syllabus / Module 11: Fluid Dynamics: Navier–Stokes and Beyond

Lesson 11.12

Compressible Flow & Shocks

Compressible Euler equations, speed of sound, Mach number, normal shocks, the shock tube (Sod problem) and Riemann solvers.

Written byClaude Opus

🌊
Why this matters for simulation: Supersonic flight and sonic booms.

By the end of this lesson you can…

  • Write the compressible Euler equations in conservation form with the ideal-gas law, and derive the speed of sound $c = \sqrt{\gamma p/\rho}$ by linearizing them.
  • Use the Mach number to judge when incompressible flow is good enough, and explain the supersonic pocket on a Mach 0.85 wing.
  • Explain why compressions steepen into shocks, derive the Rankine–Hugoniot conditions, and show with the second law that shocks only compress.
  • Solve the Sod shock tube exactly with Newton's method, and simulate it with Rusanov and HLL finite-volume fluxes under a CFL limit set by $|u| + c$.
  • Measure shock width and $L^1$ error against resolution, and explain why the observed order is below one.
On this page
·
  1. Energy and the equation of state
  2. The speed of sound
  3. Mach number: when density matters
  4. Why shocks form
  5. Jump conditions and normal shocks
  6. The shock tube
  7. Finite volumes, Rusanov and HLL
  8. What resolution buys
  9. Computing it
  10. Concept checks
  11. Problems
  12. Key Takeaways

Last lesson’s solver leaned on one assumption from start to finish: the air’s density never changes. That made the pressure an instant multiplier: one Poisson solve per step, and every cell knew at once what every other cell did. Physically, the speed of sound was infinite. It is not. It is about 340340 m/s at sea level, and an airliner cruises at Mach 0.850.85. Let the density vary and the air gets a finite speed of sound, a Mach number, and shock waves: the other half of aviation. The numerics change too: no pressure solve, but fluxes of mass, momentum and energy through cell faces, with a time step set by how fast sound crosses a cell.

Tools: 11.3 Momentum: Pressure & the Euler Equations, 11.2 Conservation of Mass: The Continuity Equation, 11.9 Turbulence: An Introduction (numerical viscosity), 11.11 Stam's Stable Fluids, Step by Step and 4.5 Stability Regions & Stiffness.

▶ Video A diaphragm bursts in a shock tube: a rarefaction fan runs left, a contact surface and a shock run right, and a finite-volume solver captures all three with fluxes through cell facescaptions only
Transcript
  1. Last lesson's solver assumed the density never changes. That made pressure an instant multiplier, and the speed of sound infinite. Let the density vary, and the air gets a finite speed of sound, 340.3 metres per second at sea level, a Mach number, and shock waves: the other half of aviation.
  2. The Mach number is speed over the speed of sound. A light aircraft at 50 metres per second is Mach 0.1469, and the air ahead of it is only 1.07 percent less dense: incompressible flow is fine. A jet at Mach 0.85 is different. Over the wing, at an illustrative 1.3 times flight speed, the local Mach number reaches 1.165: a supersonic pocket, ending in a shock.
  3. To follow it, write the equations in conservation form: density, momentum and energy, each changing only by the flux through a face. Small changes then travel at three speeds, the eigenvalues of the flux Jacobian: u minus c, u, and u plus c. In the shocked gas of the shock tube, the fastest is 2.1916. Every scheme, and its time step, comes back to these speeds.
  4. Why do shocks form? Take Burgers' equation, where each value travels at its own speed. Characteristics are straight lines, and where the profile falls, they converge. For u zero equal to sine x, they first cross at t equals 1, at x equals pi. After that a smooth solution would be three-valued, so the wave becomes a jump.
  5. Across a normal shock at Mach 2, the jump conditions give pressure 4.5 times higher, density 2.6667 times, a downstream Mach number of 0.5774, and a temperature ratio of 1.6875. Entropy rises by 0.1309 c v. Try Mach 0.5, an expansion shock: pressure would fall to 0.125, and entropy by 0.3256. With no heat exchange, the second law forbids that. Shocks only compress, and the lost energy is wave drag.
  6. Now the test. Sod's shock tube: density 1 and pressure 1 on the left, density 0.125 and pressure 0.1 on the right, a diaphragm in the middle. Burst it, and three waves leave: a rarefaction fan runs left, a contact surface and a shock run right. Newton's method gives the star pressure 0.30313 and velocity 0.92745. At t equals 0.2, the fan spans 0.2634 to 0.4859, the contact sits at 0.6855, the shock at 0.8504.
  7. Now race two finite-volume schemes against it, on 200 cells. Rusanov adds diffusion sized by the fastest signal. HLL uses two wave speeds and adds less. Both are conservative: mass and energy are kept to round-off. The density error at t equals 0.2: 0.01530 for Rusanov, 0.01023 for HLL.
  8. Refine the grid and the error should halve each time. It does not. The observed order is about 0.6, not 1. The shock stays only 2 to 3 cells wide, because characteristics run into it from both sides. The contact has nothing to resharpen it: its width grows from 16 cells at 100 to 45 at 800, and its error shrinks only like the square root of the cell size.
  9. The time step is limited too. The CFL number says how many cells the fastest signal may cross per step. At 200 cells, Rusanov runs at 1.0 but blows up at 1.1, after 14 steps. HLL survives 1.1 and blows up at 1.2, after 11. For the light aircraft, u plus c is 390.3 against 50, so a compressible solver takes 7.8 times smaller steps.
  10. Next, 11.13. Everything so far solved a PDE on a grid. Particle and lattice Boltzmann methods compute a fluid by moving and colliding particles, with no grid-based PDE at all. After that, Module 12 takes all of it into flight.

Energy and the equation of state

Once density varies, 11.3’s Euler equations need an energy equation and a law tying pressure to density and temperature. In one dimension (a shock tube, or air crossing a shock head-on) the compressible Euler equations in conservation form are

∂∂t(ρρuE)+∂∂x(ρuρu2+pu(E+p))=0,E=pγ−1+12ρu2.\frac{\partial}{\partial t}\begin{pmatrix}\rho\\ \rho u\\ E\end{pmatrix} + \frac{\partial}{\partial x}\begin{pmatrix}\rho u\\ \rho u^2 + p\\ u(E + p)\end{pmatrix} = 0, \qquad E = \frac{p}{\gamma - 1} + \frac12\rho u^2 .

Each row is 11.2’s control-volume balance: mass; momentum, carried through a face as ρu⋅u\rho u\cdot u plus the pressure pushing on it; and total energy per unit volume EE, internal plus kinetic, carried at uEuE plus the pressure’s work pupu.

The closure is the ideal gas: p=ρRTp = \rho RT with R=287R = 287 J/(kg K) for air, and internal energy per unit mass e=cvT=p/((γ−1)ρ)e = c_vT = p/((\gamma - 1)\rho), with γ=cp/cv=1.4\gamma = c_p/c_v = 1.4 for air (from memory). Hence the p/(γ−1)p/(\gamma-1) in EE. With U=(ρ,ρu,E)U = (\rho, \rho u, E) and flux F(U)F(U) the system is Ut+F(U)x=0U_t + F(U)_x = 0.

The speed of sound

Put a small disturbance on air at rest: ρ=ρ0+ρ′\rho = \rho_0 + \rho', p=p0+p′p = p_0 + p', velocity u′u', and drop products of small terms. Mass and momentum become

ρt′+ρ0 ux′=0,ρ0 ut′+px′=0.\rho'_t + \rho_0\,u'_x = 0, \qquad \rho_0\,u'_t + p'_x = 0 .

A sound wave is too fast for heat to flow between neighbouring parcels and too gentle to form shocks, so it is isentropic: p∝ργp \propto \rho^\gamma (the adiabatic law, which the energy equation gives for smooth flow; from memory). Then p′=(γp0/ρ0) ρ′p' = (\gamma p_0/\rho_0)\,\rho'. Differentiate the first equation in tt, the second in xx, and subtract:

ρtt′=γp0ρ0 ρxx′,c=γpρ=γRT.\rho'_{tt} = \frac{\gamma p_0}{\rho_0}\,\rho'_{xx}, \qquad c = \sqrt{\frac{\gamma p}{\rho}} = \sqrt{\gamma RT} .

A wave equation: sound travels at cc. At sea level, p=101325p = 101325 Pa and ρ=1.225\rho = 1.225 kg/m3^3 give c=340.3c = 340.3 m/s (lab block A). Incompressible flow forces ρ′=0\rho' = 0 for any p′p': cc is infinite, which is why 11.10’s pressure came from a Poisson equation.

Three signals. In moving air the sound is carried along. A disturbance spreads right at u+cu + c and left at u−cu - c, and a third kind of signal, a hot or dense spot with no pressure difference, simply drifts with the gas at uu. These are the eigenvalues of the flux Jacobian ∂F/∂U\partial F/\partial U, the matrix saying how a small change of state changes the flux; its eigenvalues are the speeds at which small changes travel (from memory as a general fact; at rest we derived ±c\pm c). Lab block E builds the matrix numerically for the shock tube’s shocked gas and finds u−cu - c, uu, u+cu + c to about 10−710^{-7}. Every scheme below, and its time step, comes back to these speeds.

Mach number: when density matters

The Mach number is M=∣u∣/cM = |u|/c. For steady flow without heat exchange the energy equation along a streamline says h+12u2h + \frac12u^2 stays constant, with enthalpy h=cpT=c2/(γ−1)h = c_pT = c^2/(\gamma - 1). Divide by c2/(γ−1)c^2/(\gamma - 1):

T0T=1+γ−12M2,ρ0ρ=(1+γ−12M2)1/(γ−1)=(1+0.2M2)2.5,\frac{T_0}{T} = 1 + \frac{\gamma - 1}{2}M^2, \qquad \frac{\rho_0}{\rho} = \Big(1 + \frac{\gamma - 1}{2}M^2\Big)^{1/(\gamma-1)} = (1 + 0.2M^2)^{2.5},

where subscript 00 means brought to rest, and the second form uses the isentropic ρ∝T1/(γ−1)\rho \propto T^{1/(\gamma-1)}. This is the relation 11.2 quoted.

  • A light aircraft at 5050 m/s: M=0.1469M = 0.1469. The oncoming air is 1.07%1.07\% less dense than air brought to rest on its nose (lab A). Bernoulli’s estimate agrees: the pressure rise 12ρu2\frac12\rho u^2 changes the density by Δp/c2\Delta p/c^2, so Δρ/ρ=M2/2=1.08%\Delta\rho/\rho = M^2/2 = 1.08\%. Incompressible flow is fine.
  • A jet at Mach 0.85 at 1111 km, where T=216.65T = 216.65 K (standard atmosphere, from memory): c=γRT=295.0c = \sqrt{\gamma RT} = 295.0 m/s and the airspeed is 250.8250.8 m/s. Suppose the air over the wing’s suction peak reaches 1.31.3 times flight speed (an illustrative figure). It cools as it speeds up: T/T∞=1−0.2M∞2(1.32−1)=0.9003T/T_\infty = 1 - 0.2M_\infty^2(1.3^2 - 1) = 0.9003, so cc drops too and the local Mach number is 0.85×1.3/0.9003=1.1650.85\times1.3/\sqrt{0.9003} = 1.165. A pocket of supersonic air sits on a subsonic aircraft, and it ends in a shock. That is transonic flight, roughly 0.8<M<1.20.8 \lt M \lt 1.2 (from memory).

The Prandtl–Glauert factor 1/1−M21/\sqrt{1 - M^2} (from memory) scales small-disturbance pressure coefficients from incompressible values: 1.0481.048 at M=0.3M = 0.3, 1.1551.155 at 0.50.5, 1.4001.400 at 0.70.7, 1.8981.898 at 0.850.85 (lab A). Its blow-up at M=1M = 1 marks where linear theory fails.

Why shocks form

Take the simplest nonlinear wave equation, Burgers’ ut+u ux=0u_t + u\,u_x = 0: each value of uu travels at speed uu. Along a curve dx/dt=udx/dt = u, du/dt=ut+u ux=0du/dt = u_t + u\,u_x = 0, so the characteristics are straight lines x=x0+t u0(x0)x = x_0 + t\,u_0(x_0). Where u0u_0 decreases, fast fluid sits behind slow fluid and the lines converge. Two neighbours x0x_0 and x0+δx_0 + \delta meet when 1+t u0′(x0)=01 + t\,u_0'(x_0) = 0, first at

tb=1max⁡(−u0′).t_b = \frac{1}{\max(-u_0')} .

For u0=sin⁡xu_0 = \sin x, tb=1t_b = 1: lab block D finds the characteristic map still increasing at t=0.99t = 0.99 and folded at t=1.01t = 1.01. After that a smooth solution would have to be three-valued, so the wave becomes a jump.

Air does the same: in a compression uu rises and adiabatic heating raises cc, so the back of a pulse outruns its front. For a simple wave the signal speed is c0+γ+12uc_0 + \frac{\gamma + 1}{2}u (from memory). Weak sound is damped by viscosity before it breaks; a strong pulse, like the air piled up ahead of a supersonic nose, breaks quickly. Expansions do the opposite: their characteristics fan apart, and they spread smoothly into a rarefaction.

Jump conditions and normal shocks

A jump at x=s(t)x = s(t) has no derivatives, but the integral law survives. Over [a,b][a, b] containing it,

ddt∫abU dx=F(U(a))−F(U(b)).\frac{d}{dt}\int_a^b U\,dx = F(U(a)) - F(U(b)).

Split the integral at ss; differentiating the two pieces gives s˙ (UL−UR)\dot s\,(U_L - U_R) from the moving limits plus integrals of UtU_t, which vanish as aa and bb close in on ss. What remains is the Rankine–Hugoniot condition

s˙ (UR−UL)=F(UR)−F(UL),\dot s\,(U_R - U_L) = F(U_R) - F(U_L),

one per conserved quantity. For Burgers, F=u2/2F = u^2/2 gives s˙=(uL+uR)/2\dot s = (u_L + u_R)/2.

In the frame moving with a normal shock, s˙=0\dot s = 0: mass flux ρu\rho u, momentum flux ρu2+p\rho u^2 + p and h+12u2h + \frac12u^2 are equal on both sides. Solving these three for the downstream state gives the normal-shock relations (stated, not derived here):

p2p1=1+2γγ+1(M12−1),ρ2ρ1=(γ+1)M12(γ−1)M12+2,M22=1+γ−12M12γM12−γ−12.\frac{p_2}{p_1} = 1 + \frac{2\gamma}{\gamma + 1}(M_1^2 - 1), \quad \frac{\rho_2}{\rho_1} = \frac{(\gamma + 1)M_1^2}{(\gamma - 1)M_1^2 + 2}, \quad M_2^2 = \frac{1 + \frac{\gamma - 1}{2}M_1^2}{\gamma M_1^2 - \frac{\gamma - 1}{2}} .

At M1=2M_1 = 2: p2/p1=4.5p_2/p_1 = 4.5, ρ2/ρ1=2.6667\rho_2/\rho_1 = 2.6667, M2=0.5774M_2 = 0.5774, T2/T1=4.5/2.6667=1.6875T_2/T_1 = 4.5/2.6667 = 1.6875. Lab block B puts these back into the three jump conditions and gets residuals at round-off.

Why only compressions. Plug in M1=0.5M_1 = 0.5: an “expansion shock” with p2/p1=0.125p_2/p_1 = 0.125. The entropy change of an ideal gas is s2−s1=cvln⁡[(p2/p1)(ρ1/ρ2)γ]s_2 - s_1 = c_v\ln\big[(p_2/p_1)(\rho_1/\rho_2)^\gamma\big]. At M1=2M_1 = 2 it is +0.1309 cv+0.1309\,c_v; at M1=0.5M_1 = 0.5 it is −0.3256 cv-0.3256\,c_v. Gas crossing a shock exchanges no heat, so the second law forbids that fall. Shocks only compress: supersonic air enters, subsonic air leaves, and the characteristics of both sides run into the shock (the Lax entropy condition, from memory), which keeps it sharp. The entropy rise is energy turned into heat that the flow never gets back, and on an aircraft that loss is wave drag.

The shock tube

Sod’s problem (1978, from memory) is a tube on 0≤x≤10 \le x \le 1 with a diaphragm at x=0.5x = 0.5: (ρ,u,p)=(1,0,1)(\rho, u, p) = (1, 0, 1) on the left, (0.125,0,0.1)(0.125, 0, 0.1) on the right, dimensionless, γ=1.4\gamma = 1.4. Burst the diaphragm and one wave leaves along each signal speed: a rarefaction runs left (the u−cu - c family), a contact where the two original gases meet rides at uu, and a shock runs right (u+cu + c). Between them is a star region with one pressure p∗p^* and one velocity u∗u^*, but two densities.

To find p∗p^*, write uu behind each wave as a function of the pressure there. Behind the left rarefaction, u=2cLγ−1(1−(p/pL)(γ−1)/2γ)u = \frac{2c_L}{\gamma - 1}\big(1 - (p/p_L)^{(\gamma-1)/2\gamma}\big) (a Riemann invariant, from memory). Behind the right shock, the jump conditions give u=(p−pR)AR/(p+BR)u = (p - p_R)\sqrt{A_R/(p + B_R)} with AR=2/((γ+1)ρR)A_R = 2/((\gamma + 1)\rho_R), BR=γ−1γ+1pRB_R = \frac{\gamma - 1}{\gamma + 1}p_R. Setting the two equal is one equation in one unknown, solved by Newton’s method in lab block C:

p∗=0.30313,u∗=0.92745,ρL∗=0.42632,ρR∗=0.26557,s˙=1.75216.p^* = 0.30313, \quad u^* = 0.92745, \quad \rho^*_L = 0.42632, \quad \rho^*_R = 0.26557, \quad \dot s = 1.75216 .

The lab checks the mass jump condition across that shock (residual at round-off). At t=0.2t = 0.2 each wave sits at x=0.5+0.2×x = 0.5 + 0.2\timesspeed: the fan, between speeds −cL=−1.1832-c_L = -1.1832 and u∗−cL(p∗)1/7=−0.0703u^* - c_L(p^*)^{1/7} = -0.0703, spans 0.2634≤x≤0.48590.2634 \le x \le 0.4859; the contact is at 0.68550.6855, the shock at 0.85040.8504 (the sim’s wave diagram).

Finite volumes, Rusanov and HLL

Store cell averages UiU_i and update them by face fluxes:

Uin+1=Uin−ΔtΔx(Fi+1/2−Fi−1/2).U_i^{n+1} = U_i^n - \frac{\Delta t}{\Delta x}\big(F_{i+1/2} - F_{i-1/2}\big).

Summed over cells, interior fluxes cancel in pairs. With mirror ghost cells (ρ,−ρu,E)(\rho, -\rho u, E) the wall flux carries no mass or energy, so both are conserved to round-off whatever the flux formula. This matters for shocks: a conservative scheme that converges converges to a solution of the jump conditions, so shocks move at the right speed (the Lax–Wendroff theorem, from memory); non-conservative schemes can misplace them.

The face flux needs a rule. The Rusanov (local Lax–Friedrichs) flux is the average plus diffusion sized by the fastest signal:

Fi+1/2=12(F(UL)+F(UR))−12a (UR−UL),a=max⁡(∣uL∣+cL, ∣uR∣+cR).F_{i+1/2} = \tfrac12\big(F(U_L) + F(U_R)\big) - \tfrac12 a\,(U_R - U_L), \qquad a = \max\big(|u_L| + c_L,\ |u_R| + c_R\big).

Like 11.9’s upwind scheme, the diffusion term is a numerical viscosity proportional to Δx\Delta x. HLL (Harten, Lax and van Leer) assumes the fan from the face lies between SL=min⁡(uL−cL,uR−cR)S_L = \min(u_L - c_L, u_R - c_R) and SR=max⁡(uL+cL,uR+cR)S_R = \max(u_L + c_L, u_R + c_R), with one average state between them. Applying the integral law to that box gives

FHLL=SRFL−SLFR+SLSR(UR−UL)SR−SL,F^{\text{HLL}} = \frac{S_RF_L - S_LF_R + S_LS_R(U_R - U_L)}{S_R - S_L},

which becomes plain upwind, FLF_L, when SL≥0S_L \ge 0 (every signal moves right) and FRF_R when SR≤0S_R \le 0. Its single middle state cannot hold a contact, which is why contacts still smear (HLLC restores the middle wave; from memory).

CFL. Each flux sees only its two neighbours, so no signal may cross more than one cell per step:

Δt≤CCFL Δxmax⁡i(∣ui∣+ci).\Delta t \le C_{\text{CFL}}\,\frac{\Delta x}{\max_i(|u_i| + c_i)} .

Sound sets the limit even in slow flow: for the light aircraft u+c=390.3u + c = 390.3 m/s against u=50u = 50, so a compressible solver takes 7.87.8 times smaller steps, one reason low-speed flight simulators stay incompressible. In the sim at N=200N = 200, Rusanov runs at CCFL=1.0C_{\text{CFL}} = 1.0 and blows up at 1.11.1 after 1414 steps; HLL survives 1.11.1 and blows up at 1.21.2 after 1111. The limit is sufficient, not exact: the fastest signal occupies only a few cells.

◆ Interactive The Sod shock tube: Rusanov and HLL against the exact solution; change the resolution and the CFL number, and switch between density, velocity, pressure and Mach number

Loading simulation…

What resolution buys

The sim’s readout, for both schemes at t=0.2t = 0.2 and CCFL=0.9C_{\text{CFL}} = 0.9 (the exercise’s solution reproduces the Rusanov entry at N=200N = 200 exactly):

NNRusanov L1(ρ)L^1(\rho)HLL L1(ρ)L^1(\rho)shock cells (Rus. / HLL)contact cells (Rus. / HLL)Rusanov error near the shock
1000.022310.022310.016050.016052 / 216 / 110.001380.00138
2000.015300.015300.010230.010232 / 325 / 160.000640.00064
4000.010130.010130.006480.006483 / 333 / 220.000320.00032
8000.006560.006560.004100.004103 / 345 / 300.000170.00017
16000.004190.004190.002580.002583 / 263 / 420.000070.00007

Widths count cells between 10%10\% and 90%90\% of the jump. Observed orders (log⁡2\log_2 of successive error ratios): Rusanov 0.54,0.60,0.63,0.650.54, 0.60, 0.63, 0.65; HLL 0.65,0.66,0.66,0.670.65, 0.66, 0.66, 0.67. Not one, and the table shows why. The shock stays 22 to 33 cells wide at every NN: characteristics run into it from both sides and their steepening balances the numerical viscosity, so its error halves with Δx\Delta x. The contact rides at uu on both sides, so nothing resharpens it and it spreads like heat: its width in cells grows 1.31.3 to 1.61.6 times per doubling, close to 2\sqrt2, so in xx it shrinks only like Δx\sqrt{\Delta x}, and so does its error. Order one is a promise for smooth flow only. HLL’s error is about a third smaller: its two wave speeds add less diffusion than Rusanov’s single largest one.

Computing it

🐍 PythonLab: sound and Mach (A), a Mach 2 normal shock (B), the exact Sod star state by Newton (C), Burgers breaking (D), the three signal speeds (E)
⌘/Ctrl + Enter

The exercise. Write the Rusanov flux and one finite-volume step with closed (mirror) walls. The tests run Sod at N=200N = 200 to t=0.2t = 0.2, check that total mass (0.56250.5625) and energy (1.3751.375) are unchanged to 10−1210^{-12}, and that the L1L^1 density error against the exact solution is below 0.0160.016 (the sim’s Rusanov gives 0.015300.01530; an HLL flux, at 0.010230.01023, also passes).

🧪 Coding exerciseExercise: a Rusanov finite-volume step for the Sod shock tube, checked for conservation and accuracy
⌘/Ctrl + Enter

The solution gives L1=0.01530L^1 = 0.01530 at N=200N = 200, exactly the sim’s Rusanov readout, with mass and energy unchanged to round-off.

Concept checks

✅ Concept check

At 11 km the air temperature is 216.65 K. With $\gamma = 1.4$ and $R = 287$ J/(kg K), what is the speed of sound in m/s?

✅ Concept check

The normal-shock formulas can be evaluated at $M_1 = 0.5$, giving a pressure drop. Why does such an expansion shock never occur?

✅ Concept check

Refining from 100 to 800 cells, the Rusanov shock stays 2 to 3 cells wide while the contact grows from 16 to 45 cells. Why the difference?

✅ Concept check

Why does a compressible solver for a 50 m/s light aircraft need much smaller time steps than an incompressible one on the same grid?

Problems

✏️ Pen & paperBreaking time and shock speed for Burgers●○○

For ut+uux=0u_t + uu_x = 0 with u0=Usin⁡(kx)u_0 = U\sin(kx), U,k>0U, k \gt 0: find when and where the first shock forms. A Burgers shock then joins uL=0.8u_L = 0.8 to uR=0.2u_R = 0.2; how fast does it move?

Show worked solution

u0′=Ukcos⁡(kx)u_0' = Uk\cos(kx) is most negative, −Uk-Uk, at kx=πkx = \pi, so tb=1/max⁡(−u0′)=1/(Uk)t_b = 1/\max(-u_0') = 1/(Uk), at x=π/kx = \pi/k, where u0=0u_0 = 0 and the characteristic stays put. With U=k=1U = k = 1, tb=1t_b = 1, the fold lab block D finds between 0.990.99 and 1.011.01. Rankine–Hugoniot with F=u2/2F = u^2/2: s˙=(uR2−uL2)/(2(uR−uL))=(uL+uR)/2=0.5\dot s = (u_R^2 - u_L^2)/(2(u_R - u_L)) = (u_L + u_R)/2 = 0.5.

✏️ Pen & paperA Mach 3 normal shock●●○

Find p2/p1p_2/p_1, ρ2/ρ1\rho_2/\rho_1, T2/T1T_2/T_1, M2M_2 and the entropy rise in units of cvc_v for M1=3M_1 = 3, γ=1.4\gamma = 1.4. Compare with Mach 2.

Show worked solution

p2/p1=1+2.82.4(9−1)=10.333p_2/p_1 = 1 + \frac{2.8}{2.4}(9 - 1) = 10.333. ρ2/ρ1=2.4⋅9/(0.4⋅9+2)=21.6/5.6=3.857\rho_2/\rho_1 = 2.4\cdot9/(0.4\cdot9 + 2) = 21.6/5.6 = 3.857. T2/T1=10.333/3.857=2.679T_2/T_1 = 10.333/3.857 = 2.679. M22=(1+1.8)/(12.6−0.2)=0.2258M_2^2 = (1 + 1.8)/(12.6 - 0.2) = 0.2258, M2=0.4752M_2 = 0.4752. Entropy: ln⁡10.333−1.4ln⁡3.857=2.3354−1.8899=0.4455 cv\ln 10.333 - 1.4\ln 3.857 = 2.3354 - 1.8899 = 0.4455\,c_v, against 0.13090.1309 at Mach 2. The density ratio is capped at (γ+1)/(γ−1)=6(\gamma + 1)/(\gamma - 1) = 6 as M1M_1 grows (the formula’s limit), while pressure and entropy keep climbing: stronger shocks waste more energy as heat. Check with shock(3.0) in lab block B.

✏️ Pen & paperCounting the time steps●●○

The sim’s Sod run at N=200N = 200, CCFL=0.9C_{\text{CFL}} = 0.9 takes 9696 steps to reach t=0.2t = 0.2. Which state sets the fastest signal for most of the run? Estimate the step count from it.

Show worked solution

Behind the shock, cR∗=1.4×0.30313/0.26557=1.2641c^*_R = \sqrt{1.4\times0.30313/0.26557} = 1.2641 and u∗+cR∗=2.1916u^* + c^*_R = 2.1916 (the sim reads 2.1932.193). The fan reaches only cL+0.8u∗=1.9252c_L + 0.8u^* = 1.9252, the undisturbed gases 1.18321.1832 and 1.05831.0583. So the shocked gas sets Δt=0.9×0.005/2.1916=0.002053\Delta t = 0.9\times0.005/2.1916 = 0.002053, and 0.2/0.002053=97.40.2/0.002053 = 97.4 steps. The run takes 9696 because the first few steps, before the shocked gas exists, use Δt=0.0038\Delta t = 0.0038.

Key Takeaways

  • Compressible Euler: U=(ρ,ρu,E)U = (\rho, \rho u, E), Ut+F(U)x=0U_t + F(U)_x = 0, E=p/(γ−1)+12ρu2E = p/(\gamma - 1) + \frac12\rho u^2.
  • Linearizing gives sound at c=γp/ρc = \sqrt{\gamma p/\rho}, 340.3340.3 m/s at sea level; small changes travel at u−cu - c, uu and u+cu + c, the eigenvalues of the flux Jacobian.
  • Density changes 1.07%1.07\% at 5050 m/s; a Mach 0.85 jet can carry a supersonic pocket (M=1.165M = 1.165 for a 1.31.3 times suction peak) ending in a shock.
  • Compressions steepen into shocks, first at tb=1/max⁡(−u0′)t_b = 1/\max(-u_0') for Burgers; jumps obey Rankine–Hugoniot, s˙ [U]=[F]\dot s\,[U] = [F], and the second law allows only compressions (4.54.5 times the pressure at Mach 2).
  • Sod’s exact solution: p∗=0.30313p^* = 0.30313, u∗=0.92745u^* = 0.92745, found by Newton on one equation.
  • Conservative finite volumes (Rusanov, HLL) with Δt≤CΔx/max⁡(∣u∣+c)\Delta t \le C\Delta x/\max(|u| + c) hold shocks to 2 to 3 cells and conserve mass and energy to round-off; contacts smear like Δx\sqrt{\Delta x}, so L1L^1 errors converge at about 0.60.6, not 11.
  • Next, 11.13: everything so far has been a PDE solved on a grid. Particle and lattice Boltzmann methods compute fluids a completely different way, by moving and colliding fluid particles or particle populations with no grid-based PDE at all; after that, Module 12 takes all of it into flight.
Finished this lesson?

Mark it complete to track your progress (saved in this browser). Reading every section does this for you.