This repository contains PyTorch implementations of meshgraphnets for flow around circular cylinder problem on the basic of PyG (pytorch geometric).
The original paper can be found as following:
Pfaff T, Fortunato M, Sanchez-Gonzalez A, et al. Learning mesh-based simulation with graph networks[J]. International Conference on Learning Representations (ICLR), 2021.
Some code of this repository refer to Differentiable Physics-informed Graph Networks.
- Jiang
- Zhang
- Chu
- Qian
- Li
- Wang
- h5py==3.6.0
- matplotlib==3.4.3
- numpy==1.21.1
- opencv_python==4.5.4.58
- Pillow==9.1.0
- torch==1.9.0+cu111
- torch_geometric==2.0.4
- torch_scatter==2.0.8
- tqdm==4.62.3
pip install -r requirements.txt
-
Download
cylinder_flow
dataset using the script https://github.com/deepmind/deepmind-research/blob/master/meshgraphnets/download_dataset.sh. -
Parse the downloaded dataset into
.h5
file using the tool parse_tfrecord.py -
Change the
dataset_dir
in train.py to your.h5
files. -
train the model by run
python train.py
. -
For test, run
rollout.py
, and the result pickle file will be saved at result folder, the you can run the render_results.py to generate result videos that can be saved at videos folder.
- Here are some examples, trained on
cylinder_flow
dataset.
- In addition, we use simulation software to generate new training data. The test results on our data are as following: