{"id":13424762,"url":"https://github.com/python-hydro/pyro2","last_synced_at":"2026-03-12T19:43:56.230Z","repository":{"id":37335959,"uuid":"20570861","full_name":"python-hydro/pyro2","owner":"python-hydro","description":"A framework for hydrodynamics explorations and prototyping","archived":false,"fork":false,"pushed_at":"2026-02-01T00:50:57.000Z","size":150899,"stargazers_count":332,"open_issues_count":37,"forks_count":128,"subscribers_count":13,"default_branch":"main","last_synced_at":"2026-02-19T14:06:55.426Z","etag":null,"topics":["advection","astrophysical-simulation","finite-volume","finite-volume-methods","hydrodynamics","multigrid","pde","pyro","python","simulation","solver"],"latest_commit_sha":null,"homepage":"https://python-hydro.github.io/pyro2","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/python-hydro.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"code_of_conduct.md","threat_model":null,"audit":null,"citation":"CITATION.md","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":".zenodo.json","notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2014-06-06T16:41:40.000Z","updated_at":"2026-02-17T08:59:59.000Z","dependencies_parsed_at":"2025-01-18T19:26:30.374Z","dependency_job_id":"88733ace-2d3e-4a1c-a96c-5257aaf66365","html_url":"https://github.com/python-hydro/pyro2","commit_stats":{"total_commits":1506,"total_committers":21,"mean_commits":71.71428571428571,"dds":"0.12682602921646746","last_synced_commit":"3edc9fe518a14647dcfac20eaca5ec8dab14da56"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/python-hydro/pyro2","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-hydro%2Fpyro2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-hydro%2Fpyro2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-hydro%2Fpyro2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-hydro%2Fpyro2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/python-hydro","download_url":"https://codeload.github.com/python-hydro/pyro2/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/python-hydro%2Fpyro2/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29680147,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-21T11:29:27.227Z","status":"ssl_error","status_checked_at":"2026-02-21T11:29:20.292Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["advection","astrophysical-simulation","finite-volume","finite-volume-methods","hydrodynamics","multigrid","pde","pyro","python","simulation","solver"],"created_at":"2024-07-31T00:00:58.919Z","updated_at":"2026-03-12T19:43:56.217Z","avatar_url":"https://github.com/python-hydro.png","language":"Jupyter Notebook","readme":"[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)\n[![PyPI Version](https://img.shields.io/pypi/v/pyro-hydro)](https://pypi.org/project/pyro-hydro)\n[![pylint](https://github.com/python-hydro/pyro2/actions/workflows/pylint.yml/badge.svg)](https://github.com/python-hydro/pyro2/actions/workflows/pylint.yml)\n[![flake8](https://github.com/python-hydro/pyro2/actions/workflows/flake8.yml/badge.svg)](https://github.com/python-hydro/pyro2/actions/workflows/flake8.yml)\n[![pytest-all](https://github.com/python-hydro/pyro2/actions/workflows/pytest.yml/badge.svg)](https://github.com/python-hydro/pyro2/actions/workflows/pytest.yml)\n[![github pages](https://github.com/python-hydro/pyro2/actions/workflows/gh-pages.yml/badge.svg)](https://github.com/python-hydro/pyro2/actions/workflows/gh-pages.yml)\n\n[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/python-hydro/pyro2/main?filepath=examples%2Fexamples.ipynb)\n\n[![JOSS status](http://joss.theoj.org/papers/6d8b2f94e6d08a7b5d65e98a948dcad7/status.svg)](http://joss.theoj.org/papers/6d8b2f94e6d08a7b5d65e98a948dcad7)\n[![DOI](https://zenodo.org/badge/20570861.svg)](https://zenodo.org/badge/latestdoi/20570861)\n\n\n\n\n![pyro logo](www/logo.gif)\n\n*A simple python-based tutorial on computational methods for hydrodynamics*\n\npyro is a computational hydrodynamics code that presents\ntwo-dimensional solvers for advection, compressible hydrodynamics,\ndiffusion, incompressible hydrodynamics, and multigrid, all in a\nfinite-volume framework.  The code is mainly written in python and is\ndesigned with simplicity in mind.  The algorithms are written to\nencourage experimentation and allow for self-learning of these code\nmethods.\n\nThe latest version of pyro is always available at:\n\nhttps://github.com/python-hydro/pyro2\n\nThe project webpage, where you'll find documentation, plots, notes,\netc. is here:\n\nhttps://python-hydro.github.io/pyro2\n\n(Note: there is an outdated page at readthedocs.org that is no longer updated)\n\n\n## Table of Contents\n\n * [Getting started](#getting-started)\n * [Core Data Structures](#core-data-structures)\n * [Solvers](#solvers)\n * [Working with data](#working-with-data)\n * [Understanding the algorithms](#understanding-the-algorithms)\n * [Regression and unit testing](#regression-and-unit-testing)\n * [Acknowledgements](#acknowledgements)\n * [Getting help](#getting-help)\n\n\n## Getting started\n\n  - By default, we assume python 3.9 or later.\n\n  - We require `numpy`, `numba`, `matplotlib`, and `h5py` for running pyro\n    and `setuptools_scm` for the install.\n\n  - There are several ways to install pyro.  The simplest way is via\n    PyPI/pip:\n\n    ```\n    pip install pyro-hydro\n    ```\n\n    Alternately, you can install directly from source, via\n\n    ```\n    pip install .\n    ```\n\n    you can optionally add the `-e` argument to `install` if you are\n    planning on developing pyro solvers directly.\n\n  - Not all matplotlib backends allow for the interactive plotting as\n    pyro is run. One that does is the TkAgg backend. This can be made\n    the default by creating a file `~/.matplotlib/matplotlibrc` with\n    the content:\n\n       `backend: TkAgg`\n\n    You can check what backend is your current default in python via:\n\n      ```python\n      import matplotlib.pyplot\n      print matplotlib.pyplot.get_backend()\n      ```\n\n - If you want to run the unit tests, you need to have `pytest`\n   installed.\n\n - Finally, you can run a quick test of the advection solver:\n\n   ```\n   pyro_sim.py advection smooth inputs.smooth\n   ```\n\n   you should see a graphing window pop up with a smooth pulse\n   advecting diagonally through the periodic domain.\n\n\n## Core Data Structures\n\nThe main data structures that describe the grid and the data the lives\non the grid are described in a jupyter notebook:\n\nhttps://github.com/python-hydro/pyro2/blob/main/pyro/mesh/mesh-examples.ipynb\n\n\nMany of the methods here rely on multigrid.  The basic multigrid\nsolver is demonstrated in the juputer notebook:\n\nhttps://github.com/python-hydro/pyro2/blob/main/pyro/multigrid/multigrid-constant-coefficients.ipynb\n\n\n## Solvers\n\npyro provides the following solvers (all in 2-d):\n\n  - `advection`: a second-order unsplit linear advection solver.  This\n    uses characteristic tracing and corner coupling for the prediction\n    of the interface states.  This is the basic method to understand\n    hydrodynamics.\n\n  - `advection_fv4`: a fourth-order accurate finite-volume advection\n    solver that uses RK4 time integration.\n\n  - `advection_nonuniform`: a solver for advection with a non-uniform\n    velocity field.\n\n  - `advection_rk`: a second-order unsplit solver for linear advection\n    that uses Runge-Kutta integration instead of characteristic\n    tracing.\n\n  - `advection_weno`: a method-of-lines WENO solver for linear\n    advection.\n\n  - `burgers`: a second-order unsplit solver for invsicid Burgers'\n    equation.\n\n  - `burgers_viscous`: a second-order unsplit solver for viscous\n    Burgers' equation with constant-coefficient diffusion. It uses\n    Crank-Nicolson time-discretized solver for solving diffusion.\n\n  - `compressible`: a second-order unsplit solver for the Euler\n    equations of compressible hydrodynamics.  This uses characteristic\n    tracing and corner coupling for the prediction of the interface\n    states and a 2-shock or HLLC approximate Riemann solver.\n\n  - `compressible_fv4`: a fourth-order accurate finite-volume\n    compressible hydro solver that uses RK4 time integration.  This\n    is built from the method of McCourquodale and Colella (2011).\n\n  - `compressible_rk`: a second-order unsplit solver for Euler\n    equations that uses Runge-Kutta integration instead of\n    characteristic tracing.\n\n  - `compressible_sdc`: a fourth-order compressible solver, using\n    spectral-deferred correction (SDC) for the time integration.\n\n  - `diffusion`: a Crank-Nicolson time-discretized solver for the\n    constant-coefficient diffusion equation.\n\n  - `incompressible`: a second-order cell-centered approximate\n    projection method for the incompressible equations of\n    hydrodynamics.\n\n  - `incompressible_viscous`: an extension of the incompressible solver\n    including a diffusion term for viscosity.\n\n  - `lm_atm`: a solver for the equations of low Mach number\n    hydrodynamics for atmospheric flows.\n\n  - `lm_combustion`: (in development) a solver for the equations of\n    low Mach number hydrodynamics for smallscale combustion.\n\n  - `multigrid`: a cell-centered multigrid solver for a\n    constant-coefficient Helmholtz equation, as well as a\n    variable-coefficient Poisson equation (which inherits from the\n    constant-coefficient solver).\n\n  - `particles`: a solver for Lagrangian tracer particles.\n\n  - `swe`: a solver for the shallow water equations.\n\n\n## Working with data\n\nIn addition to the main pyro program, there are many analysis tools\nthat we describe here. Note: some problems write a report at the end\nof the simulation specifying the analysis routines that can be used\nwith their data.\n\n  - `pyro/util/compare.py`: this takes two simulation output files as\n    input and compares zone-by-zone for exact agreement. This is used\n    as part of the regression testing.\n\n      usage: `./compare.py file1 file2`\n\n  - `pyro/plot.py`: this takes the an output file as input and plots\n    the data using the solver's dovis method.\n\n      usage: `./plot.py file`\n\n  - `pyro/analysis/`\n\n      * `dam_compare.py`: this takes an output file from the shallow\n        water dam break problem and plots a slice through the domain\n        together with the analytic solution (calculated in the\n        script).\n\n         usage: `./dam_compare.py file`\n\n      * `gauss_diffusion_compare.py`: this is for the diffusion\n        solver's Gaussian diffusion problem. It takes a sequence of\n        output files as arguments, computes the angle-average, and the\n        plots the resulting points over the analytic solution for\n        comparison with the exact result.\n\n          usage: `./gauss_diffusion_compare.py file*`\n\n      * `incomp_converge_error.py`: this is for the incompressible\n        solver's converge problem. This takes a single output file as\n        input and compares the velocity field to the analytic\n        solution, reporting the L2 norm of the error.\n\n          usage: `./incomp_converge_error.py file`\n\n      * `plotvar.py`: this takes a single output file and a variable\n        name and plots the data for that variable.\n\n          usage: `./plotvar.py file variable`\n\n      * `sedov_compare.py`: this takes an output file from the\n        compressible Sedov problem, computes the angle-average profile\n        of the solution and plots it together with the analytic data\n        (read in from `cylindrical-sedov.out`).\n\n          usage: `./sedov_compare.py file`\n\n      * `smooth_error.py`: this takes an output file from the\n        advection solver's smooth problem and compares to the analytic\n        solution, outputting the L2 norm of the error.\n\n          usage: `./smooth_error.py file`\n\n      * `sod_compare.py`: this takes an output file from the\n        compressible Sod problem and plots a slice through the domain\n        over the analytic solution (read in from `sod-exact.out`).\n\n          usage: `./sod_compare.py file`\n\n\n## Understanding the algorithms\n\n  There is a set of notes that describe the background and details of\n  the algorithms that pyro implements:\n\n  http://open-astrophysics-bookshelf.github.io/numerical_exercises/\n\n  The source for these notes is also available on github:\n\n  https://github.com/Open-Astrophysics-Bookshelf/numerical_exercises\n\n\n## Regression and unit testing\n\n  The `pyro/test.py` script will run several of the problems (as well\n  as some stand-alone multigrid tests) and compare the solution to\n  stored benchmarks (in each solver's `tests/` subdirectory).  The\n  return value of the script is the number of tests that failed.\n\n  Unit tests are controlled by pytest and can be run simply via\n\n  ```\n  pytest\n  ```\n\n## Acknowledgements\n\n  If you use pyro in a class or workshop, please e-mail us to let us\n  know (we'd like to start listing these on the website).\n\n  If pyro was used for a publication, please cite the article found in\n  the `CITATION` file.\n\n\n## Getting help\n\n  We use github discussions as a way to ask about the code:\n\n  https://github.com/python-hydro/pyro2/discussions\n","funding_links":[],"categories":["Teaching and Exploration"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-hydro%2Fpyro2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpython-hydro%2Fpyro2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpython-hydro%2Fpyro2/lists"}