Step 1 / 4
Store a cell average
A finite-volume cell stores the amount per cell width. The blue bar is the mean carried into reconstruction.
The mean fixes the area under a profile, but it does not fix the profile’s shape.
Numerical methods / Interactive lab
Run an experiment. Select a cell.
Follow how its average changes.
Forward Euler + TENO5 loses positive face pressure in some shock-tube runs. The solver stops if this occurs. SSPRK3 is the default for these examples.
The blue cell is followed in the walkthrough.
Press Run, or advance one step at a time.
Follow the data
Step 1 / 4
A finite-volume cell stores the amount per cell width. The blue bar is the mean carried into reconstruction.
The mean fixes the area under a profile, but it does not fix the profile’s shape.
Step 2 / 4
Step 3 / 4
Predict the RK stage with the chosen reconstruction. If a cell has nonpositive density or pressure, replace the fluxes at both of its faces with donor-cell LLF fluxes and repeat the trial. The neighboring cell uses the same replacement flux.
Only flagged faces change. Each unmodified face keeps the chosen reconstruction and HLLE flux. No cell averages are clipped and no density or pressure floors are added.
This lab uses zero as the positivity threshold. AthenaK tests against configured EOS floors. A separate face guard also replaces a flux when its reconstructed input is already nonphysical. Corrections are repeated for up to eight passes; a failed attempt retries a smaller common time step.
For the general RK tableaus here, a failed trial flags both faces in every contributing flux evaluation, then replays the stages. This is a conservative adaptation of AthenaK’s stage-local algorithm. Classical RK4 still has no SSP guarantee.
One shared flux crosses the face: it leaves one cell and enters its neighbor.
Step 4 / 4
Advection uses periodic boundaries on 0 ≤ x ≤ 1. Its exact signal follows the accumulated displacement when the flow direction changes. The Sod and Lax shock tubes solve the conservative ideal-gas Euler equations with γ = 1.4, an initial jump at x = 0.5, and constant-extension outflow ghosts. The walkthrough traces density and mass flux for Euler.
WENO-Z5 (p = 2) and fixed-cutoff TENO5 use three cell-average quadratic candidates, regularization ε = 10⁻⁴⁰, and optimal weights (0.1, 0.6, 0.3). TENO5 uses C = 1, exponent 6, and cutoff 10⁻⁵. Their full equations and live weights are in step 2. The optional quartic is a reference only. PPM applies classical monotonicity constraints without contact steepening, shock flattening, or characteristic tracing.
Method order describes smooth scalar reconstruction. CWENO5 constructs a fifth-order polynomial throughout the donor cell; WENO and TENO target face values. Euler reconstruction acts componentwise on primitive values derived from conserved means, so these labels do not claim the same order for the full Euler discretization. The scalar flux is exact upwinding. The Euler flux is HLLE with endpoint and Roe acoustic bounds.
All integrators use CFL ≤ 0.35, reduced to 0.2 when either solve uses MP5. Playback schedules complete CFL steps and does not change the numerical time step. Forward Euler can amplify oscillations with high-order spatial reconstruction. Classical RK4 is not SSP. No density or pressure floors are applied. With first-order flux correction off, a nonpositive intermediate Euler stage triggers a smaller common time step; a nonpositive initial reconstructed face stops the solve. With correction on, troubled faces use donor-cell LLF fluxes before time-step retries. See step 3 for the trial, correction and recheck procedure. Scalar advection is unaffected; this is not an overshoot limiter.
Solid curves connect numerical cell averages. The dashed curve is the pointwise exact solution. Overshoot and undershoot compare the averages with the exact instantaneous range, including physical shock compression. Candidate-curve excursions compare with stencil means, which are not physical bounds on a subcell profile. Errors use exact cell averages. Live method switches retain earlier errors. Restart to compare methods from the initial data.
References: AthenaK hydrodynamics and FOFC; Clawpack’s advection, finite-volume methods, and Euler Riemann problem. This page typesets LaTeX using KaTeX, served locally.