---
title: "Let Pressure Write the Shock Diamonds Interactive Lab | Sandbox Physics"
description: "Why does a supersonic jet form a chain of diamonds when its exit pressure differs from the surrounding air? A jet that leaves the nozzle above the surrounding pressure expands first; one that leaves below it is squeezed first. Each overshoot reflects off the jet's edge as the opposite kind of wave, so expansions and compressions alternate down the jet and draw the diamond pattern. Matched to the surrounding pressure, an ideal jet with no viscosity stays straight."
canonical_url: "https://sandboxphysics.com/labs/supersonic-jet-shock-diamonds/"
language: "en"
page_type: "lab"
alternate_languages:
  zh-CN: "https://sandboxphysics.com/zh/labs/supersonic-jet-shock-diamonds/"
last_modified: "2026-10-22"
---

Pressure mismatch · compressible flow

# Supersonic Jet & Shock Diamonds

**Why does a supersonic jet form a chain of diamonds when its exit pressure differs from the surrounding air?** A jet that leaves the nozzle above the surrounding pressure expands first; one that leaves below it is squeezed first. Each overshoot reflects off the jet's edge as the opposite kind of wave, so expansions and compressions alternate down the jet and draw the diamond pattern. Matched to the surrounding pressure, an ideal jet with no viscosity stays straight.

A converging–diverging nozzle feeds a planar jet that the Euler equations compute as you watch. Compare underexpanded, matched and overexpanded jets in the Mach, pressure and numerical schlieren views. Follow the waves along the centerline, check that the open box conserves mass, momentum and energy, and test the code on a normal shock whose exact jump is known.

> Interactive simulation: open this page in a web browser to change the parameters and run the model.

The gas is calorically perfect. The model has no combustion, viscosity or heat conduction, and it does not predict sound. The upstream nozzle is a quasi-1D isentropic calculation and is not part of the 2D grid. The jet outside the nozzle is planar, not axisymmetric. The allowed pressure range assumes the flow leaves the nozzle supersonic, with no shock inside the nozzle. Numerical schlieren also shows contact layers, so a dark edge alone does not prove there is a shock.

Physics tutorial

## A pressure mismatch creates a system of waves

**Background** A supersonic nozzle does not automatically exit at the pressure of the surrounding air. Once free, the jet adjusts through expansion and compression waves. As these waves cross the jet and interact, they can form a repeating chain of shock cells.

**Why it matters** An animation of glowing diamonds cannot tell you whether the pressure, mass flow or shock jump makes physical sense. This Lab gives you four things to check separately: the nozzle calculation, the computed flow outside the nozzle, the profile along the centerline and a conservation check for the whole box.

Start with the essentials

- **Focus question**: What changes when exit pressure is above, equal to, or below ambient pressure?
- **One-sentence intuition**: A jet that leaves above ambient pressure first expands, and one that leaves below it first compresses. With matched pressure, a straight inviscid jet is already a steady solution whose edge is a stationary contact and shear layer, so the solver forms no diamonds in that limit.

### Core mathematical model

#### Nozzle area and Mach number

$$
\frac{A}{A_*}=\frac1M\left[\frac{2}{\gamma+1}\left(1+\frac{\gamma-1}{2}M^2\right)\right]^{\frac{\gamma+1}{2(\gamma-1)}},\quad \frac{p}{p_0}=\left(1+\frac{\gamma-1}{2}M^2\right)^{-\frac{\gamma}{\gamma-1}}
$$

Every area larger than the throat has two solutions, one subsonic and one supersonic. The nozzle calculation takes the subsonic one before the throat and the supersonic one after it. Total temperature is fixed, and total pressure follows from the chosen exit state. Shocks inside the nozzle and boundary layers on its walls are not solved.

#### Maximum mass flow through a sonic throat, and ideal thrust

$$
\dot m=\rho u A=\frac{A_*p_0}{\sqrt{T_0}}\sqrt{\frac\gamma R}\left(\frac2{\gamma+1}\right)^{\frac{\gamma+1}{2(\gamma-1)}},\quad F=\dot m u_e+(p_e-p_a)A_e
$$

For a fixed area and fixed total pressure and temperature, the mass flow is largest where the flow reaches the speed of sound. Every cross-section of the nozzle carries the same mass flow. The thrust is the ideal quasi-1D nozzle value per unit span; it is not a force measured on the 2D box. The critical pressure ratio describes the local sonic throat. It is not a back-pressure threshold that holds for every converging–diverging nozzle.

#### Exact jump across a normal shock

$$
\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}{2+(\gamma-1)M_1^2},\quad M_2^2=\frac{1+\frac{\gamma-1}{2}M_1^2}{\gamma M_1^2-\frac{\gamma-1}{2}}
$$

The fluxes of mass, axial momentum and energy are equal on both sides of the shock, but total pressure drops across it. The normal-shock test runs this stationary jump through the same 2D code, and the dashed centerline curve comes straight from the exact relations. The error is the mean absolute pressure error divided by the downstream pressure. The test checks how the code handles a shock; it does not predict that every jet has a Mach disk.

#### External two-dimensional Euler flow

$$
\partial_t\mathbf U+\partial_x\mathbf F+\partial_y\mathbf G=0,\quad \mathbf U=(\rho,\rho u,\rho v,\mathcal E,\rho c)^{\mathsf T},\quad p=(\gamma-1)\left[\mathcal E-\tfrac12\rho(u^2+v^2)\right]
$$

The code updates density, both momentum components, energy and a passive jet mass fraction in conservative form. MUSCL reconstruction uses monotonized-central slopes of the primitive variables. The flux is a hybrid of HLLC and HLLE with wave-speed bounds from the Roe and Davis estimates; where the flow compresses and the pressure jumps by more than one tenth of the smaller pressure, HLLE takes over. SSP-RK2 advances the unsplit flux divergence in time.

#### Time-step limit and conservation in an open box

$$
\Delta t\le\frac{\mathrm{CFL}}{\max\left[(|u|+a)/\Delta x+(|v|+a)/\Delta y\right]},\quad a=\sqrt{\gamma p/\rho},\quad \mathbf Q(t)+\int_0^t\mathbf\Phi_{\partial\Omega}\,dt=\mathbf Q(0)
$$

Mass, momentum and energy can enter or leave the box through its boundaries. The conservation check adds the outward numerical flux, weighted by Runge–Kutta stage, to the amount currently inside the box. Quantities that start at zero are scaled by the initial mass instead. The relative state-change rate is a dimensionless vector norm per unit time; it does not estimate the discretization error. A rejected update is retried first without reconstruction and then with a smaller time step; the code never clips values to repair the energy.

#### Numerical schlieren shows density gradients

$$
S=1-\exp\left(-0.16|\nabla\rho|\right)
$$

This image takes centered-difference gradients of the same finite-volume density field and shows them with fixed contrast. Shocks and contact layers can both appear dark. A cell gets a compression hint only when it has a pressure gradient and negative velocity divergence. The hints mark grid cells above a threshold; they do not give the exact shock shape and are not a calibrated optical measurement.

### Common difficulties

#### The colors are not flame

**Typical misconception** The bright regions show the exhaust burning and how hot it is.

**Better mental model** The model has no combustion and no light emission. The colors show Mach number or pressure, and the black-and-white view shows density gradients. A planar inviscid jet also cannot predict the cell spacing of an axisymmetric jet, viscous mixing, real-gas chemistry or noise.

#### Conservation does not mean grid convergence

**Typical misconception** If the conservation error is tiny, the shock-cell pattern must be right.

**Better mental model** The conservation check only shows that the discrete fluxes neither create nor lose conserved quantities. Numerical diffusion, reconstruction, shock detection, the box boundaries and the grid resolution still shape the pattern. Run again on different grids and compare at the same simulation time. In the early frames the prefilled jet is still relaxing; that transient is not yet a steady plume.

### Run the experiment

1. 01

   #### Mismatch the exit and ambient pressure

   Run the three plume presets at the same Mach number. Let the waves develop, then look at the pressure and schlieren views. Click the centerline to move the probe that all views share.

   **What to observe:** The underexpanded jet expands first and the overexpanded jet compresses first. The matched jet stays straight, bounded by a shear and contact layer. The waves come out of the flow solution itself; no sine-shaped diamonds are drawn in.

2. 02

   #### Test the code on a single shock

   Select the Normal-shock test. Let it run, then raise the Grid resolution. Compare the pressure curve with the dashed exact jump and read the shock error.

   **What to observe:** The computed shock is spread over several cells. A finer grid should shrink its integrated error. The ratios between the two plateaus and the equal fluxes of mass, momentum and energy are independent checks against the exact theory.

3. 03

   #### Change the nozzle and the grid

   Change the Mach number, the specific-heat ratio and the nozzle length. Compare the exit-to-throat area ratio and the mass flow. Then raise the Grid resolution and watch the step cost and the actual simulation time.

   **What to observe:** The nozzle shape changes, but every section still carries the same mass flow. Length does not change the chosen exit state. A finer grid may advance more slowly because each frame has limited computing time. Even a small conservation error still needs a comparison between grids.

4. 04

   #### Scientific basis and inspiration

   NASA Glenn: Isentropic Flow Equations, Mass Flow Choking, Normal Shock Wave Equations, and Rocket Thrust Equations at grc.nasa.gov/www/k-12/airplane/. HLLC basis: Toro, Spruce and Speares (1994), Restoration of the contact surface in the HLL-Riemann solver, DOI 10.1007/BF01414629.

   **What to observe:** Bugman123 FluidMotion inspired the idea only; the code and graphics are original. Automated tests cover analytic nozzle and shock values, preservation of a stationary contact, the independent Sod solution, grid refinement, symmetry, positivity and conservation of boundary flux.

Physical conclusion

Treat a shock-cell picture as a hypothesis until the nozzle calculation, the conservation check and the exact shock test agree. Even then, how much it depends on the grid and the boundaries is a separate question.

Conceptual inspiration: [FluidMotion](http://www.bugman123.com/FluidMotion/index.html). Original simulations and graphics; the model limits are described above.

Fields & matter · Starter path

## From a field to an electron microscope

Map an electric field and steer a charged particle. Then find the electron's wavelength and use electron beams to see a crystal and a surface.

[Start here → **Make an Electric Field Visible** Move the probe around a dipole and check that the field always points downhill on the potential landscape. Observe · 8 min](https://sandboxphysics.com/labs/electric-field/)

1. [1 Make an Electric Field Visible](https://sandboxphysics.com/labs/electric-field/)
2. [2 A Charge Bending through Fields](https://sandboxphysics.com/labs/charged-particle/)
3. [3 Electron Wavelength & Voltage](https://sandboxphysics.com/labs/electron-wavelength/)
4. [4 Electron Diffraction & Reciprocal Space](https://sandboxphysics.com/labs/electron-diffraction/)
5. [5 TEM Bright Field, Dark Field & SAED](https://sandboxphysics.com/labs/tem-mode-selector/)
6. [6 SEM Secondary-Electron Topography](https://sandboxphysics.com/labs/sem-topography/)

[View the full path →](https://sandboxphysics.com/topics/fields-and-matter/#starter-path)
