
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

Write a 1-D fluid dynamics code using either the Lax scheme or the two-step Lax-Wendroff scheme (extra credit if you do both!) to solve the fluid equations in conservative form:
∂u ∂t
∂x
F(u) = 0 ,
where
u =
ρ ρv e
(^) , F(u) =
ρv ρv^2 + p (e + p)v
and ρ is the mass density, v is the gas velocity (a scalar in this case), p is the gas pressure, e = ρ(ε + 12 v^2 ) is the energy density, and ε is the internal specific energy. Assume an ideal gas equation of state p = (γ − 1)ρε, with adiabatic exponent γ = 1.4 (corresponding to an ideal diatomic gas). Test your code by solving the classic 1-D “shock tube” problem (Sod 1978, J. Comput. Phys. 27 , 1). At t = 0 there is hot, dense gas with ρ = 1, p = 1 on the left and cool, rarefied gas with ρ = 0.125, p = 0.1 on the right. The initial gas speed is zero throughout (in these units, speed is normalized to the sound speed c, where c^2 = γp/ρ). This nonequilibrium situation results in a shock wave propagating right with a rarefaction wave propagating left. Compare your results at t = 0.245 with those shown in Stone & Norman 1992, ApJS 80 , 753, Fig. 11 (i.e., plot ρ, p, v, and ε as a function of x at time t = 0.245). HINT: let the number of grid points N in x be a free parameter, set ∆x assuming your domain ranges from 0 to 1 in x with the discontinuity at x = 0.5, and choose ∆t to safely satisfy the Courant condition. Don’t forget the boundary conditions! (You may assume neither wave reaches either boundary during the time interval simulated.) For what N (if any!) do you get a good match to the Stone & Norman figure?
BONUS: Make a movie of the results!