/graphs4cfd

Graph Neural Networks (GNN) based solvers for Computational Fluid Dynamics (CFD)

Primary LanguagePythonApache License 2.0Apache-2.0

Graphs4CFD

License: Apache 2.0

Graphs4CFD is a library built upon PyTorch and Pytorch Geometric (PyG) to code and train Graph Neural Networks (GNNs) based solvers for Computational Fluid Dynamics (CFD) applications.

Contents

Implemented GNN models

To date, Graphs4CFD supports the following GNN models:

Installation

Graphs4CFD requires Python 3.7 or higher and a version of PyTorch compatible with your CUDA version. We recomend installing Graphs4CFD and its dependencies in a virtual envioroment, e.g., using Anaconda or Miniconda. To install Graphs4CFD and its dependecies (except PyTorch), run the following commands:

git clone git@github.com:mario-linov/graphs4cfd.git
cd graphs4cfd
pip install -e .

This also installs PyG and compiles and installs PyTorch Cluster, so it may take a while. Once Graphs4CFD has been installed, it can be imported in Python as follows:

import graphs4cfd as gfd

Examples

There are examples of how to use Graphs4CFD for training and inference in the examples/ folder.

⚠️To clone the jupyter notebooks in the inference/ folder you need to have Git LFS installed. On Ubuntu, Git LFS can be installed painlessly by running:

curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | sudo bash
sudo apt-get install git-lfs

Cite

To cite Graphs4CFD, please use the following reference:

Mario Lino, Stathi Fotiadis, Anil A. Bharath, and Chris Cantwell. "Multi-scale rotation-equivariant graph neural networks for unsteady Eulerian fluid dynamics". Physics of Fluids, 34 (2022).

@article{lino2022multi,
    author = {Lino, Mario and Fotiadis, Stathi and Bharath, Anil A. and Cantwell, Chris},
    title = {{Multi-scale rotation-equivariant graph neural networks for unsteady Eulerian fluid dynamics}},
    journal = {Physics of Fluids},
    volume = {34},
    year = {2022},
    url = {https://doi.org/10.1063/5.0097679},
}