# Compressible Euler

Finite-volume solver for the compressible Euler equations with HLLC Riemann fluxes, MUSCL slope-limited reconstruction, and RK3-TVD time integration. 1D mode is the canonical Sod / Lax shock-tube validator; 2D mode applies the 1D sweep dimension-by-dimension.

## Algorithm

Conservative state vector `U = (ρ, ρu, ρv, E)` with ideal-gas closure `p = (γ-1)(E - ½ρ(u² + v²))`. Per time step:

1. MUSCL reconstruction at each cell face (minmod or van Leer limiter)
2. HLLC Riemann flux at the face from the reconstructed left/right states
3. RK3-TVD update with a CFL-governed `dt`

The HLLC solver follows Toro (1999) §10.6: Davis wave-speed estimates, contact discontinuity speed `S*` from the pressure-balance Riemann condition, and the star-state algebra reproduced from Toro eq 10.39.

## Validation

- **Sod shock tube** at t = 0.2, γ = 1.4: the exact Riemann solution (rarefaction-contact-shock) is computed and compared against the simulation. The L1 error on density is reported alongside its **GeoNum drift compartment** and **trust tier** (Exact / Precise / Valid / Degraded / Unreliable). The absolute L1 value is sensitive to grid resolution, limiter, CFL, and IEEE-754 accumulation across ~100 RK3 steps; trust is the authoritative precision report.
- **Positivity preservation**: pressure stays positive on the Lax problem (a stress test for any limiter)
- **Mass conservation**: closed under periodic BCs (transmissive BCs allow flux at the boundary by design)

## Substrate framing

A 1D shock tube wastes a 2D/3D parallel substrate. The `ensemble_m` parameter projects the 1D problem onto M parallel y-rows, each with a small perturbation `ensemble_eps`. The across-row standard deviation on the L1 error is reported — it is a cheap proxy for the GeoNum drift compartment and a real physical diagnostic of solution stability under IC perturbation. GPU dispatch (planned) runs all M rows concurrently.

## Parameters

| Field | Meaning | Default |
|-------|---------|---------|
| nx | cell count | 400 |
| ny | y cells (1 for 1D scenarios) | 1 |
| dimensions | 1 or 2 | 1 |
| box_length | physical L | 1.0 |
| t_end | final time | 0.2 |
| cfl | CFL safety factor | 0.45 |
| gamma | adiabatic index | 1.4 |
| scenario | `sod`, `lax`, `blast_2d`, `kelvin_helm` | sod |
| limiter | `minmod`, `vanleer`, `none` | minmod |
| boundary | `transmissive` or `periodic` | transmissive |
| ensemble_m | parallel realizations of the 1D problem | 1 |
| ensemble_eps | per-row IC perturbation amplitude | 0.0 |
