Figure 1. The Sod shock tube problem for a γ = 1.4 gas using
the PPM solver with 128 zones at t = 0.2s. The solid line is the exact
solution.

## Introduction

hydro1d is meant as a teaching code—written to help new
Astronomy / Astrophysics undergraduate and graduate students come up
to speed on the methods for solving the equations of hydrodynamics
that are popular in our field.

hydro1d solves the compressible Euler equations in a
finite-volume Godunov framework. A simple gamma-law gas is used.
Slopes are reconstructed using piecewise constant (Godunov), piecewise
linear, or piecewise parabolic (PPM) polynomials. *The emphasis in
the code is on readability and understanding the equations*, so
some steps are explicitly written out for clarity—performance is
a secondary consideration.

The code is written in Fortran (using some elements of Fortran 2003
and 2008). The included makefile is setup for gfortran.

Some basic problems are supplied, including a shock-tube (in
the `sod/` directory), and simple advection (`advect/`)
of a density pulse. The included `README` file explains how
to get started.

## Notes

Some notes on the piecewise linear and piecewise parabolic methods
for the Euler equations are available
here: CompHydroTutorial.pdf

For a 2-d hydrodynamics code (written mostly in python) written
as a teaching code, see the pyro2 code webpage

If you are interested in a production 3-d hydrodymamics code that
implements unsplit ppm, download the Castro Code

## Download

You can get `hydro1d` from github: hydro1d github page

## References

The following references help explain the methods used. Some of
these are multidimensional papers, but they explain the ideas behind
the reconstruction well.

Almgren,
A. S. et al.,
"CASTRO: A New Compressible Astrophysical Solver. I. Hydrodynamics and Self-Gravity", 2010, ApJ, 715, 1221.

Colella,
P., "Multidimensional Upwind Methods for Hyperbolic Conservation
Laws", 1990, J. Comp. Phys., 87, 1, 171-200.

Colella,
P. & Glaz, H.M., "Efficient solution algorithms for the Riemann problem
for real gases", 1985, J. Comp. Phys., 59, 2, 264-289.

Colella
P., Woodward, P.R., "The piecewise parabolic method (PPM) for
gas-dynamical simulations", 1984, J. Comp. Phys., 54, 1, 174-201.

Leveque, R. J., "Finite Volume Methods for Hyperbolic Problems", 2002,
Cambridge University Press.

Saltzman, J., "An Unsplit 3D Upwind Method for Hyperbolic Conservation Laws",
1994, J. Comp. Phys., 115, 1, 153-168.

You are welcome to use this code for any teaching purposes. Feedback and
an acknowledgement would be appreciated.

Send any comments / bug fixes to: Michael.Zingale AT stonybrook.edu

Acknowledgements: MZ thanks Ann Almgren, John Bell, and Andy Nonaka
for many helpful discussions over the years.