One-dimensional Euler conservation law
The rows conserve mass, momentum, and total energy; the finite-volume method exchanges only interface fluxes.
Compressible flow · hyperbolic conservation laws
Advance the one-dimensional Euler equations with an HLL finite-volume method while overlaying every cell against the exact Riemann solution. Tube density, the x–t wave diagram, four profiles, and conservation drift update together.
Physics tutorial
BackgroundA shock tube begins with two uniform gases separated by a diaphragm. Removing it creates one discontinuity that self-organizes into a shock, contact discontinuity, and rarefaction fan, carrying compression, material identity, and smooth expansion in different ways.
Why it mattersGary Sod established these initial data as a canonical compressible-flow test in 1978. This Lab also uses the two-wave flux idea introduced by Harten, Lax, and van Leer in 1983, so every numerical cell can be compared with the exact self-similar Riemann solution.
Start with the essentials
The rows conserve mass, momentum, and total energy; the finite-volume method exchanges only interface fluxes.
The heat-capacity ratio closes the relation among energy, pressure, and sound speed and shifts all three wave families.
When the bounding signal speeds straddle zero, HLL uses one averaged intermediate state. It remains conservative but spreads contacts more than the exact solution.
Each step keeps the fastest characteristic from crossing a full cell; refining the grid therefore shortens the time step automatically.
Typical misconceptionDensity still jumps, so the middle line must be another small shock.
Better mental modelPressure and velocity remain continuous across a contact. Only density and material identity jump, and the contact travels with the star-region flow.
Typical misconceptionBecause the plotted front spans several cells, an inviscid physical shock has the same thickness.
Better mental modelThe Euler shock is a discontinuity. Its visible width here mainly records first-order HLL diffusion and finite resolution.
Choose Sod benchmark, keep the exact overlay visible, and run until the solver pauses automatically.
What to observe: A smooth rarefaction moves left, the contact advects through the middle, and the right shock leads; the numerical curves track the dashed exact solution.Switch to Strong shock, then increase the cell count while watching density error.
What to observe: Shock speed and star pressure rise sharply. More cells narrow the front and reduce global error while forcing smaller time steps.Compare Colliding flows with Symmetric expansion while the x–t diagram is visible.
What to observe: Collision turns both outer waves into shocks, while separation creates two rarefaction fans; wave type follows star pressure relative to each initial pressure.