All Projects → google → jax-cfd

google / jax-cfd

Licence: Apache-2.0 license
Computational Fluid Dynamics in JAX

Programming Languages

Jupyter Notebook
11667 projects
python
139335 projects - #7 most used programming language

Labels

Projects that are alternatives of or similar to jax-cfd

lettuce
Computational Fluid Dynamics based on PyTorch and the Lattice Boltzmann Method
Stars: ✭ 74 (-81.45%)
Mutual labels:  cfd
Cfdpython
A sequence of Jupyter notebooks featuring the "12 Steps to Navier-Stokes" http://lorenabarba.com/
Stars: ✭ 2,180 (+446.37%)
Mutual labels:  cfd
CaNS
A code for fast, massively-parallel direct numerical simulations (DNS) of canonical flows
Stars: ✭ 144 (-63.91%)
Mutual labels:  cfd
fosolvers
FOSolverS: a Suite of Free & Open Source Solvers. A brief overview:
Stars: ✭ 24 (-93.98%)
Mutual labels:  cfd
CFD
Basic Computational Fluid Dynamics (CFD) schemes implemented in FORTRAN using Finite-Volume and Finite-Difference Methods. Sample simulations and figures are provided.
Stars: ✭ 89 (-77.69%)
Mutual labels:  cfd
Fluid2d
A versatile Python-Fortran CFD code that solves a large class of 2D flows
Stars: ✭ 49 (-87.72%)
Mutual labels:  cfd
TrainingTracks
Materials for training tracks for continua media - OpenFOAM, vortex method, and other
Stars: ✭ 59 (-85.21%)
Mutual labels:  cfd
alsvinn
The fast Finite Volume simulator with UQ support.
Stars: ✭ 22 (-94.49%)
Mutual labels:  cfd
SNaC
A multi-block solver for massively parallel direct numerical simulations (DNS) of fluid flows
Stars: ✭ 26 (-93.48%)
Mutual labels:  cfd
omd
JAX code for the paper "Control-Oriented Model-Based Reinforcement Learning with Implicit Differentiation"
Stars: ✭ 43 (-89.22%)
Mutual labels:  jax
Omega2D
Two-dimensional flow solver with GUI using vortex particle and boundary element methods
Stars: ✭ 17 (-95.74%)
Mutual labels:  cfd
2D-Elliptic-Mesh-Generator
2D orthogonal elliptic mesh generator which solves the Winslow partial differential equations
Stars: ✭ 36 (-90.98%)
Mutual labels:  cfd
graphsignal
Graphsignal Python agent
Stars: ✭ 158 (-60.4%)
Mutual labels:  jax
NGA2
Object-oriented multi-mesh version of the classic reacting turbulent multiphase flow solver
Stars: ✭ 25 (-93.73%)
Mutual labels:  cfd
ADAM
ADAM implements a collection of algorithms for calculating rigid-body dynamics in Jax, CasADi, PyTorch, and Numpy.
Stars: ✭ 51 (-87.22%)
Mutual labels:  jax
dafoam
DAFoam: Discrete Adjoint with OpenFOAM for High-fidelity Gradient-based Design Optimization
Stars: ✭ 86 (-78.45%)
Mutual labels:  cfd
magic
MagIC is a high-performance code that solves the magneto-hydrodynamics equations in rotating spherical shells
Stars: ✭ 67 (-83.21%)
Mutual labels:  cfd
jax-rl
JAX implementations of core Deep RL algorithms
Stars: ✭ 61 (-84.71%)
Mutual labels:  jax
parallel-non-linear-gaussian-smoothers
Companion code in JAX for the paper Parallel Iterated Extended and Sigma-Point Kalman Smoothers.
Stars: ✭ 17 (-95.74%)
Mutual labels:  jax
ccfd
A 2D finite volume CFD code, written in C
Stars: ✭ 26 (-93.48%)
Mutual labels:  cfd

JAX-CFD: Computational Fluid Dynamics in JAX

Authors: Dmitrii Kochkov, Jamie A. Smith, Peter Norgaard, Gideon Dresdner, Ayya Alieva, Stephan Hoyer

JAX-CFD is an experimental research project for exploring the potential of machine learning, automatic differentiation and hardware accelerators (GPU/TPU) for computational fluid dynamics. It is implemented in JAX.

To learn more about our general approach, read our paper Machine learning accelerated computational fluid dynamics (PNAS 2021).

Getting started

The "notebooks" directory contains several demonstrations of using the JAX-CFD code.

Organization

JAX-CFD is organized around sub-modules:

  • jax_cfd.base: core finite volume/difference methods for CFD, written in JAX.
  • jax_cfd.spectral: core pseudospectral methods for CFD, written in JAX.
  • jax_cfd.ml: machine learning augmented models for CFD, written in JAX and Haiku.
  • jax_cfd.data: data processing utilities for preparing, evaluating and post-processing data created with JAX-CFD, written in Xarray and Pillow.

A base install with pip install jax-cfd only requires NumPy, SciPy and JAX. To install dependencies for the other submodules, use pip install jax-cfd[ml], pip install jax-cfd[data] or pip install jax-cfd[complete].

Numerics

JAX-CFD is currently focused on unsteady turbulent flows:

  • Spatial discretization:
    • Finite volume/difference methods on a staggered grid (the "Arakawa C" or "MAC" grid) with pressure at the center of each cell and velocity components defined on corresponding faces.
    • Pseudospectral methods for vorticity which use anti-aliasing filtering techniques for non-linear terms to maintain stability.
  • Temporal discretization: Currently only first-order temporal discretization, using explicit time-stepping for advection and either implicit or explicit time-stepping for diffusion.
  • Pressure solves: Either CG or fast diagonalization with real-valued FFTs (suitable for periodic boundary conditions).
  • Boundary conditions: Currently only periodic boundary conditions are supported.
  • Advection: We implement 2nd order accurate "Van Leer" schemes.
  • Closures: We currently implement Smagorinsky eddy-viscosity models.

TODO: add a notebook explaining our numerical models in more depth.

In the long term, we're interested in expanding JAX-CFD to implement methods relevant for related research, e.g.,

  • Colocated grids
  • Alternative boundary conditions (e.g., non-periodic boundaries and immersed boundary methods)
  • Higher order time-stepping
  • Geometric multigrid
  • Steady state simulation (e.g., RANS)
  • Distributed simulations across multiple TPUs/GPUs

We would welcome collaboration on any of these! Please reach out (either on GitHub or by email) to coordinate before starting significant work.

Projects using JAX-CFD

Other awesome projects

Other differentiable CFD codes compatible with deep learning:

JAX for science:

Did we miss something? Please let us know!

Citation

If you use our finite volume method (FVM) or ML models, please cite:

@article{Kochkov2021-ML-CFD,
  author = {Kochkov, Dmitrii and Smith, Jamie A. and Alieva, Ayya and Wang, Qing and Brenner, Michael P. and Hoyer, Stephan},
  title = {Machine learning{\textendash}accelerated computational fluid dynamics},
  volume = {118},
  number = {21},
  elocation-id = {e2101784118},
  year = {2021},
  doi = {10.1073/pnas.2101784118},
  publisher = {National Academy of Sciences},
  issn = {0027-8424},
  URL = {https://www.pnas.org/content/118/21/e2101784118},
  eprint = {https://www.pnas.org/content/118/21/e2101784118.full.pdf},
  journal = {Proceedings of the National Academy of Sciences}
}

If you use our spectral code, please cite:

@article{Dresdner2022-Spectral-ML,
  doi = {10.48550/ARXIV.2207.00556},
  url = {https://arxiv.org/abs/2207.00556},
  author = {Dresdner, Gideon and Kochkov, Dmitrii and Norgaard, Peter and Zepeda-Núñez, Leonardo and Smith, Jamie A. and Brenner, Michael P. and Hoyer, Stephan},
  title = {Learning to correct spectral methods for simulating turbulent flows},
  publisher = {arXiv},
  year = {2022},
  copyright = {arXiv.org perpetual, non-exclusive license}
}

Local development

To locally install for development:

git clone https://github.com/google/jax-cfd.git
cd jax-cfd
pip install jaxlib
pip install -e ".[complete]"

Then to manually run the test suite:

pytest -n auto jax_cfd --dist=loadfile --ignore=jax_cfd/base/validation_test.py
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].