OneSimulation docs Website Free books Plans on Gumroad

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.

1D finite volumeWENO5RK4Compressible Euler

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.

A compressible Euler shock computed with OneSimulation.
A compressible Euler shock computed with OneSimulation. Run the notebook to produce its own figures.

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.