pyro is a simple set of 2-d hydrodynamics solvers written in Python/C. It serves as a framework to test solvers easily, and more will be added with time. Pyro is my 'coffeeshop code'---it is written in my spare time in order to learn some new techniques. It is not written for performance, but rather for ease of understanding/modification. It is also my first foray into python and numarray.
Currently, there are solvers for:
pyro uses the numarray package and HDF5, and requires gcc and python to run. Some parts are still a bit rough, but I am gradually moving toward writing the memory management and services in python and doing the heavy computation in C. Simple IDL routines are provided to help visualize--eventually I will try writing the visualization routines in python. The included Readme file details how to install and run pyro. A test suite is provided which provides automated regression testing.
Download not currently available (pyro was writting using the numarray package and needs to be converted over to the new numpy package for python. I just haven't had time to do this.
We test the overall convergence of the solver by setting up a density pulse with a Gaussian shape:
dens[i][j] = 1.0 + exp(-((x[i]-xctr)**2 + (y[j]-yctr)**2)/R**2)with R = 0.2. The pressure is constant everywhere, and the x- and y-velocities are equal to 1. This will advect the pulse diagonally across the grid. The timestep is held constant during the simulation, such that dt/dx is constant (and we are running at a constant Courant number).
The simulation is run with periodic boundary conditions until t=1.0 (one period) after which the L-2 error of the density is compared to the initial distribution. The graph below shows the error for the unsplit compressible solver as a function of resolution. The dashed line (dx**2 power law) shows that we are getting close to second order convergence.
We note that because this test was run with the slope limiters enabled, we expect some deviation from perfect dx**2 scaling.
Comparison of the unsplit compressible algorithm's solution to the Sedov point explosion test problem to the analytic solution (from Sedov 1959), using gamma = 1.4. This is a 256x256 zone domain, with an initial perturbation size of 0.005 cm. Subsampling was used (4x in each direction) in initializing the perturbation to get a more accurate realization of the circular perturbation in the zone averages of the rectangular grid. The comparison was made at t = 0.05 s.
The solid line is the analytic solution, taken from the tables in Sedov (1959), page 223. The analytic solution puts the shock position at r = C sqrt(t), where C is a constant close to 1. The diamonds are the radially binned numerical solution.
Comparison of an unsplit and Strang-split 2nd order Godunov scheme on a 4-shock problem. The unsplit algorithm follows Colella (JCP, 1990), using the 4th order MC limiters, the high-order transverse flux implementation, and the multi-dimensional flattening algorithm. The split version is a one-dimensional projection of this same algorithm.
Each run is 256x256 zones. Aside from the splitting, the two runs use identical parameters. The unsplit version maintains the symmetry very well, while the split version shows pronounced Kelvin-Helmholtz instabilities on the central plume. It is very asymmetric.
See Pawel Artymowicz's page with a very detailed exploration of dimensional splitting on this problem. Some of my investigations of splitting also further illustrate these differences.


unsplit (left) and split (right) density fields
pyro has a cell-centered multigrid solver, built off of the mesh class. Using the multigrid class, any Poisson equation can be solved in a few lines of code.
Below we see the L2 error of the numerical solution of
u_xx + u_yy = -2[(1-6x**2)y**2(1-y**2) + (1-6y**2)x**2(1-x**2)]with u = 0 on the boundary. The dotted line is second-order scaling.
The incompressible Euler equations are solved via an cell-centered approximate projection method. The results of a doubly periodic shear layer calculation are shown below. This is a work in progress.


Vorticity for a doubly periodic shear layer simulation on a 64x64 grid (left), 128x128 grid (center), and 256x256 grid (right) shown at t=1.0.
version 0.8 (2006-07-10)
version 0.61 (2005-09-13)
version 0.6 (2005-09-02)
version 0.51 (2005-08-15)
version 0.50 (2005-05-02)
version 0.42 (2005-03-26)
version 0.41 (2005-01-08)
version 0.40 (2004-10-06)
version 0.30 (2004-08-13)
version 0.20 (2004-07-13)
version 0.18 (2004-07-11)
version 0.15 (2004-05-24)
pyro comes with no warranty, explicit or implicit.