DiFVM puts an unstructured-mesh finite-volume solver on the GPU: one card beats 32-core OpenFOAM and still yields end-to-end gradients
Synopsis
DiFVM rewrites the complete finite-volume/PISO solution procedure on unstructured polyhedral meshes as vectorized scatter and gather operations over a static graph, giving GPU-native execution and end-to-end automatic differentiation in JAX/XLA. Existing differentiable CFD platforms mostly rely on Cartesian or structured grids and do not directly handle body-conforming complex geometries. On a single NVIDIA L40 GPU, DiFVM is faster than 32-core parallel OpenFOAM in every tested case, the largest with about 106 control volumes; differentiability is demonstrated by recovering a cavity lid velocity and inferring six Windkessel parameters simultaneously.
Interpretation
Incompressible flow on unstructured polyhedral meshes can now be solved end to end with differentiability on a GPU, without traversing cells one at a time to handle irregular cell-to-face connectivity. Earlier differentiable CFD frameworks, including JAX-CFD, JAX-Fluids, WaterLily, PICT and Diff-FlowFSI, discretize space mainly on Cartesian or structured representations, where connectivity is encoded by regular tensor indices and fixed stencils, so they do not directly support body-conforming unstructured meshes. Under identical meshes, boundary conditions and numerical settings, DiFVM is compared with OpenFOAM on a three-dimensional Poisson problem, two-dimensional passive scalar advection, lid-driven cavity flow, flow past a cylinder and a patient-specific aortic geometry; on a single NVIDIA L40 GPU, DiFVM is faster than 32-core parallel OpenFOAM in all cases, about 25 to 33 times faster than a single CPU core and about 2 times faster than 32 cores on medium-to-large transient problems.
All finite-volume operators are written as message-passing primitives on the mesh connectivity graph: cells are nodes, cell interfaces are edges, flux evaluation is a parallel node-to-edge gather, and conservative accumulation is an edge-to-node scatter sum. This rewrite only reorganizes how the finite-volume discretization is evaluated and assembled; it introduces no additional numerical approximation, and conservation, consistency and spatial accuracy are inherited from the underlying finite-volume scheme. Validation includes convergence-order fits on an analytical Poisson problem, comparisons with published benchmarks such as Ghia et al. and with several independent solvers, mesh-quality and time-step sensitivity studies, and an independent cross-solver comparison with SimVascular on pulsatile aortic flow; in the inverse demonstration, all six Windkessel parameters converge to within 1% of ground truth after gradients pass through 6000 time steps.
Perspective
The demonstrated scope is unstructured polyhedral meshes for incompressible Newtonian flow in rigid-wall domains, including differentiable three-element Windkessel outlet boundary conditions for cardiovascular applications; performance figures come from a single NVIDIA L40 GPU, with the largest benchmark at about 106 control volumes.
Reverse-mode sensitivities can decay or amplify over long horizons depending on flow dynamics, temporal discretization, parameterization and simulation length, and the graph rewrite does not change this conditioning. The inverse examples generate observations with the same governing model used for inference, so they do not characterize errors from model mismatch, uncertain constitutive assumptions or partially incorrect boundary conditions; differentiability supplies gradients but does not guarantee that parameters are uniquely identifiable from limited observations. Multi-GPU and multi-node scaling has not been implemented or evaluated.
