ASTR 474 · Lecture 05 · Study notes

Lecture 05: Conservation Laws and Hydrodynamics Concepts — Lecture Notes

Why should a discretization conserve fluxes across cell boundaries?

Terms Developed in Context

The terms below connect the mathematical model, implementation choices, computed diagnostics, and limits of the scientific claim.

Conserved variable

A density whose volume integral changes only through boundary fluxes or source terms. In this lecture it is used to address Why should a discretization conserve fluxes across cell boundaries?

Model connection: Read the term against Flux and the governing relation \(\partial_t\mathbf U+\partial_x\mathbf F(\mathbf U)=0,\quad \mathbf U=(\rho,\rho u,E)^T\). The relevant computational evidence is a controlled output, residual, invariant, or refinement sequence rather than visual smoothness alone.

Interpretive limit: 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. This distinction separates numerical behavior from physical accuracy and model adequacy.

Flux

The rate at which a conserved quantity crosses a unit area. In this lecture it is used to address Why should a discretization conserve fluxes across cell boundaries?

Model connection: Read the term against Finite-volume method and the governing relation \(\partial_t\mathbf U+\partial_x\mathbf F(\mathbf U)=0,\quad \mathbf U=(\rho,\rho u,E)^T\). The relevant computational evidence is a controlled output, residual, invariant, or refinement sequence rather than visual smoothness alone.

Interpretive limit: 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. This distinction separates numerical behavior from physical accuracy and model adequacy.

Finite-volume method

A discretization that updates cell averages from numerical fluxes at cell interfaces. In this lecture it is used to address Why should a discretization conserve fluxes across cell boundaries?

Model connection: Read the term against Riemann problem and the governing relation \(\partial_t\mathbf U+\partial_x\mathbf F(\mathbf U)=0,\quad \mathbf U=(\rho,\rho u,E)^T\). The relevant computational evidence is a controlled output, residual, invariant, or refinement sequence rather than visual smoothness alone.

Interpretive limit: 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. This distinction separates numerical behavior from physical accuracy and model adequacy.

Riemann problem

An initial discontinuity separating two constant states, used to determine interface waves and flux. In this lecture it is used to address Why should a discretization conserve fluxes across cell boundaries?

Model connection: Read the term against Shock and the governing relation \(\partial_t\mathbf U+\partial_x\mathbf F(\mathbf U)=0,\quad \mathbf U=(\rho,\rho u,E)^T\). The relevant computational evidence is a controlled output, residual, invariant, or refinement sequence rather than visual smoothness alone.

Interpretive limit: 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. This distinction separates numerical behavior from physical accuracy and model adequacy.

Shock

A discontinuous compressive wave satisfying conservation laws and an entropy condition. In this lecture it is used to address Why should a discretization conserve fluxes across cell boundaries?

Model connection: Read the term against Conserved variable and the governing relation \(\partial_t\mathbf U+\partial_x\mathbf F(\mathbf U)=0,\quad \mathbf U=(\rho,\rho u,E)^T\). The relevant computational evidence is a controlled output, residual, invariant, or refinement sequence rather than visual smoothness alone.

Interpretive limit: 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. This distinction separates numerical behavior from physical accuracy and model adequacy.

Problem and physical meaning

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.

Why should a discretization conserve fluxes across cell boundaries? Begin from the scientific observable or state variable, and name what is directly specified versus inferred. The model should be simple enough to validate, but not quietly presented as the entire astrophysical system.

Model and derivation

The governing expression for this lecture is:

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

Define the symbols and the independent variable before numerical evaluation. Dimensional analysis checks that both sides have matching units; if the model is dimensionless, state the adopted scale factors and the transformation back to physical units.

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.

Numerical implementation

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

Keep physical quantities and numerical arrays conceptually separate. Convert units at well-defined boundaries, preserve raw inputs, and record dtype, solver, tolerances/timestep, grid, and software versions. A numerical method is part of the model evidence, not an invisible implementation detail.

Worked, programmatically computed example

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).

These values are generated in src/astr474_computations.py, then shared with lecture/lab/assignment renderers. Re-run the generator after changing an input; do not hand-edit a displayed result without recomputing dependent artifacts.

At least one independent check is required: an analytic solution, a second numerical method, a conservation law, or a controlled convergence sequence. When these disagree, diagnose units, frame, discretization, source terms, and model scope before selecting a result.

Error budget and limitations

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.

Classify each uncertainty before combining terms: local/global solver error, timestep or spatial discretization, Monte Carlo sampling, parameter uncertainty, measurement uncertainty, and model discrepancy are not interchangeable. Conservation can test internal consistency but does not prove the model is physically complete.

Connection to evidence and research practice

Lab 04 uses a Sod shock tube with an explicit synthetic initial state, measured mass error, and resolution comparison.

For real parameters, the source record distinguishes the fetched product and epoch from derived values. For synthetic experiments, the initial conditions, generator, seed, and exact file are recorded. A simulation is not an observation, even when its parameters resemble a real object.

Misconceptions to avoid

Study and review questions

  1. Why should a discretization conserve fluxes across cell boundaries?
  2. Which numerical parameter would you vary first, what observable would you track, and how would you know the sequence reached an asymptotic regime?
  3. Design one independent check and state what failure would change your scientific interpretation.

Preparation for the next lecture: explain how this method's assumptions change when the problem becomes more coupled, stochastic, or data-driven.

Lecture-specific derivation and assumptions

In one dimension, mass conservation is partial_t rho + partial_x(rho*u)=0. Momentum conservation is partial_t(rho*u)+partial_x(rho*u^2+p)=0. Total energy E=p/(gamma-1)+rho*u^2/2 obeys partial_t E+partial_x[u(E+p)]=0 for an ideal gas without external sources. Combining the three conserved densities gives U=(rho,rho*u,E) and flux F=(rho*u,rho*u^2+p,u(E+p)). Across a shock, these equations hold in integral/weak form; entropy admissibility selects the physical branch.

Algorithm trace and computed-output interpretation

For the synthetic Sod initial discontinuity, compute sound speeds c=sqrt(gamma*p/rho) on both sides and the maximum signal speed used by the CFL condition. At every interface, a finite-volume method estimates a flux; adjacent cells receive equal and opposite flux contributions. Compare initial and final integrated mass and check rho>0 and p>0 after each update. The code's first-order Rusanov solver is a teaching implementation, not a multidimensional production code.

Computed result: 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).

Conservation follows from the shared interface flux and telescoping sum; positivity and entropy behavior do not follow automatically. Boundary fluxes matter: copying edge states is a specific zero-gradient treatment, not a universal outflow condition. The dimensionless shock tube supplies numerical-method evidence, not a calibrated astrophysical gas model.

Two-meeting teaching arc

Each weekly module is taught in two 75-minute meetings. The sequence below includes a formative check in each meeting and is intended to use the lecture's worked computation, not merely present it.

  1. Meeting 1 (75 min): 10 min shock motivation; 25 min derive mass/momentum/energy conservation; 20 min ideal-gas closure and flux vector; 15 min weak solutions and entropy; 5 min identify boundary data.
  2. Meeting 2 (75 min): 10 min recap; 20 min Sod Riemann states and signal speeds; 25 min trace one finite-volume update; 15 min positivity/conservation audit; 5 min list what a production solver adds.

Targeted study questions

  1. Show explicitly how the interface fluxes cancel in the sum over all cells.
  2. Which additional terms enter momentum and energy for a gravitating radiating gas?
  3. Why is a smooth shock profile not evidence that the entropy condition is satisfied?

References and provenance: course reference log. Generated 2026-09-27.