James R. BeattieLecture notes ↗

Numerical methods / Interactive lab

Inside a finite-volume solver

Run an experiment. Select a cell.
Follow how its average changes.

Gas dynamics only · checks density and pressure

The live solution

Preparing
t = 0.00000 stepsCFL ≤ 0.35
Overshoot0
Undershoot0

Advection

The blue cell is followed in the walkthrough.

Explore ringing near a jump
Comparison & diagnostics
Mean absolute error in q0.00Mass balance error0.00

Example and grid changes restart the solve. Reconstruction, time integration, and direction changes keep the current state. Playback changes only how quickly time passes on screen. Run continues without a fixed end time. Switching tabs pauses the solve.

    Follow the data

    Following cell 21

    Selected cell

    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.

    Stored mean—

    The mean fixes the area under a profile, but it does not fix the profile’s shape.

    1 of 4
    About the equations & numerical methods

    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.