Lagrangian Fluid Simulation with Continuous Convolutions

Benjamin Ummenhofer, Lukas Prantl, Nils Thuerey, Vladlen Koltun

Introduction

Simulating fluids is a computationally expensive task. Traditional solvers like Smoothed Particle Hydrodynamics (SPH) are highly accurate but notoriously slow. Recently, researchers have turned to machine learning—specifically graph neural networks (GNNs)—to accelerate these simulations.

However, GNNs suffer from a fundamental mismatch with fluid physics. Fluids are continuous, volumetric processes, whereas GNNs rely on discrete "edges" to define interactions. Tracking, establishing, and breaking these binary connections as thousands of particles move is computationally heavy and often fails to capture the smooth, tightly coupled nature of fluid flow. To address this, this paper introduces a novel approach to Lagrangian (particle-based) fluid simulation by replacing traditional graph-based neural networks with continuous convolutions. By treating fluids as spatially continuous functions rather than discrete sets of connected nodes, this method achieves state-of-the-art accuracy and significantly faster inference speeds.

Methodology

The core innovation of this work is the Continuous Convolution (CConv) layer. Instead of the discrete grids used in standard ImageNet-style CNNs, this method allows for convolutions over unstructured point clouds.

  • Interpolated Filters: The authors use a regular grid to store filter values but apply trilinear interpolation to look up values at any arbitrary position. This keeps the representation compact and efficient while allowing it to handle particles that do not sit on a grid.
  • Ball-to-Cube Mapping: To avoid the mathematical singularities common in spherical coordinates, the authors employ a clever mapping to "wrap" a unit ball into a unit cube. This allows them to use standard 3D grid filters to represent spherical receptive fields.
  • Window Functions: Similar to traditional SPH solvers, the network uses a window function to ensure that the influence of a particle fades smoothly to zero at the edge of the receptive field. This prevents "jitter" or discontinuous jumps in particle movement.
  • Unified Boundary Handling: The network treats obstacles (like walls or containers) as sets of static particles. This allows the model to learn collision handling and fluid-solid interactions within the exact same convolutional framework.
Network Architecture

The final architecture is a relatively shallow 4-layer ConvNet that takes particle velocities and viscosities as input and predicts a position correction ($\Delta x$) to update the simulation.

Datasets and Evaluation

The authors evaluated their model on several challenging datasets to test its robustness and generalization:

  • Dam Break: A standard benchmark involving a block of fluid collapsing in a box.
  • DFSPH Dataset: A high-fidelity dataset generated by the authors using a Divergence-Free SPH solver, featuring 200 training scenes with complex multi-body collisions and 16-second long simulations.
  • Variable Viscosity Set: A specialized dataset with fluids of varying "thickness" to test the model's ability to generalize across different materials.
  • Generalization Scenes: Complex geometries like virtual rivers and waterfalls (not seen during training) to test the robustness of the learned physics.

Key Insights and Results

Moving away from explicit graph edges simplifies the network's job. The continuous convolution naturally aggregates neighbor information based on spatial distance, providing a much better inductive bias for fluid mechanics. Ablation studies showed that both linear interpolation of filters and the use of a window function were critical for maintaining stability and preventing noisy particle motion.

Furthermore, the authors used a weighted loss function that emphasizes particles with fewer neighbors (typically on the fluid's surface or near boundaries), which are the areas where visual fidelity and collision accuracy matter most. Because the entire simulator is a neural network, it is fully differentiable, allowing for "inverse physics" tasks like estimating hidden viscosity from a video of a fluid.

Simulation Comparison

The proposed method demonstrated exceptional performance across several metrics:

  • Speed: The method is remarkably fast. On the Dam Break dataset, it achieved an inference time of 12.01 ms per frame, compared to 202.56 ms for the state-of-the-art DPI-Nets—a nearly 17x speedup.
  • Accuracy: Despite the speed, it maintained lower position errors than all baselines (PCNN, SplineCNN, KPConv, etc.) across both datasets.
  • Stability: While many graph-based methods become unstable and "explode" after a few frames of complex interaction, this continuous convolution approach remained stable over long sequences.
  • Generalization: The model successfully simulated a waterfall and a river flowing over complex terrain, even though it was only trained on simple box-like containers.

Limitations and Future Work

The authors noted a minor limitation: their simulated particles fall slightly slower than the ground truth in some scenarios. This is likely due to the large timesteps used (0.02s) compared to the high-frequency integration used in the ground-truth solvers.

Future directions include extending this framework to handle rigid and deformable solids, potentially creating a unified "all-in-one" neural physics engine. They also suggest that learning the window function itself, rather than using a fixed one, could further improve simulation accuracy.

Summary updated

BibTeX
@inproceedings{ummenhofer2020lagrangian,
  author = {Benjamin Ummenhofer and Lukas Prantl and Nils Thuerey and Vladlen Koltun},
  title = {{Lagrangian Fluid Simulation with Continuous Convolutions}},
  booktitle = {International Conference on Learning Representations},
  year = {2020},
}
Figure