Fluid Simulation System Based on Graph Neural Network

Qiang Liu, Wei Zhu, Xiyu Jia, Feng Ma, Yu GaoarXiv 2022 · DOI

Abstract

Traditional computational fluid dynamics (CFD) calculates the physical information of the flow field by solving partial differential equations, which takes a long time and consumes significant computational resources. We present a fluid simulation simulator based on a graph neural network (GNN) architecture designed for high speed and low resource consumption. By treating the computational domain as a structural graph and employing adaptive sampling for neighbor selection, the system leverages Graph Attention Networks (GAT) to learn complex physical relationships. The simulator is trained on flow field data around cylinders with varying Reynolds numbers. Results show high accuracy for both training set predictions and extrapolation to unseen flow fields. Compared to traditional CFD solvers, this simulator achieves a speedup of 2-3 orders of magnitude, providing new avenues for rapid optimization and real-time intelligent fluid control.

Introduction

Computational Fluid Dynamics is the backbone of modern engineering, yet traditional methods rely on solving complex partial differential equations (PDEs) like the Navier-Stokes equations. This process is notoriously slow, often requiring supercomputers for high-resolution tasks. As fields like bionic fluid power and real-time control emerge, there is a critical need for "agile" fluid engineering—simulations that occur in milliseconds rather than hours. This paper explores how GNNs can bridge this gap by learning to mimic flow physics without the heavy lifting of iterative PDE solvers.

Methodology

The proposed simulator utilizes a Graph Attention Network (GAT) architecture. The fluid domain is discretized into nodes representing spatial points, forming a structural graph.

Comparison with Traditional CFD

The GNN approach draws a mathematical parallel to traditional numerical methods. In CFD, physical information is transferred between grid cells via discretized PDEs. Similarly, GNNs aggregate information from neighboring nodes to update a node's state.

Comparison between the GAT aggregation process and traditional CFD numerical solvers.

As shown in Figure 2, the GAT model uses multi-head attention to capture the coupled relationships between physical quantities like pressure and velocity. An 8-layer architecture with residual connections is employed to balance the learning of deep physical patterns with the preservation of shallow geometric features.

Adaptive Sampling Strategy

A key innovation is the adaptive sampling mechanism. Standard GNNs often look at a fixed number of neighbors, which can "average out" sharp physical gradients near walls or obstacles. Instead, this system selects neighbors within a specific spatial radius ($r$).

Visualization of the adaptive sampling mechanism, showing neighbor selection within a spatial radius to capture multi-scale flow features.

This strategy, illustrated in Figure 4, allows the model to capture multi-scale physical information effectively. Furthermore, the system employs a "sampling-aggregation" trick for super-resolution, allowing it to be trained on low-resolution data and applied to high-resolution grids, significantly boosting efficiency.

Results and Discussion

The model was evaluated using challenging benchmarks, including 2D/3D circular cylinder flows, stenosis, and complex 3D aneurysm geometries.

  • Speed: The simulator achieved a speedup of 100x to 1000x compared to traditional CFD solvers.
  • Accuracy: In 2D cylinder flow tests, the model achieved L2 relative errors as low as 0.0128 for velocity and 0.0148 for pressure, outperforming standard GCN and GraphSAGE models.
  • Generalization: The model successfully extrapolated flow fields outside its training set, proving it learns underlying physical laws rather than merely memorizing data.

Conclusion

The GNN-based fluid simulator offers a high-performance alternative to traditional CFD for applications requiring rapid feedback. While the model shows some limitations in predicting concentration and fine-scale 3D details compared to "Hidden Fluid Mechanics" (HFM) models, future work will focus on incorporating physics-informed loss functions. By punishing the loss function when predictions violate the Navier-Stokes equations, the simulator can become even more physically consistent and explanatory.

Summary updated

BibTeX
@misc{liu2022fluid,
  author = {Qiang Liu and Wei Zhu and Xiyu Jia and Feng Ma and Yu Gao},
  title = {{Fluid Simulation System Based on Graph Neural Network}},
  year = {2022},
  eprint = {2202.12619},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2202.12619},
}
Figure