Back

SPH 1D Sod Shock Tube

What you are seeing: a one-dimensional smoothed-particle hydrodynamics (SPH) simulation of the Sod shock tube. The membrane at x=0.5x = 0.5 separates a high-pressure left state (ρ=1\rho = 1, P=1P = 1, v=0v = 0) from a low-pressure right state (ρ=0.125\rho = 0.125, P=0.1P = 0.1, v=0v = 0). At t=0t = 0 the membrane is removed.

The exact Riemann solution has three waves: a left-moving rarefaction fan (where the gas accelerates and rarefies), a contact discontinuity in the middle (where density jumps but pressure and velocity are smooth), and a right-moving shock (where density, pressure, and velocity all jump). The SPH method represents the fluid as 360 Lagrangian particles smoothed by a cubic-spline kernel; the artificial viscosity is what allows it to capture the shock.

Figure 1. SPH Sod shock tube. Method: cubic-spline kernel SPH with Monaghan-Gingold artificial viscosity (alpha=1, beta=2).
speed2
fieldrho

WHAT TO TRY

  • Let the membrane burst and watch the three waves separate: a rarefaction fan runs left into the high-pressure gas, a contact discontinuity drifts right, and a shock runs furthest right. The density, velocity and pressure panels show all three.
  • Read the conserved quantities: the SPH particles carry mass exactly and the total energy drifts by only a percent, the honest accuracy check for the scheme on this classic Riemann test.
  • Switch the coloured field: the same particles re-coloured by density, velocity or pressure reveal which wave each feature belongs to, the contact shows in density but not pressure.