How does precision — FP64 vs FP32 vs FP16 — affect the accuracy, stability, conservation, and cost of four finite-difference schemes on the Linear Advection-Diffusion and Viscous Burgers' equations?
Governing Equations
Numerical Schemes
Experiments
Every scheme runs all six experiments × three precision variants (FP64 / FP32 / FP16), producing a uniform diagnostics dataset for direct cross-scheme comparison.
| # | Experiment | Purpose | Grid | CFL |
|---|---|---|---|---|
| 01 | Baseline Regime Sweep | Accuracy across Re = 10, 100, 1000 | nx = 1024 | 0.80 |
| 02 | Ultra-High Re Shock Stress | Shock sharpening at Re = 100,000 — precision sensitivity | nx = 1024 | 0.80 |
| 03 | Under-Resolved High Re | Coarse grid (nx=128) — FP16 breakdown & instability | nx = 128 | 0.80 |
| 04 | Tiny Amplitude Quantization | Amplitude 1e-6 — precision floor & lost updates (linear only) | nx = 1024 | 0.80 |
| 05 | Long-Horizon Drift | Extended time — conservation error & TV drift accumulation | nx = 1024 | 0.50 |
| 06 | CFL Overdrive Failure | Intentional CFL = 1.2 — method-level failure mode | nx = 256 | 1.20 |
Precision
| Precision | torch.dtype | Bits | Mantissa | Stability (CFL=0.8) | High Re Accuracy | Long Horizon |
|---|---|---|---|---|---|---|
| FP64 | torch.float64 | 64 | 52 bits | Stable ✓ | Reference | No drift |
| FP32 | torch.float32 | 32 | 23 bits | Stable ✓ | Small error | Slow drift |
| FP16 | torch.float16 | 16 | 10 bits | Unstable (exp03) | Catastrophic | Mass drift |
Key Findings
Run Locally
Tech Stack
Results
L2 Error by Precision — Baseline Regime (Re=1000, Advection-Diffusion)
FP64 consistently achieves the lowest L2 error. FP16 degrades sharply at high Reynolds numbers.
Stability Window — FP16 Breakdown at High Re (MUSCL Scheme)
FP16 loses stability on under-resolved, high-Re grids (exp03: nx=128, Re=100,000). FP64 and FP32 remain stable at CFL=0.80 across all schemes.
Mass Conservation Drift — Long-Horizon Experiment (exp05, Scheme 1)
FP16 accumulates significant mass error over time due to rounding in the flux accumulation loop. FP64 mass drift stays below machine epsilon throughout.
Team
M.Tech Computational and Data Sciences · Indian Institute of Science · Bengaluru · 2024–25