An Adjoint Method for Differentiable Fluid Simulation on Flow Maps
Zhiqi Li, Jinjin He, Barnabás Börcsök, Taiyuan Zhang, Duowen Chen, Tao Du, Ming C. Lin, Greg Turk, Bo Zhu
TL;DR
Differentiable fluid simulation over long horizons is hampered by error accumulation and memory demands when using conventional autodiff or adjoint methods. The authors introduce a flow-map–based adjoint solver in which forward and backward passes share the same bidirectional flow map, enabling direct, long-range gradient computation without differentiating intermediate numerical steps. A Long-Short Time-Sparse EFM representation further reduces computational cost while preserving vortex dynamics, achieving memory usage as low as $6.53$ GB at $192^3$ resolutions. The approach enables tasks such as vortex dynamics inference from videos, vortex control, and 3D shape morphing with high accuracy, demonstrating improved vortex preservation and volume conservation relative to prior methods.
Abstract
This paper presents a novel adjoint solver for differentiable fluid simulation based on bidirectional flow maps. Our key observation is that the forward fluid solver and its corresponding backward, adjoint solver share the same flow map as the forward simulation. In the forward pass, this map transports fluid impulse variables from the initial frame to the current frame to simulate vortical dynamics. In the backward pass, the same map propagates adjoint variables from the current frame back to the initial frame to compute gradients. This shared long-range map allows the accuracy of gradient computation to benefit directly from improvements in flow map construction. Building on this insight, we introduce a novel adjoint solver that solves the adjoint equations directly on the flow map, enabling long-range and accurate differentiation of incompressible flows without differentiating intermediate numerical steps or storing intermediate variables, as required in conventional adjoint methods. To further improve efficiency, we propose a long-short time-sparse flow map representation for evolving adjoint variables. Our approach has low memory usage, requiring only 6.53GB of data at a resolution of $192^3$ while preserving high accuracy in tracking vorticity, enabling new differentiable simulation tasks that require precise identification, prediction, and control of vortex dynamics.
