Skip to content

Repository for the paper 'Graph neural networks for laminar flow prediction around random 2D shapes'

License

Notifications You must be signed in to change notification settings

junfeng-chen/graph_cfd_supervised

Repository files navigation

This is the git repository for the paper 'Graph neural networks for laminar flow prediction around random 2D shapes' architecture

The proposed graph convolutional neural network works on triangular meshes. It takes the coordinates of nodes and the binary encoding of the solid surface as the inputs. It predicts velocity and pressure fields around random 2D shapes at a low Reynolds number. Compare to U-nets, the graph models have higher accuracy, require fewer trainable parameters, take longer time for training.

The data set contains 2000 random 2D obstacles, together with the laminar velocity and pressure field. It was also used in the articles by:

The entire project are has been validated in Ubuntu 20.04. To reproduce the results, it is preferred to creat a virtual environment with python==3.6.9, and install the packages listed in requirements.txt.

Structure of the repository

  • dataset_utils : functions concerning the data
  • network_utils : functions and classes concerning the convolutional blocks and network architecture
  • params : directions, network hyper-parameters etc..
  • predict : get the flow prediction and drag force of a cylinder or a NACA0012 airfoil
  • predict_testset: get the flow prediction and drag force of all the shapes in the test set
  • training : the main function for training a neural network
  • training_utils : functions used for custom training loops
  • best_model : save model parameters during the training process

Model training

To train a model, run

python3 training.py

Network hyper-parameters are configurable in

params.py

Network architecture is defined in

network_utils.py

To do prediction on the cylinder or the naca0012 airfoil, run

predict.py

cylinder

About

Repository for the paper 'Graph neural networks for laminar flow prediction around random 2D shapes'

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages