Docsity

1-D Fluid Dynamics Code with Lax or Two-Step Lax-Wendroff Schemes (Prob Set 7) - Prof. Der, Assignments of Astronomy

Toggle sidebar
bg1
ASTR615 Fall 2007 Problem Set #7
Due December 11, 2007
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
ρv2+p
(e+p)v
,
and ρis the mass density, vis the gas velocity (a scalar in this case), pis the gas pressure,
e=ρ(ε+1
2v2) 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 c2=γ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 xat time t= 0.245). HINT: let the
number of grid points Nin xbe a free parameter, set ∆xassuming your domain ranges from
0 to 1 in xwith the discontinuity at x= 0.5, and choose ∆tto 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!
1

Partial preview of the text

Download 1-D Fluid Dynamics Code with Lax or Two-Step Lax-Wendroff Schemes (Prob Set 7) - Prof. Der and more Assignments Astronomy in PDF only on Docsity!

ASTR615 Fall 2007 Problem Set

Due December 11, 2007

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!