Docs › Examples › Downloadable notebooks › The Sod shock tube
Compressible flow · 1D
The Sod shock tube
The 1D compressible Euler equations stated directly through the Python API, with WENO5 reconstruction and RK4 in time.
Run locally with OneSimulation. The example downloads are free. Running them requires an activated runtime. OneSimulation 1.0 · CPython 3.13 on macOS (Apple Silicon), Ubuntu 22.04 (x86-64), and Windows x64. Installation and activation · View pilot plans. Scope of the reference checks.

What it computes
The example formulates the one-dimensional Euler equations directly through Problem and Simulation on 1,600 points — it imports no prepared Sod case and no analytic solution. A CFL limit guards the time step. Density and pressure stay positive in every stored field; mass and total energy stay essentially constant until the disturbance reaches the open ends, and the checked momentum balance accounts for the boundary contribution.
What it checks
Positivity and mass, momentum and energy balances.