Published April 23, 2026 | Version v1.1
Preprint Open

Differentiable Lattice Boltzmann Simulation with Second-Order Boundary Conditions for Gradient-Based Shape Optimisation

Authors/Creators

Description

I present a fully differentiable D3Q19 Lattice Boltzmann solver in JAX that supports gradient-based shape optimisation through second-order Bouzidi interpolated bounce-back boundary conditions. The Bouzidi fractional wall distances are computed via differentiable ray-surface intersection, providing a gradient path from obstacle geometry through the boundary treatment. This is the enabling difference: in the standard LBM formulation (halfway bounce-back with a binary solid mask) the drag is a piecewise-constant function of any smooth shape parameter, so the shape gradient is exactly zero almost everywhere and gradient-based optimisation is impossible without additional machinery. I verify directly that ∂Cd/∂r = 0 in that setting and non-zero under the Bouzidi pipeline. With a hard solid mask and Bouzidi q, Adam drives a physically plausible baseline (Cd = 1.77) down by 5.8% via radius shrinkage. Adding a sigmoid-smoothed solid representation provides an additional gradient path; I report its benefits and its pitfalls (degenerate optima that exploit the smoothing) and show that the resulting behaviour depends strongly on the sharpness parameter. Solver validation is via Poiseuille flow and a four-resolution sphere drag convergence study against the Clift, Grace, and Weber (1978) correlation at Re = 100, with time-averaged Cd converging to within 7%. Local gradient correctness is verified against finite differences in float64 to relative errors below 10⁻⁹.

Files

paper.pdf

Files (434.7 kB)

Name Size Download all
md5:8e328e9fdbfba54cb4484893cc212029
434.7 kB Preview Download

Additional details

Related works

Is supplemented by
Software: https://github.com/MarcosAsh/LBM_JAX_Autodiff (URL)