Accelerating smoothed particle hydrodynamics with graph neural networks

29 February 2024

Joe O’Connor joined EPCC as a University of Edinburgh Chancellor’s Fellow last year. Here he gives an update on his work investigating the acceleration of simulation tools for marine energy systems.

Computational fluid dynamics (CFD) plays a vital role in engineering, science and understanding the natural environment. Traditional approaches to CFD rely on the construction of a mesh to discretise the problem domain and the governing equations are then solved at these discrete locations. Mesh-based methods are the backbone of CFD and form the basis of the most established and popular CFD techniques (e.g. finite difference/volume/element). However, the construction of the mesh presents a major bottleneck in the CFD workflow, requiring significant computational effort as well as expert human knowledge to generate a mesh that is appropriate for a given problem. As a result, mesh-based methods can be difficult to apply to certain classes of problems, particularly those involving complex/moving geometries.

Smoothed particle hydrodynamics

Smoothed particle hydrodynamics (SPH) is a meshless alternative to traditional CFD that foregoes the fixed mesh in favour of freely moving particles. Here, the domain is discretised via particles (rather than mesh nodes) and the particle-particle interactions determine the solution of the governing equations. The key difference between SPH and mesh-based methods is that the particles are free to advect with the flow according to the dynamics of the problem. This makes SPH very well suited to problems involving highly-deforming domains and violent free-surface flows [1], such as those encountered in marine/coastal applications and fuel sloshing problems, to name a few.

Fig 1: computer simulation

Above. Figure 1: SPH simulation of a violent free-surface flow with fluid-structure interaction. Reproduced from [1].

One of the major challenges with CFD is that accurate simulations are usually very expensive to compute and often require many days (sometimes weeks) to obtain on large-scale high-performance computing (HPC) systems. This is even more true for SPH, since the computational effort required per particle/node is higher for SPH than it is for traditional mesh-based CFD. As a result, significant research effort has been dedicated towards algorithmic developments and other techniques for accelerating CFD simulations [2].

Data-driven surrogate models

One of the most recent lines of research to accelerate CFD is using machine learning. Recent advances in deep learning have led to the development of data-driven surrogate models that approximate the high-fidelity CFD but are much faster to compute, enabling significant speedup over the full physics-based high-fidelity simulations. However, the bulk of the work in this area has so far focused mainly on traditional mesh-based CFD [3]. This is largely due to the unique challenges posed by particle-based techniques, such as irregular/unstructured particle distributions and dynamic connectivity between the particles.

Graph neural networks

Graph neural networks (GNNs) are a class of neural networks that show particular promise for particle-based CFD techniques, such as SPH. GNNs are naturally capable of handling unstructured data with dynamic connectivity and pairwise interactions, such as those encountered in SPH. Furthermore, the particle-particle interactions required to formulate the SPH operators are conceptually the same as the message passing and aggregation steps in GNNs. This structural similarity with SPH makes GNNs very appealing and by incorporating prior knowledge of the physics directly into the network architecture, GNNs offer improved generalisability with less data for learning SPH operators [4].

Fig 2: diagram

Above. Figure 2: SPH convolution operator is conceptually the same as message passing and aggregation on a graph.

Although the potential advantages are promising, the application of GNNs to SPH is still an emerging area of research, with very little quantitative validation and performance benchmarking, especially in the context of real-world applications. With this in mind, this work aims to investigate how GNNs can be adapted and applied to create low-cost data-driven surrogate models for particle-based CFD, with a focus on their performance and practical relevance for real-world engineering applications.

Investigating GNN

The early stages of this work have initially focused on implementing and testing some common GNN architectures, reproducing a previous study in this area [4], setting up some testing/benchmarking infrastructure to guide and inform future developments, and generating new datasets for training. Due to the nature of the problem, there are several open questions that require investigation:

  • How do existing GNN models perform for SPH?
  • What techniques can be incorporated to improve performance (e.g. physics-informed inductive biases)?
  • What techniques can be incorporated to enable large-scale real-world problems?
  • How can GNNs be extended to multiphysics problems (e.g. fluid-structure interaction)?
Fig 3: 2 computer simulations

Above. Figure 3: Comparison of true physics solver vs. GNN simulator for example problem.

Research towards answering these questions will enable the development of low-cost data-driven surrogate models for SPH. These can then be combined with high-fidelity SPH to generate novel mixed-fidelity models that combine the efficiency of low-fidelity surrogate models with the accuracy and robustness of high-fidelity SPH. Ultimately, this will enable larger, longer, and more detailed SPH simulations for real-world problems.

EPCC is an excellent environment in which to carry out this research, with world-leading expertise in HPC, machine learning, and computational modelling, as well as significant experience leading national projects relevant to this work. Furthermore, access to appropriate HPC capability is crucial to the success of this work and EPCC has been vital in providing this support. At the moment, during the early development phase, the NVIDIA V100 GPUs on the Cirrus system are perfectly adequate. However, for large-scale production-level training runs in later stages of the work, it may be necessary to use some of the more advanced (NVIDIA A100) and exotic (Cerebras CS-2) hardware provided by the Edinburgh International Data Facility (EIDF).

PhD opportunity

Finally, I’m currently looking for PhD students to work on this topic so if you are interested in doing a PhD and this area of research sounds exciting to you then please see Geometric Deep Learning for Particle-Based Computational Fluid Dynamics for more details.


[1] O'Connor, J. and Rogers, B.D. (2021). A Fluid-Structure Interaction Model for Free-Surface Flows and Flexible Structures using Smoothed Particle Hydrodynamics on a GPU. Journal of Fluids and Structures, 104, 103312

[2] O'Connor, J. Domínguez, J.M. Rogers, B.D. Lind, S.J. and Stansby, P.K. (2022). Eulerian Incompressible Smoothed Particle Hydrodynamics on Multiple GPUs. Computer Physics Communications, 273, 108263

[3] Kochkov, D. Smith, J.A. Alieva, A. Wang, Q. Brenner, M.P. and Hoyer, S. (2021). Machine learning-accelerated computational fluid dynamics. Proceedings of the National Academy of Sciences, 118(21)

[4] Sanchez-Gonzalez, A. Godwin, J. Pfaff, T. Ying, R. Leskovec, J. and Battaglia, P.E. (2020). Learning to Simulate Complex Physics with Graph Networks. Proceedings of the 37th International Conference on Machine Learning

Further reading

Investigating the acceleration of marine energy simulation tools


Dr Joe O'Connor
Joe O'Connor