physicsnemo icon indicating copy to clipboard operation
physicsnemo copied to clipboard

Fea ext lagrangian MeshGraphNet

Open zongyi-li opened this issue 1 year ago • 1 comments

Modulus Pull Request for Lagrangian MeshGraphNet

Description

We implemented Meshgraphnet for particle-based simulation on the water dataset based on https://github.com/google-deepmind/deepmind-research/tree/master/learning_to_simulate in PyTorch. It demonstrates how to train a Graph Neural Network (GNN) for evaluation of the Lagrangian fluid.

In this project, we provide an example of Lagrangian mesh simulation for fluids. The Lagrangian mesh is particle-based, where vertices represent fluid particles and edges represent their interactions. Compared to an Eulerian mesh, where the mesh grid is fixed, a Lagrangian mesh is more flexible since it does not require tessellating the domain or aligning with boundaries.

As a result, Lagrangian meshes are well-suited for representing complex geometries and free-boundary problems, such as water splashes and object collisions. However, a drawback of the Lagrangian mesh is that it typically requires smaller time steps to maintain physically valid simulations.

The main code consists of dataloader, train, and inference

  • modulus/datapipes/gnn/lagrangian_dataset.py
  • examples/cfd/lagrangian_mgn/train.py
  • examples/cfd/lagrangian_mgn/inference.py

lagrangian_meshgraphnet

Checklist

  • [x] I am familiar with the Contributing Guidelines.
  • [x] New or existing tests cover these changes.
  • [x] The documentation is up to date with these changes.
  • [ ] The CHANGELOG.md is up to date with these changes.
  • [ ] An issue is linked to this pull request.

Dependencies

  • tensorflow to load the datasets

zongyi-li avatar Sep 06 '24 18:09 zongyi-li

This is really great! Was thinking that it would make sense to also have an example for lagrangian GNN based on DeepMind's paper... Great work!

michaltakac avatar Sep 16 '24 12:09 michaltakac

Thanks for the comments! I have just addressed them and added a unit test test/datapipes/test_lagrangian.py. Please take a look!

zongyi-li avatar Nov 04 '24 02:11 zongyi-li

/blossom-ci

mnabian avatar Nov 04 '24 16:11 mnabian

/blossom-ci

mnabian avatar Nov 05 '24 00:11 mnabian

/blossom-ci

mnabian avatar Nov 05 '24 17:11 mnabian

/blossom-ci

mnabian avatar Nov 05 '24 19:11 mnabian

/blossom-ci

mnabian avatar Nov 05 '24 20:11 mnabian

/blossom-ci

zongyi-li avatar Nov 05 '24 23:11 zongyi-li

/blossom-ci

mnabian avatar Nov 06 '24 00:11 mnabian

/blossom-ci

mnabian avatar Nov 06 '24 01:11 mnabian