TL;DR
Pyro is a Python framework that simplifies the development and testing of hydrodynamics simulation methods through an object-oriented design that promotes reuse and rapid prototyping.
Contribution
It introduces a Python-based, object-oriented framework specifically tailored for hydrodynamics exploration and rapid method prototyping.
Findings
Facilitates quick development of hydrodynamics simulations.
Enhances reusability of core components.
Supports flexible exploration of hydrodynamics methods.
Abstract
pyro is a Python-based simulation framework designed for ease of implementation and exploration of hydrodynamics methods. It is built in a object-oriented fashion, allowing for the reuse of the core components and fast prototyping of new methods.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Code & Models
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
pyro: a framework for hydrodynamics explorations and prototyping
Alice Harpole
Michael Zingale
Ian Hawke
Taher Chegini
††margin:
DOI: \IfBeginWithhttps://doi.org/10.21105/joss.01265https://doi.org[\Url@FormatString](https://doi.org/10.21105/joss.01265)[10.21105/joss.01265](https://doi.org/10.21105/joss.01265)
Software
•
\IfBeginWith
https://github.com/openjournals/joss-reviews/issues/588https://doi.org[\Url@FormatString](https://github.com/openjournals/joss-reviews/issues/588)[Review](https://github.com/openjournals/joss-reviews/issues/588)
•
\IfBeginWith
https://github.com/python-hydro/pyro2https://doi.org[\Url@FormatString](https://github.com/python-hydro/pyro2)[Repository](https://github.com/python-hydro/pyro2)
•
\IfBeginWith
http://dx.doi.org/10.5281/zenodo.2575565https://doi.org[\Url@FormatString](http://dx.doi.org/10.5281/zenodo.2575565)[Archive](http://dx.doi.org/10.5281/zenodo.2575565)
**Submitted: 15 February 2019
Published: 22 March 2019**
**License
Authors of papers retain copyright and release the work under a Creative Commons Attribution 4.0 International License (\IfBeginWithhttp://creativecommons.org/licenses/by/4.0/https://doi.org[\Url@FormatString](http://creativecommons.org/licenses/by/4.0/)[CC-BY](http://creativecommons.org/licenses/by/4.0/)).**
Summary
\seqsplit
pyro is a Python-based simulation framework designed for ease of implementation and exploration of hydrodynamics methods. It is built in a object-oriented fashion, allowing for the reuse of the core components and fast prototyping of new methods.
The original goal of \seqsplitpyro was to learn hydrodynamics methods through example, and it still serves this goal. At Stony Brook, \seqsplitpyro is used with new undergraduate researchers in our group to introduce them to the ideas of computational hydrodynamics. But the current framework has evolved to the point where \seqsplitpyro is used for prototyping hydrodynamics solvers before implementing them into science codes. An example of this is the 4th-order compressible solver built on the ideas of spectral deferred corrections (the \seqsplitcompressible_sdc solver). This implementation was used as the model for the development of higher-order schemes in the Castro hydrodynamics code (Almgren et al. 2010). The low Mach number atmospheric solver (\seqsplitlm_atm) is based on the Maestro code (Nonaka et al. 2010) and the \seqsplitpyro implementation will be used to prototype new low Mach number algorithms before porting them to science codes.
In the time since the first \seqsplitpyro paper (Zingale 2014), the code has undergone considerable development, gained a large number of solvers, adopted unit testing through pytest and documentation through sphinx, and a number of new contributors. \seqsplitpyro’s functionality can now be accessed directly through a \seqsplitPyro() class, in addition to the original commandline script interface. This new interface in particular allows for easy use within Jupyter notebooks. We also now use HDF5 for output instead of Python’s \seqsplitpickle() function. Previously, we used Fortran to speed up some performance-critical portions of the code. These routines could be called by the main Python code by first compiling them using \seqsplitf2py. In the new version, we have replaced these Fortran routines by Python functions that are compiled at runtime by \seqsplitnumba. Consequently, \seqsplitpyro is now written entirely in Python.
The current \seqsplitpyro solvers are:
- •
linear advection (including a second-order unsplit CTU scheme, a method-of-lines piecewise linear solver⋆, a 4th-order finite-volume scheme⋆, a WENO method⋆, and advection with a non-uniform velocity field⋆)
- •
compressible hydrodynamics (including a second-order unsplit CTU scheme, a method-of-lines piecewise linear solver⋆, and two 4th-order finite-volume schemes, one with Runge-Kutta integration and the other using a spectral deferred corrections method⋆)
- •
diffusion using a second-order implicit discretization
- •
incompressible hydrodynamics using a second-order approximate projection method.
- •
low Mach number atmospheric solver⋆, using an approximate projection method.
- •
shallow water equations solver⋆
(solvers since the first \seqsplitpyro paper are marked with a ⋆). Also, new is support for Lagrangian tracer particles, which can be added to any solver that has a velocity field.
Acknowledgements
The work at Stony Brook was supported by DOE/Office of Nuclear Physics grant DE-FG02-87ER40317 and DOE grant DE-SC0017955.
References
Almgren, A. S., V. E. Beckner, J. B. Bell, M. S. Day, L. H. Howell, C. C. Joggerst, M. J. Lijewski, A. Nonaka, M. Singer, and M. Zingale. 2010. “CASTRO: A New Compressible Astrophysical Solver. I. Hydrodynamics and Self-gravity.” Astrophysical Journal 715 (June): 1221–38. doi:\IfBeginWithhttps://doi.org/10.1088/0004-637X/715/2/1221https://doi.org[\Url@FormatString](https://doi.org/10.1088/0004-637X/715/2/1221)[10.1088/0004-637X/715/2/1221](https://doi.org/10.1088/0004-637X/715/2/1221).
Nonaka, A., A. S. Almgren, J. B. Bell, M. J. Lijewski, C. M. Malone, and M. Zingale. 2010. “MAESTRO: An Adaptive Low Mach Number Hydrodynamics Algorithm for Stellar Flows.” Astrophysical Journal Supplement 188 (June): 358–83. doi:\IfBeginWithhttps://doi.org/10.1088/0067-0049/188/2/358https://doi.org[\Url@FormatString](https://doi.org/10.1088/0067-0049/188/2/358)[10.1088/0067-0049/188/2/358](https://doi.org/10.1088/0067-0049/188/2/358).
Zingale, M. 2014. “pyro: A teaching code for computational astrophysical hydrodynamics.” Astronomy and Computing 6 (October): 52–62. doi:\IfBeginWithhttps://doi.org/10.1016/j.ascom.2014.07.003https://doi.org[\Url@FormatString](https://doi.org/10.1016/j.ascom.2014.07.003)[10.1016/j.ascom.2014.07.003](https://doi.org/10.1016/j.ascom.2014.07.003).
