Instructor solution key

Problem Set 04: Hydrodynamics and Resolution — Solutions

Separate from student-facing assignment

Problem 4.1: worked solution

Integrate each conservation law over a fixed interval and apply the divergence theorem. The conservative system is partial_t rho + partial_x(rho*u)=0; partial_t(rho*u)+partial_x(rho*u^2+p)=0; partial_t E+partial_x[u(E+p)]=0, where E=p/(gamma-1)+rho*u^2/2 for an ideal gas. Thus U=(rho,rho*u,E) and F=(rho*u,rho*u^2+p,u(E+p)). In finite volume, the net change in a cell is the incoming interface flux minus outgoing flux. Gravity adds momentum/energy source terms; radiation, magnetic fields, and viscosity alter the model. An equivalent integral derivation is acceptable if all conserved variables and closure assumptions are identified.

Problem 4.2: worked solution

The successive coarse-grid error ratios are 1.482, 1.654, 2.403. Results:

cellsL1 density difference vs 512previous/current ratiorelative mass error
320.03066019.26e-06
640.02069381.4821.64e-09
1280.0125141.6546.87e-13
2560.005208162.4030

Ratios near 2 are consistent with first-order error reduction but do not establish asymptotic order because the reference is also a diffusive 512-cell run and the discontinuities may remain under-resolved. Mass conservation is a separate diagnostic. A stronger alternative compares to an exact Sod Riemann solution at matching cell averages and final time.

Problem 4.3: worked solution

A release-quality audit should (a) assert rho>0 and p>0 after every update, (b) compare integrated mass change with boundary flux, (c) run a uniform-state/no-flow test to detect spurious evolution at boundaries, and (d) add at least two production features such as higher-order reconstruction with a limiter, multidimensional geometry, gravity/source-term coupling, robust boundary conditions, positivity-preserving flux treatment, and comparison to exact Riemann solutions. The present Rusanov code is first order, one-dimensional, and pedagogical. Accept other test cases when the failure they isolate is explained and measurable.

Scoring guide

Each problem is scored for model/setup (25%), correct computation or derivation (30%), validation and uncertainty (25%), and physical interpretation/communication (20%). Accept alternative correct methods when they meet the same evidence standard. See assessment instructions for error classification and resubmission guidance.