Skip to main content

differentiable (magneto)hydrodynamics for astrophysics in JAX

Project description

jf1uids - differentiable (magneto)hydrodynamics for astrophysics in JAX

[!WARNING]
This project is still an alpha version (but generally functional), updates might break examples. We are aiming for the first stable release in Fall 2025. The documentation might not reflect the current state of the code.

DOI

Features

  • 1D, 2D and 3D hydrodynamics and magnetohydrodynamics simulations
  • provably divergence free magnetic fields and provably positivity preserving hydrodynamics based on the approach of Pang and Wu (2024)
  • 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, stable at strong discontinuities
  • 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
  • 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

Showcase

Orszag-Tang Vortex 3D Collapse
Orszag-Tang Vortex 3D Collapse
Gradients Through Stellar Wind
Gradients Through Stellar Wind
Novel (Possibly) Conservative Self Gravity Scheme, Stable at Strong Discontinuities
Novel (Possibly) Conservative Self Gravity Scheme, Stable at Strong Discontinuities
Wind Parameter Optimization
Wind Parameter Optimization

Citable References

We have currently only published on the previous 1d-only version of this code.

Storcks, L., & Buck, T. (2024). Differentiable Conservative Radially Symmetric Fluid Simulations and Stellar Winds--jf1uids. arXiv preprint arXiv:2410.23093.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

jf1uids-0.2.9.tar.gz (57.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

jf1uids-0.2.9-py3-none-any.whl (82.6 kB view details)

Uploaded Python 3

File details

Details for the file jf1uids-0.2.9.tar.gz.

File metadata

  • Download URL: jf1uids-0.2.9.tar.gz
  • Upload date:
  • Size: 57.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.8.0-58-generic

File hashes

Hashes for jf1uids-0.2.9.tar.gz
Algorithm Hash digest
SHA256 14809549edb5e2c2304eaea294e8eb309806771fa08cb728dddbcaa2157946b7
MD5 6bc58f492b9fb16c3b8b4ae5a5719649
BLAKE2b-256 c5b192f8ce83e6159f8598055754da7f90595fcd7642d992380684efb8909e21

See more details on using hashes here.

File details

Details for the file jf1uids-0.2.9-py3-none-any.whl.

File metadata

  • Download URL: jf1uids-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 82.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.8.0-58-generic

File hashes

Hashes for jf1uids-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 44ed686736a06768df12a6d386385364c56b66ae78bc059900e022178451135d
MD5 51bdf818db2528d849a170019e8642cb
BLAKE2b-256 fd2375e04f2218857e7e88a983ba1721e554cb1c7d0a080dd7214a162553a72b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page