next up previous
Next: About this document ...

ASTR415/688C Spring 2005 Problem Set #7

Due May 20, 2005 (3:30 pm, no extensions)

This is an optional assignment for bonus credit only (10 marks).

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:

\frac{\partial \mathbf{u}}{\partial t} + \frac{\partial}{\partial x}
\mathbf{F}(\mathbf{u}) = \mathbf{0} ,


\mathbf{u} = \left(
\rho \\
\rho v \\ ...
... \rho v \\
\rho v^2 + p \\
(e + p)v
\end{array} \right) ,

and $\rho$ is the mass density, $v$ is the gas velocity (a scalar in this case), $p$ is the gas pressure, $e = \rho(\varepsilon +
\frac{1}{2}v^2)$ is the energy density, and $\varepsilon$ is the internal specific energy. Assume an ideal gas equation of state $p =
(\gamma - 1) \rho \varepsilon$, with adiabatic exponent $\gamma$ = 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 $\rho = 1$, $p = 1$ on the left and cool, rarefied gas with $\rho = 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 = \gamma p/\rho$). 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 $\rho$, $p$, $v$, and $\varepsilon$ 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 $\Delta
x$ assuming your domain ranges from 0 to 1 in $x$ with the discontinuity at $x = 0.5$, and choose $\Delta 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 with the Stone & Norman figure?

BONUS: Make a movie of the results!

next up previous
Next: About this document ...
Derek C. Richardson 2005-05-03