JAX‐LaB: A High‐Performance, Differentiable Lattice Boltzmann Library for Modeling Multiphase Fluid Dynamics in Geosciences and Engineering

Abstract We introduce JAX‐LaB, a differentiable, Python‐based Lattice Boltzmann simulation library designed for modeling multiphase and multiphysics fluid dynamics problems in hydrologic, geologic, and engineered porous media settings. The library is designed as an extension to XLB (Ataei & Salehipour, 2024, https://doi.org/10.1016/j.cpc.2024.109187 ), and it is built on the JAX framework (Bradbury et al., 2018, http://github.com/jax‐ml/jax ). The library delivers a performant, hardware‐agnostic implementation that seamlessly integrates with machine learning libraries and scales efficiently across CPUs, multi‐GPU setups, and distributed environments. Multiphase interactions are modeled using the Shan‐Chen pseudopotential method, coupled with an equation of state (EOS) to reproduce densities consistent with Maxwell's construction, enabling accurate simulation of flows with density ratios while maintaining low spurious currents. Fluid wetting is achieved using the “improved” virtual density scheme (Q. Li et al., 2019, https://doi.org/10.1103/physreve.100.053313 ), which enables precise control of contact angle on flat and curved surfaces, while eliminating non‐physical films seen in the Shan‐Chen virtual density scheme. This scheme integrates directly into the interaction force calculations, removing the need to handle fluid‐fluid and fluid‐solid forces separately. We validate the library's accuracy and performance through comprehensive analytical benchmarks, including Laplace's law, capillary rise in parallel plates, and multi‐component cocurrent flow in a channel. We then use the code for several applications involving multicomponent and multiphase flows, including permeability estimation, injection of supercritical in a water‐saturated Fontainebleau sandstone, and obtaining the characteristic curves for a sphere pack geometry. Finally, the single‐GPU performance and multi‐GPU scaling of the code are evaluated on both single‐node and distributed systems. The library is open‐source under the Apache license and available at https://github.com/piyush‐ppradhan/JAX‐LaB .

Authors

Institutions

Publication Details

Journal
Journal of Advances in Modeling Earth Systems
Published
2026-02-01
DOI
https://doi.org/10.1029/2025ms005313
Citations
1
Primary Topic
Lattice Boltzmann Simulation Studies
Type
article
Field-Weighted Citation Impact
41.77
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

JAX‐LaB: A High‐Performance, Differentiable Lattice Boltzmann Library for Modeling Multiphase Fluid Dynamics in Geosciences and Engineering

S. Kelly, P. Gentine, Piyush Pradhan
1 citations
Journal of Advances in Modeling Earth Systems
Lattice Boltzmann Simulation Studies
41.77
article

JAX‐LaB: A High‐Performance, Differentiable Lattice Boltzmann Library for Modeling Multiphase Fluid Dynamics in Geosciences and Engineering

S. Kelly, P. Gentine, Piyush Pradhan
article en
1 citations

Abstract

Abstract We introduce JAX‐LaB, a differentiable, Python‐based Lattice Boltzmann simulation library designed for modeling multiphase and multiphysics fluid dynamics problems in hydrologic, geologic, and engineered porous media settings. The library is designed as an extension to XLB (Ataei & Salehipour, 2024, https://doi.org/10.1016/j.cpc.2024.109187 ), and it is built on the JAX framework (Bradbury et al., 2018, http://github.com/jax‐ml/jax ). The library delivers a performant, hardware‐agnostic implementation that seamlessly integrates with machine learning libraries and scales efficiently across CPUs, multi‐GPU setups, and distributed environments. Multiphase interactions are modeled using the Shan‐Chen pseudopotential method, coupled with an equation of state (EOS) to reproduce densities consistent with Maxwell's construction, enabling accurate simulation of flows with density ratios while maintaining low spurious currents. Fluid wetting is achieved using the “improved” virtual density scheme (Q. Li et al., 2019, https://doi.org/10.1103/physreve.100.053313 ), which enables precise control of contact angle on flat and curved surfaces, while eliminating non‐physical films seen in the Shan‐Chen virtual density scheme. This scheme integrates directly into the interaction force calculations, removing the need to handle fluid‐fluid and fluid‐solid forces separately. We validate the library's accuracy and performance through comprehensive analytical benchmarks, including Laplace's law, capillary rise in parallel plates, and multi‐component cocurrent flow in a channel. We then use the code for several applications involving multicomponent and multiphase flows, including permeability estimation, injection of supercritical in a water‐saturated Fontainebleau sandstone, and obtaining the characteristic curves for a sphere pack geometry. Finally, the single‐GPU performance and multi‐GPU scaling of the code are evaluated on both single‐node and distributed systems. The library is open‐source under the Apache license and available at https://github.com/piyush‐ppradhan/JAX‐LaB .

Journal of Advances in Modeling Earth SystemsVol. 18(2)
Columbia University (US)
Openalex Percentile: Top 1%
Lattice Boltzmann Simulation Studies
41.77
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.