Learning Incompressible Fluid Dynamics from Scratch -- Towards Fast, Differentiable Fluid Models that Generalize

Nils Wandel, Michael Weinmann, Reinhard Klein · DOI

Abstract

Fast and stable fluid simulations are an essential prerequisite for applications ranging from computer-generated imagery to computer-aided design. However, solving the partial differential equations of incompressible fluids is a challenging task and traditional numerical approximation schemes come at high computational costs. Recent deep learning based approaches promise vast speed-ups but do not generalize to new fluid domains, require fluid simulation data for training, or rely on complex pipelines. In this work, we propose a novel physics-constrained training approach that generalizes to new fluid domains, requires no fluid simulation data, and allows convolutional neural networks to map a fluid state from time-point $t$ to a subsequent state at time $t + dt$ in a single forward pass. After training, the framework yields models capable of fast fluid simulations and various fluid phenomena including the Magnus effect and Karman vortex streets. Our models significantly outperform recent differentiable fluid solvers in terms of computational speed and accuracy.

Introduction

Simulating incompressible fluids involves solving the Navier-Stokes equations, a process traditionally dominated by computationally intensive numerical methods. While deep learning (DL) has emerged as a potential solution for real-time applications, existing models often struggle with data dependency, generalization to unseen geometries, and the strict enforcement of physical constraints like incompressibility. This paper introduces a framework to train neural fluid models from scratch by minimizing the residuals of the Navier-Stokes equations directly, bypassing the need for pre-simulated ground-truth data.

Methodology

The proposed approach centers on a physics-constrained unsupervised learning framework. Instead of predicting velocity fields directly, the network predicts a vector potential, ensuring the resulting flow is physically consistent.

The Vector Potential ($\vec{a}$-Net)

To guarantee incompressibility ($\nabla \cdot \vec{v} = 0$), the model predicts a vector potential $\vec{a}$ such that the velocity $\vec{v}$ is derived via the curl operator: $\vec{v} = \nabla \times \vec{a}$. This architectural choice "hard-codes" the divergence-free constraint into the network.

The a-Net architecture uses a U-Net to predict vector potential updates, ensuring incompressibility via a curl operation.

Unsupervised Training and Recycling

The model is trained using a loss function based on the residuals of the momentum and incompressibility equations. To enable training without external data, a "recycling" strategy is employed: the model's own predictions are fed back into a training pool, allowing it to learn from increasingly complex self-generated states. Periodic "cold starts" (resetting to zero velocity) ensure the model learns to initiate flow from rest and prevents overfitting to specific steady-state patterns.

Results and Discussion

The trained models demonstrate remarkable speed and fidelity across various test scenarios.

Performance and Generalization

The $\vec{a}$-Net achieves significant speedups compared to traditional differentiable solvers like PhiFlow, reaching up to 11x speedup on CPU and 40x on GPU. Despite being trained on simple randomized shapes like boxes and cylinders, the model generalizes effectively to complex, unseen geometries such as airfoils and car silhouettes.

Physical Fidelity

The model successfully reproduces sophisticated fluid phenomena. It captures Kármán vortex streets—the periodic shedding of vortices behind an obstacle—and the Magnus effect, where a spinning object experiences a lift force due to pressure differentials in the surrounding fluid.

The model successfully captures complex physical phenomena like the Magnus effect behind a spinning cylinder.

Differentiability and Optimal Control

As a fully differentiable neural network, the solver allows for backpropagation through the entire simulation. This capability was demonstrated in an optimal control experiment, where the model automatically adjusted inflow parameters to achieve a target vortex shedding frequency, outperforming existing differentiable solvers in both speed and accuracy.

Conclusion

This work presents a significant step toward fast, generalizable, and differentiable fluid models. By leveraging physics-constrained training and the vector potential trick, the authors eliminate the need for expensive training data while maintaining high physical accuracy. Future work will focus on extending these methods to 3D domains and higher Reynolds numbers to handle more turbulent flow regimes.

Summary updated

BibTeX
@inproceedings{wandel2021learning,
  author = {Nils Wandel and Michael Weinmann and Reinhard Klein},
  title = {{Learning Incompressible Fluid Dynamics from Scratch -- Towards Fast, Differentiable Fluid Models that Generalize}},
  booktitle = {International Conference on Learning Representations},
  year = {2021},
  url = {https://openreview.net/forum?id=tgzMpaj2xWe},
}
Figure