JAX-CFD
New1. Overview
JAX-CFD is a research codebase from Google Research that implements incompressible Navier-Stokes solvers in JAX, so the entire time-stepping loop is differentiable and can be JIT-compiled on accelerators. Its headline result, published in PNAS in 2021, is that a learned interpolation scheme inside the solver matched the accuracy of a standard numerical method while running roughly eighty times faster on direct numerical simulation and forty times faster on large-eddy simulation. This guide is written for three readers: a machine-learning engineer who wants end-to-end gradients through a fluid simulation for hybrid modelling; a CAE lead who needs to understand what the speedup claim actually covers before trusting it; and a reviewer checking a vendor claim that a differentiable solver "beats CFD". The companion guides on classical-solver cost boundaries and the neural-operator selection give the decision frameworks; this entry supplies the JAX-CFD-specific detail. All version and capability statements below were verified against the repository commit history, the PyPI release record and the PNAS paper on 11 November 2026, and any claim that is the project's own description rather than an independent measurement is labelled as such in Section 9.
The project is a differentiable solver and a research platform, not a production CFD product. It produces the gradients a hybrid model learns from and remains a reference for what differentiable simulation can and cannot do, sitting beside OpenFOAM for general CFD and SU2 for adjoint design optimization on a different contract. The repository's last commit was on 25 October 2026 and its last published release was 0.2.1 in 2024, which matters for anyone planning to depend on it. This entry explains what it actually provides, how its learned-interpolation result works, how it compares with neighbouring tools, where it fails, and how its version and maintenance claims should be reconciled, so that a PNAS speedup number is not mistaken for a general conclusion. After reading, you should be able to judge whether, in a concrete differentiable-physics project, JAX-CFD is the right starting point or only a reference to learn from.
2. How It Works
The solver uses a MAC staggered grid for the velocity and pressure, a standard arrangement that keeps the discrete divergence and gradient operators adjoint-consistent so the gradient through the pressure projection is correct. Advection is handled by a Van Leer limited scheme in the baseline numerical method, and subgrid turbulence is modelled with a Smagorinsky closure for the large-eddy-simulation configuration. Because everything is written in JAX, the forward step is compiled to efficient accelerator code by JIT, and automatic differentiation threads backward through the whole sequence of steps, which is what makes the gradient through the simulation exact with respect to that discrete scheme. That end-to-end differentiability is the project's core contribution relative to a conventional solver.
The PNAS result comes from replacing part of the numerical interpolation with a learned operator. The network is trained to reproduce the high-accuracy interpolation that a much finer grid would give, so the coarse solver with the learned piece matches the fine solver's accuracy at a fraction of the cost; the speedup is measured against a standard solver run to the same accuracy on CPU, not against a tuned accelerator code. The same differentiable loop also enables hybrid models where a neural network provides a learned correction term, gradient-based closure modelling, and turbulence-model discovery, because the loss can be differentiated through the simulation. The learned piece is only as good as its training distribution, and the project explicitly targets periodic domains with a single incompressible phase.
3. Scope and Assumptions
JAX-CFD assumes you bring a problem that fits its discretizations: incompressible flow on a periodic box, a single phase, and a resolution where a vanilla or learned interpolation scheme is acceptable. It is not a general CFD suite - there is no support for complex geometry, non-periodic boundaries, compressible flow, multiphase physics or turbulence modelling beyond the Smagorinsky closure, and a problem outside the periodic box is simply outside what the code provides. The learned-interpolation speedup is specific to the accuracy target and the CPU baseline used in the paper; running the same solver on a GPU already changes the comparison, and a different accuracy target changes the number.
Platform assumptions are concrete. The code is JAX and Python and depends on the JAX ecosystem and accelerator runtimes, which is the configuration that makes the differentiable loop fast. The Apache-2.0 licence permits commercial use and modification, which is a legal matter for the user's own review rather than a technical guarantee here. The framework's value is greatest inside the periodic-box regime it targets; it is not a substitute for a validated solver when the deliverable is a safety-critical component. A mismatch between the problem you hand it and the contract it supports is the most common source of disappointment, and the section on failure modes returns to this point with concrete examples of what a violated assumption looks like in practice.
4. Getting Started
Installation is documented as a pip install of the jax-cfd package, with the differentiable solvers and the learned-interpolation components imported from the library. A first experiment follows the documented workflow: define the periodic grid and the initial velocity field, choose the numerical or learned interpolation scheme, step the simulation, and differentiate a loss through the trajectory. The repository ships example notebooks and the companion JAX-CFD tutorial on this site walks through a minimal differentiable simulation as the fastest way to see a working configuration rather than starting from an empty script. The most frequent beginner failure is expecting non-periodic or complex-geometry support that the code does not implement, which leads to silent wrong answers rather than an error; checking the supported discretizations removes that confusion.
Before relying on a result, reproduce the project's own convergence check: confirm that a quantity of interest matches a fine-grid reference as the resolution increases, because if it does not, the problem is the scheme or the learned piece, not the optimizer. Then evaluate any hybrid model trained with JAX-CFD on a held-out configuration with an independent classical reference. The companion PhiFlow tutorial and the physics-based deep-learning material collect supporting detail, and the classical-solver cost-boundary guide organises when a differentiable solver is worth the compute. Record the version, the scheme and the random seed next to every result, because those three values are what make a result reproducible, and a result that cannot be reproduced cannot be defended to a customer.
5. Comparison with Alternatives
The useful comparison is by contract. OpenFOAM and SU2 are production finite-volume solvers for general and aerodynamic CFD, whereas JAX-CFD is a research differentiable solver for periodic incompressible flow. JAX-Fluids is a differentiable solver that covers compressible flow and is actively maintained, so teams that need differentiable compressible physics usually prefer it over the now-unmaintained JAX-CFD. PhiFlow is a differentiable physics framework with broader scope than JAX-CFD's single solver. FEniCS is a finite-element platform for solids and coupled physics, a different discretization and a different downstream use. NeuralOperator learns a map from coefficients to a solution field, which is a surrogate rather than a differentiable simulator and does not provide gradients through a time-stepping loop.
Within differentiable simulation, JAX-CFD's differentiator is the end-to-end gradient through the MAC-staggered incompressible solver and the PNAS learned-interpolation demonstration. A classical reduced-order model or a surrogate such as NeuralOperator can accelerate a repeated query once trained, but neither provides a gradient through the simulation. The classical-solver cost-boundary guide and the neural-operator selection guide keep these comparisons honest by stating the deliverable: a certified single solve, an interactive design sweep, or a surrogate that amortizes thousands of queries. A solver that wins on differentiable research may lose on a project where general geometry, compressible physics or maintenance continuity dominates.
6. Benchmarks and Evidence
Public evidence is largely the PNAS 2021 paper and the project's own example notebooks. The PNAS result reports that the learned-interpolation solver matched a standard method's accuracy while running about eighty times faster on direct numerical simulation and forty times faster on large-eddy simulation, measured against a CPU baseline at equal accuracy. The paper also shows that a differentiable hybrid model trained through the simulation improved coarse-grid predictions. These are the project's own capability statements, validated by peer review of the paper but not by an independent blind benchmark against a tuned accelerator code, and the comparison baseline is a CPU solver rather than a GPU-native one.
Independent work tempers the optimism. A review of seventy-six papers claiming machine learning beats classical solvers found that seventy-nine percent compared against a weak baseline, which is a reminder that any JAX-CFD speedup figure should be re-measured against a modern GPU solver at the same accuracy. A 2026 practitioner study found that classical linear reduced-order models stayed more accurate and equally fast as a neural surrogate under conditions favourable to linear methods. These are not reasons to reject JAX-CFD; they are reasons to treat any speedup as unverified until the baseline, accuracy, grid and hardware are stated. Any number used in a proposal should come from a local run whose scheme and version string are archived, following the same discipline used by the hydrogym flow-control case and the CFDBench dataset on this site.
7. Role in Physics-AI Workflows
In a production pipeline JAX-CFD sits at the differentiable end. It generates gradients for hybrid models that learn a correction term inside the solver, supplies differentiable trajectories for closure modelling and turbulence-model discovery, and remains a reference for what end-to-end differentiable simulation can do. The value concentrates in research and prototyping where gradients through the simulation are the point; on a periodic box it can answer inverse and optimization queries that a non-differentiable solver would need adjoint or finite-difference scaffolding for. Its credibility is bounded by the periodic-box regime and the single incompressible phase it supports.
JAX-CFD also fits into a longer verification chain. A classical solver remains the reference for correctness; a physics-informed model can supply residual corrections where labels are scarce, following the PINN landscape guide; a foundation-style model such as Poseidon can provide a pretrained starting point. None of these removes the need for an independent reference solve on held-out configurations. The physics-AI learning path on this site places these roles in sequence, and the fluid-simulation toolkit collection collects the underlying solvers. Because the project is unmaintained, any production use should pin a specific commit and vendor the code, rather than track a moving branch, and that discipline connects directly to the cost-boundary guide, because maintenance continuity is part of the real cost of a tool.
8. Limitations and Failure Modes
Discretization limits are the first failure mode. The code targets periodic boxes with a single incompressible phase, so complex geometry, non-periodic boundaries, compressible flow and multiphase physics are simply not represented; a user who applies it outside the box gets silent wrong answers, not an error. The learned-interpolation piece is only as good as its training distribution, and the Smagorinsky closure is a baseline subgrid model, so accuracy on a regime the network did not see can collapse without warning. End-to-end gradients through long trajectories accumulate the same truncation and stability issues as the forward scheme, so a gradient that looks smooth may still point the wrong way on a coarse grid.
There are practical limits too. The project is unmaintained: the last commit was on 25 October 2026 and the last release was 0.2.1 in 2024, so bug fixes, compatibility with newer JAX versions and security updates are the user's responsibility. JAX and accelerator runtimes evolve quickly, and an unpinned environment can break without notice. JAX-CFD does not provide certified accuracy or an audit trail on its own; when the deliverable must be defended, a classical high-fidelity solve or an experiment stays in the loop as the reference, and the cost-boundary guide explains why a deferral rule back to the solver belongs in the design. Relying on it for anything beyond research prototyping carries maintenance risk that should be stated explicitly.
9. Version and Source Notes
Record 1: JAX-CFD is an Apache-2.0 codebase published by Google Research at github.com/google/jax-cfd. Record 2: it is now unmaintained; the last commit to the repository was on 25 October 2026 and the last published release was version 0.2.1 in 2024, so any dependency on it should pin a specific commit. Record 3: the headline accuracy and speedup result was published in Kochkov et al., "Machine learning accelerated computational fluid dynamics", Proceedings of the National Academy of Sciences 118 (2021) e2101784118, with the speedup measured against a CPU baseline at equal accuracy (roughly 80x on DNS, 40x on LES). Record 4: the solver uses a MAC staggered grid, Van Leer advection, a Smagorinsky closure for LES, and periodic boundaries; it does not support non-periodic, compressible or multiphase flow.
Record 5 (reconciliation discipline): when citing the JAX-CFD speedup, the baseline (CPU solver, equal accuracy), the grid and the hardware must be recorded together, because the eight-fold-to-forty-fold number is meaningless without that context and should not be carried into a proposal as a general claim. The Apache-2.0 licence permits commercial use and modification, which is a licence description rather than legal advice. All records were verified on 11 November 2026 against the repository commit history, the PyPI release record and the PNAS paper; the speedup is the project's own peer-reviewed result rather than an independent blind benchmark. Because the project is unmaintained, the recommended citation for engineering use is a pinned commit hash rather than a floating branch.
10. References
- Google Research, "JAX-CFD: differentiable fluid dynamics in JAX", github.com/google/jax-cfd (accessed 11 November 2026).
- Kochkov D. et al., "Machine learning accelerated computational fluid dynamics", Proceedings of the National Academy of Sciences 118 (2021) e2101784118, arXiv:2102.01010.
- JAX-CFD development, "jax-cfd 0.2.1 PyPI release", PyPI (2024, accessed 11 November 2026).
- Bezgin G., Buhendwa A., Adams R. P., "JAX-FLUIDS: A fully-differentiable high-order computational fluid dynamics solver for compressible two-phase flows", Computer Physics Communications, arXiv:2203.13760 (2023).
- Holl P., Koltun V., Thuerey N., "Learning to Control PDEs with Differentiable Physics", ICLR 2020, arXiv:2001.07457.
- Exponax development team, "Exponax: exponential integrators for differentiable PDE simulation", GitHub (accessed 11 November 2026).
- Li Z. et al., "Fourier Neural Operator for Parametric Partial Differential Equations", ICLR 2021, arXiv:2010.08895.
- McGreivy N., Hakim A., "Weak baselines and reporting biases lead to overoptimism in machine learning for fluid-related partial differential equations", Nature Machine Intelligence (2024), arXiv:2407.07218.
- Takamoto M. et al., "PDEBench: An Extensive Benchmark for Scientific Machine Learning", NeurIPS 2022, arXiv:2210.07182.
- Vinuesa R., Brunton S. L., "Enhancing computational fluid dynamics with machine learning", Nature Computational Science 2 (2022) 358-366.