Shock Tube Lab

A finite-volume solver for the 1D Euler equations running in your browser, plotted against the exact Riemann solution. Pick an experiment, change the scheme, and watch the shock, contact and expansion fan develop.

x = 0tube view: density, scheme A · dashed line = diaphragmx = 1

Results at the final time

SchemeL1 error (density)StepsRun timeCells across shockCells across contactStatus

Cells across a discontinuity counts cells inside the 5–95% band of the jump (shock measured in p, contact in ρ), for cases with a left fan and a right shock. Run time is measured in this browser.

Calorically perfect gas, γ = 1.4, nondimensional units, transmissive boundaries on x ∈ [0, 1]. Fluxes: Rusanov, Roe with optional Harten fix, and HLLC with Einfeldt wave speeds. Reconstruction: MUSCL on primitive variables with minmod, van Leer or superbee limiters. This page is a line-by-line JavaScript port of the Python solver; on the Sod problem at N = 400 it reproduces the repository's L1 errors, step counts and discontinuity widths exactly. Method and validation: README on GitHub. Built by Badr Elsayed.