DualFluidNet: An Attention-Based Dual-Pipeline Network for Fluid Simulation
Background and Motivation
Understanding fluid motion is crucial for comprehension of our environment and our interactions with it in the field of physics. However, traditional fluid simulation methods face limitations in practical applications due to high computational demands. In recent years, physics-driven neural networks have emerged as a promising data-driven approach to understanding complex natural phenomena. Inspired by the Smooth Particle Hydrodynamics (SPH) method, the authors of this paper propose a dual-pipeline network architecture based on the attention mechanism, called DualFluidNet, to address the balance between global control in fluid simulation and physical law constraints.
Paper Information Source
This paper is written by Yu Chen, Shuai Zheng, Menglong Jin, Yan Chang, and Nianyi Wang from the School of Software Engineering at Xi’an Jiaotong University. It is published in the 2024 issue of the journal Neural Networks. The paper proposes and explores an innovative 3D fluid simulation method.
Research Methods and Process
Methods and Process
Dual-Pipeline Network Architecture
The proposed network architecture consists of two parallel pipelines: the main path and the constraint-guided path. These two paths share a similar structure, with each consisting of a type-aware input module and a continuous sequence of convolutions (depth of five). The main path uses continuous convolution (CConv) to establish global context and stabilize fluid, while the constraint-guided path uses antisymmetric continuous convolution (ASCC) to ensure momentum conservation.
The definition of CConv convolution at position $\mathbf{x}$ is: [CConvg = (f ∗ g) (𝑥) = \sum{i∈\mathcal{N}(x,R)} a(x_i, x) f_ig (\Lambda (xi − x))] The definition of ASCC convolution is: [ASCC{g_s} = (f ∗ gs) (𝑥) = \sum{i∈\mathcal{N}(x,R)} a(x_i, x)(f + f_i) g_s (\Lambda (x_i − x))]
Attention Mechanism Feature Fusion
In each layer of the convolution sequence, features from the main path and the constraint-guided path are fused through an attention fusion module. The fusion method is as follows: [f{fusion} = 𝑆(\phi(f{main})⊕\phi(f{cons}))⊗ f{cons} + (1 − 𝑆(\phi(f{main})⊕\phi(f{cons})))⊗ f_{main}]
Here, $\phi$ represents the CConv function, and $S$ represents the particle selector, which fuses characteristics from the two paths by selecting feature weights.
Type-Aware Input Module
The type-aware input module (TAIM) aims to better distinguish between fluid and solid particles in the input, enhancing the computation accuracy of collision interactions between them. It involves two stages of feature fusion, using antisymmetric continuous convolution (ASCC): [f{coup}^{(1)} = S(\psi(f{fluid}) ⊕ \psi(f{solid})) ⊗ f{fluid} + (1 − S(\psi(f{fluid}) ⊕ \psi(f{solid}))) ⊗ f{solid}] [f{coup}^{(2)} = S(f{coup}^{(1)})⊗ f{fluid} + (1 − S(f{coup}^{(1)})) ⊗ f{solid}]
Dataset and Experimental Design
To validate the method, the authors introduced a new dataset called Tank3D, and also used the Liquid3D and Dambreak datasets for experiments. The Tank3D dataset is dedicated to more complex scene testing. All experiments were conducted using the PyTorch framework on an NVIDIA RTX 3090ti, employing the Adam optimizer with an initial learning rate of 0.002, and a total of 50,000 training iterations.
Research Results
Quantitative Evaluation
On the Liquid3D and Dambreak datasets, DualFluidNet showcased superior performance concerning position error, Wasserstein distance, maximum density error, and other metrics. The specific data are shown in the table below:
Method | Avg Pos Error (t+1) | Avg Pos Error (t+2) | Avg Distance (d_n) | Wasserstein Distance | Max Density Error | Frame Inference Time |
---|---|---|---|---|---|---|
DFSPh | - | - | - | - | - | >=1000 |
DPINets | 26.01 | 50.67 | unstable | - | unstable | 305.55 |
KPConv | 1.65 | 4.54 | unstable | - | unstable | 57.89 |
PCNN | 0.64 | 1.87 | 32.50 | 0.33 | 0.15 | 187.34 |
Regression Forests | 0.68 | 1.97 | 38.47 | 0.29 | 0.13 | 12.98 |
CConv | 0.60 | 1.55 | 30.09 | 0.26 | 0.12 | 16.47 |
DMCF | 0.65 | 1.89 | 32.89 | 0.21 | 0.07 | 94.86 |
Ours | 0.43 | 1.16 | 28.32 | 0.17 | 0.06 | 48.01 |
Qualitative Evaluation
Visual evaluation on the Liquid3D dataset shows that DualFluidNet can more accurately adhere to physical laws during the process of free-falling fluid colliding with the container’s bottom. The particle morphology remains stable, and the overall simulation result is close to reality. In contrast, the CConv method becomes deformed starting from the second frame, while the DMCF method, although adhering to physical laws during the free-fall stage, has poor global fluid control ability, prone to deformation at the edges.
Performance in Complex Scenarios
In complex scenarios of the Tank3D dataset, DualFluidNet exhibits outstanding handling capabilities and adherence to physical laws. Test results in rotation invariance and complex terrain scenarios indicate that DualFluidNet can accurately predict fluid motions, showing significant advantages over traditional methods.
Conclusion and Significance
The attention-based dual-pipeline network architecture proposed in this paper excels in fluid simulation, capable of stabilizing global fluid control and ensuring physical law constraints. Additionally, the designed type-aware input module plays a key role in fluid-solid coupling. The newly introduced Tank3D dataset provides an effective benchmark for further exploring the network’s performance in more complex scenarios. This research not only achieves significant improvements in quantitative metrics but also represents a qualitative leap in neural network-based simulation. Therefore, this research is of great significance for real-time simulation, interactive game environments, and virtual reality simulations.
The innovative architecture and methods of DualFluidNet bring new hope to the field of fluid simulation, and future research can continue to explore its potential in real-world physics learning.