Table of Contents
Fetching ...

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.

An Adjoint Method for Differentiable Fluid Simulation on Flow Maps

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 GB at 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 while preserving high accuracy in tracking vorticity, enabling new differentiable simulation tasks that require precise identification, prediction, and control of vortex dynamics.

Paper Structure

This paper contains 32 sections, 19 equations, 15 figures, 3 tables, 2 algorithms.

Figures (15)

  • Figure 1: Vortex dynamics inference from velocity-field videos. Training on the first 4 seconds infers 8 random vortices, maintaining accuracy over extended 12-second predictions.
  • Figure 2: Vortex dynamics with obstacle interference. Method successfully infers vortices with vortex-obstacle interactions, enabling accurate long-term flow prediction around geometric constraints.
  • Figure 3: Method overview. In (a), we illustrate the symmetry between the forward and backward passes. The forward pass maps $\mathbf{u}$ using the backward flow map $\mathbf{\Psi}$, while the backward pass maps $\mathbf{u}^*$ using the forward flow map $\mathbf{\Phi}$. Both $\mathbf{\Psi}$ and $\mathbf{\Phi}$ are opposite to the flow direction and require repeated long-range integration for accuracy, leading to the original EFM’s $O(m^2)$ time complexity, where $m$ is the flow map length. In (b), we compare our method with other differentiable approaches. Due to lower accuracy, existing methods indirectly approximate $\mathbf{B} \to \hat{\mathbf{B}}$ (semi-transparent one-way arrows) through approximating $\mathbf{F} \to \hat{\mathbf{F}}$ (dashed one-way arrows) and directly differentiating $\hat{\mathbf{F}}$ (dashed double arrows). Although $\hat{\mathbf{B}}$ is consistent with $\hat{\mathbf{F}}$, $\mathbf{B} \to \hat{\mathbf{B}}$ is inaccurate. In contrast, our method leverages the strict correspondence between $\mathbf{F}$ and $\mathbf{B}$. We only need to construct accurate approximations $\mathbf{F}\to\mathbf{\hat{F}}$ and $\mathbf{B}\to\mathbf{\hat{B}}$ respectively (dashed double arrows), and the consistency between $\mathbf{\hat{F}}$ and $\mathbf{\hat{B}}$ then naturally follows through transitivity (semi-transparent dashed double arrows), enabled by the higher accuracy of flow maps.
  • Figure 4: 2D sequential optimizations. A sequence of 2D morphing tasks, including letter morphing ('G'→'R'→'A'→'P'→'H') and life-form evolution, demonstrating smooth transitions between target silhouettes. Each row illustrates the progressive transformation between two consecutive keyframes, with target shapes shown on the left.
  • Figure 5: Illustration of long-range flow map evolution in different methods. Let $m$ be the reinitialization interval, typically $m = 15 \sim 60$. (a) EFM computes $\mathbf{\Psi}_{t\to s'}$ at every time step by repeatedly evolving back to the previous reinit time. The number of steps crossed by each curve in the figure indicates the number of steps required for each flow map evolution, resulting in a total cost of $O(m^2)$. (b) Time-Sparse EFM computes $\mathbf{\Psi}_{t\to s'}$ only at reinit steps, reducing the cost to $O(m)$. (c)(d) Our improved Time-Sparse EFM introduces shorter intermediate flow maps between reinit steps to improve accuracy at intermediate times, while maintaining the overall cost at $O(m)$—specifically, doubling the number of flow map steps compared to (b).
  • ...and 10 more figures