ASTR 474 · Computational Astrophysics · Lecture 05

Lecture 05: Conservation Laws and Hydrodynamics Concepts

Why should a discretization conserve fluxes across cell boundaries?

14-week course · 3 credits · Week 5

Motivation

Why should a discretization conserve fluxes across cell boundaries?

The compressible Euler equations evolve mass, momentum, and total energy through flux divergence. Shocks are weak solutions: conservation and entropy admissibility matter even when derivatives are discontinuous.

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

Core language

Terms for This Lecture

Conserved variable

Definition: A density whose volume integral changes only through boundary fluxes or source terms.

Why it matters here: It helps answer Why should a discretization conserve fluxes across cell boundaries? within the numerical model described here.

Relationships: Connect it to Flux, the governing expression \(\partial_t\mathbf U+\partial_x\mathbf F(\mathbf U)=0,\quad \mathbf U=(\rho,\rho u,E)^T\), and the computed diagnostic developed later in the lecture.

Boundary or common confusion: The course's first-order Rusanov shock-tube code is a pedagogical finite-volume demonstrator, not a production hydrodynamics solver. It omits multidimensional physics, reconstruction, well-balanced treatment, and production-grade boundary models.

Physical and mathematical model

State what is being evolved

The compressible Euler equations evolve mass, momentum, and total energy through flux divergence. Shocks are weak solutions: conservation and entropy admissibility matter even when derivatives are discontinuous.

\[\partial_t\mathbf U+\partial_x\mathbf F(\mathbf U)=0,\quad \mathbf U=(\rho,\rho u,E)^T\]

Define the state, coordinates, units, initial/boundary conditions, and domain before interpreting solver output.

Numerical method

Algorithm choice is a modeling decision

Write conserved variables; derive physical fluxes; use a Riemann or approximate interface flux; update by flux differences; check positivity, CFL stability, and integral conservation.

  1. Write the model and its assumptions.
  2. Choose a solver and identify its stability, accuracy, and conservation properties.
  3. Record configuration, tolerances or timestep, and output sampling.
  4. Compare against an analytic limit, independent method, or controlled refinement.

Visual reasoning

Sod shock tube: rarefaction, contact, and shock

Shock-tube density structureA generated density profile labels the rarefaction fan, contact discontinuity, and right-moving shock in a one-dimensional Riemann problem. rarefaction fancontactshock dimensionless position xdensity rho
Illustrative shock-tube structure; quantitative profiles are generated with the first-order Rusanov teaching solver.

Computed example

One result, with a check

For the declared Sod states and gamma=1.4, initial sound speeds are 1.183 and 1.058 in the dimensionless model; both values are computed from sqrt(gamma*p/rho).

Inputs and method are generated by src/astr474_computations.py; the machine-readable values are in data/generated/computed_results.json.

The course's first-order Rusanov shock-tube code is a pedagogical finite-volume demonstrator, not a production hydrodynamics solver. It omits multidimensional physics, reconstruction, well-balanced treatment, and production-grade boundary models.

Verification

What would falsify this result?

Do not report a smoother curve as proof of convergence.

Failure modes

Numerical agreement has a domain

The course's first-order Rusanov shock-tube code is a pedagogical finite-volume demonstrator, not a production hydrodynamics solver. It omits multidimensional physics, reconstruction, well-balanced treatment, and production-grade boundary models.

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

Why should a discretization conserve fluxes across cell boundaries?

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

Write conserved variables; derive physical fluxes; use a Riemann or approximate interface flux; update by flux differences; check positivity, CFL stability, and integral conservation.

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 uses a Sod shock tube with an explicit synthetic initial state, measured mass error, and resolution comparison.

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

  1. Does the implemented equation match the intended physical model?
  2. Does the numerical result converge under a controlled method change?
  3. Does the interpretation stay inside the validity and provenance limits?

The course's first-order Rusanov shock-tube code is a pedagogical finite-volume demonstrator, not a production hydrodynamics solver. It omits multidimensional physics, reconstruction, well-balanced treatment, and production-grade boundary models.

Sources

Technical references

Data and provenance details are recorded in reference-log.md. Last updated 2026-09-27.