jf1uids - differentiable (magneto)hydrodynamics for astrophysics in JAX
Features
- 1D, 2D and 3D hydrodynamics and magnetohydrodynamics simulations
- a high-order finite difference constrained transport WENO MHD scheme following HOW-MHD by Seo & Ryu 2023 as well as the provably divergence free and provably positivity preserving finite volume approach of Pang and Wu (2024)
- for finite volume simulations the basic Lax-Friedrichs, HLL and HLLC Riemann solvers as well as the HLLC-LM (Fleischmann et al., 2020) and HYBRID-HLLC & AM-HLLC (Hu et al., 2025) (sequels to HLLC-LM) variants
- novel (possibly) conservative self gravity scheme, with improved stability at strong discontinuities (currently only available for the finite volume solver)
- spherically symmetric simulations such that mass and energy are conserved based on the scheme of Crittenden and Balachandar (2018)
- backwards and forwards differentiable with adaptive timestepping
- turbulent driving, simple stellar wind, simple radiative cooling modules
- easily extensible, all code is open source
Installation
jf1uids can be installed via pip
pip install jf1uids
Note that if JAX is not yet installed, only the CPU version of JAX will be installed
as a dependency. For a GPU-compatible installation of JAX, please refer to the
JAX installation guide.
Notebooks for Getting Started
- hydrodynamics
- magnetohydrodynamics
- self-gravity
- stellar wind
Showcase
| Magnetohydrodynamics simulation with driven turbulence at a resolution of 512³ cells in a fifth order CT MHD scheme run on 4 H200 GPUs. |
| Magnetohydrodynamics simulation with driven turbulence and stellar wind at a resolution of 512³ cells in a fifth order CT MHD scheme run on 4 H200 GPUs. |
| Orszag-Tang Vortex | 3D Collapse |
| Gradients Through Stellar Wind |
| Novel (Possibly) Conservative Self Gravity Scheme, Stable at Strong Discontinuities |
| Wind Parameter Optimization |
Citable References
We have currently only published on the previous 1d-only version of this code.
Metadata
Release files for jf1uids 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| jf1uids-0.4.0.tar.gz | 80.5 kB | Without provenance | Details for jf1uids-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| jf1uids-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for jf1uids-0.4.0-py3-none-any.whl |
Total release size: 194.2 kB
Release files / jf1uids-0.4.0.tar.gz
| Download URL | jf1uids-0.4.0.tar.gz |
|---|---|
| Size | 80.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
79bccf15bbad216ad3c98eccf81b7f1b9ced099b68194bc28cf4dcaf8650aac6
|
|
BLAKE2b-256 checksum How to use checksums |
319eb9b57db61cac0f3743cea8dea4c4924cb3c2731a94172850903e08e5fb4a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.12.3 Linux/6.8.0-60-generic
|
Release files / jf1uids-0.4.0-py3-none-any.whl
| Download URL | jf1uids-0.4.0-py3-none-any.whl |
|---|---|
| Size | 113.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
90041929bf7b07e1b770a9d9c8990445f6776918e62bb6e7891e74ddc4a7d7cb
|
|
BLAKE2b-256 checksum How to use checksums |
2582a1b533b4b9d83cec6960ffce9be03edea2b6ebc71b07a8e5a9d21359319e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.2.1 CPython/3.12.3 Linux/6.8.0-60-generic
|
Security for jf1uids 0.4.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.