Lecture 06: Finite-Volume Resolution and Shock Tests
Does adding cells improve a result, or merely make a sharper-looking plot?
14-week course · 3 credits · Week 6
Motivation
Does adding cells improve a result, or merely make a sharper-looking plot?
A finite-volume scheme represents cell averages, so a discontinuity is spread across a resolution-dependent number of cells. Grid convergence must compare quantities and integrated errors on a common coordinate, not compare line thickness by eye.
Today’s result must be interpretable as a physical statement with declared data, algorithm, uncertainty, and a check that could fail.
Learning objectives
After this lecture, you can
Does adding cells improve a result, or merely make a sharper-looking plot?
Run the identical initial-value problem at 32, 64, 128, and 256 cells
A fine grid is not automatically converged; the reference solution also has error, and a first-order method diffuses shocks. Never label the 512-cell solution exact.
Core language
Terms for This Lecture
Cell average
Definition: The volume-averaged state represented by one finite-volume zone.
Why it matters here: It helps answer Does adding cells improve a result, or merely make a sharper-looking plot? within the numerical model described here.
Relationships: Connect it to Numerical flux, the governing expression \(\mathbf U_i^{n+1}=\mathbf U_i^n-\frac{\Delta t}{\Delta x}(\hat{\mathbf F}_{i+1/2}-\hat{\mathbf F}_{i-1/2})\), and the computed diagnostic developed later in the lecture.
Boundary or common confusion: A fine grid is not automatically converged; the reference solution also has error, and a first-order method diffuses shocks. Never label the 512-cell solution exact.
Numerical flux
Definition: An interface estimate of transported conserved quantities used in the discrete update.
Why it matters here: It helps answer Does adding cells improve a result, or merely make a sharper-looking plot? within the numerical model described here.
Relationships: Connect it to CFL condition, the governing expression \(\mathbf U_i^{n+1}=\mathbf U_i^n-\frac{\Delta t}{\Delta x}(\hat{\mathbf F}_{i+1/2}-\hat{\mathbf F}_{i-1/2})\), and the computed diagnostic developed later in the lecture.
Boundary or common confusion: A fine grid is not automatically converged; the reference solution also has error, and a first-order method diffuses shocks. Never label the 512-cell solution exact.
CFL condition
Definition: A timestep restriction tying numerical propagation to the fastest resolved signal speed.
Why it matters here: It helps answer Does adding cells improve a result, or merely make a sharper-looking plot? within the numerical model described here.
Relationships: Connect it to Numerical diffusion, the governing expression \(\mathbf U_i^{n+1}=\mathbf U_i^n-\frac{\Delta t}{\Delta x}(\hat{\mathbf F}_{i+1/2}-\hat{\mathbf F}_{i-1/2})\), and the computed diagnostic developed later in the lecture.
Boundary or common confusion: A fine grid is not automatically converged; the reference solution also has error, and a first-order method diffuses shocks. Never label the 512-cell solution exact.
Numerical diffusion
Definition: Artificial smoothing introduced by a discretization, especially near discontinuities.
Why it matters here: It helps answer Does adding cells improve a result, or merely make a sharper-looking plot? within the numerical model described here.
Relationships: Connect it to Resolution study, the governing expression \(\mathbf U_i^{n+1}=\mathbf U_i^n-\frac{\Delta t}{\Delta x}(\hat{\mathbf F}_{i+1/2}-\hat{\mathbf F}_{i-1/2})\), and the computed diagnostic developed later in the lecture.
Boundary or common confusion: A fine grid is not automatically converged; the reference solution also has error, and a first-order method diffuses shocks. Never label the 512-cell solution exact.
Resolution study
Definition: A controlled comparison across grid spacings used to test convergence and estimate discretization error.
Why it matters here: It helps answer Does adding cells improve a result, or merely make a sharper-looking plot? within the numerical model described here.
Relationships: Connect it to Cell average, the governing expression \(\mathbf U_i^{n+1}=\mathbf U_i^n-\frac{\Delta t}{\Delta x}(\hat{\mathbf F}_{i+1/2}-\hat{\mathbf F}_{i-1/2})\), and the computed diagnostic developed later in the lecture.
Boundary or common confusion: A fine grid is not automatically converged; the reference solution also has error, and a first-order method diffuses shocks. Never label the 512-cell solution exact.
Physical and mathematical model
State what is being evolved
A finite-volume scheme represents cell averages, so a discontinuity is spread across a resolution-dependent number of cells. Grid convergence must compare quantities and integrated errors on a common coordinate, not compare line thickness by eye.
Define the state, coordinates, units, initial/boundary conditions, and domain before interpreting solver output.
Numerical method
Algorithm choice is a modeling decision
Run the identical initial-value problem at 32, 64, 128, and 256 cells; preserve CFL and final time; record mass error and L1 density discrepancy against a finer reference; discuss numerical diffusion and boundary influence.
Write the model and its assumptions.
Choose a solver and identify its stability, accuracy, and conservation properties.
Record configuration, tolerances or timestep, and output sampling.
Compare against an analytic limit, independent method, or controlled refinement.
Visual reasoning
Shock resolution and L1 discrepancy
Bar heights encode the computed L1 density discrepancy; separate mass errors are given in the figure caption and lab table.
Computed example
One result, with a check
The density L1 discrepancy against the 512-zone reference decreases from 0.03066 at 32 cells to 0.00521 at 256; measured mass errors are listed independently.
Inputs and method are generated by src/astr474_computations.py; the machine-readable values are in data/generated/computed_results.json.
A fine grid is not automatically converged; the reference solution also has error, and a first-order method diffuses shocks. Never label the 512-cell solution exact.
Verification
What would falsify this result?
Repeat with a smaller timestep, tighter tolerance, or finer spatial grid.
Track conservation or residual structure in addition to visual agreement.
Check units, coordinate frame, boundary conditions, and invariants independently.
Change a random seed when the method is stochastic; report the resulting sampling uncertainty.
Do not report a smoother curve as proof of convergence.
Failure modes
Numerical agreement has a domain
A fine grid is not automatically converged; the reference solution also has error, and a first-order method diffuses shocks. Never label the 512-cell solution exact.
Solver error, discretization error, stochastic error, parameter uncertainty, and model discrepancy are different quantities. Diagnose and report them separately.
Active reasoning
Make a prediction before rerunning
Does adding cells improve a result, or merely make a sharper-looking plot?
State a measurable outcome, a competing explanation, and the smallest computation that distinguishes them. Include an expected direction or scaling, then test it.
Workflow
From parameters to auditable output
Run the identical initial-value problem at 32, 64, 128, and 256 cells; preserve CFL and final time; record mass error and L1 density discrepancy against a finer reference; discuss numerical diffusion and boundary influence.
Record the exact command, package versions, data path, random seed if applicable, and output checksum. Keep raw inputs unchanged and generated files separate.
Transfer
Lab and problem-set connection
Lab 04 requires a resolution table and a plot with discontinuity structure, not only a single final image.
Submit plots with labeled axes/units, a concise uncertainty argument, and enough code or intermediate values for a peer to reproduce the claim.
Synthesis
Three durable checks
Does the implemented equation match the intended physical model?
Does the numerical result converge under a controlled method change?
Does the interpretation stay inside the validity and provenance limits?
A fine grid is not automatically converged; the reference solution also has error, and a first-order method diffuses shocks. Never label the 512-cell solution exact.