This repository shows an original model adapted from Transformers [1] for solving the RANS equations, based on the LIPS framework [2] and the Airfrans Dataset [3].
The study provided here is part of the ML4physim challenge hosted by IRT-Systemx (see Codabench page). CFD simulations being very costly, the use of data-driven surrogate models can be useful to optimize the shape of airfoils without paying the cost of expensive simulations.
SsBT are modified version of transformer networks, where for each simulations, the query tokens are only attended to a subsampled set of key tokens from the pointcloud of the simulation which we call the skeleton of the mesh. It uses a hybrid approach on decoder-only models where both the input to be regressed and the tokens to attend to are jointly transformed.
The best model's implementation is locateed in the subsampled_bi_transformers/bi_transformer folder, and can be ran using the run.py file.
This model got us the
conda create --name ml4science python=3.9
conda activate ml4science
Download the LIPS repository in the src folder
git clone https://github.com/IRT-SystemX/LIPS.git
Then remove the numpy and scipy requirement from the setup.py file to avoid conflicts.
cd LIPS
pip install -U .
cd ..
Checkout https://pytorch.org/get-started/locally/
pip install airfransimport os
import airfrans as af
directory_name='Dataset'
if not os.path.isdir(directory_name):
af.dataset.download(root = ".", file_name = directory_name, unzip = True, OpenFOAM = False)Before running, make sure your repository has the following structure:
+---Dataset/
+---LIPS/
+---src/
+---models/
+---bi_transformer/
+---my_custom_transformer.py
+---parameters.json
+---my_ingestion.py
+---run.py
to run the model, simply run python run.py [model_directory].
- Anthony Kalaydjian, Master student @ ENSTA/EPFL - [email protected]
- Anton Balykov, Master student @ EPFL - [email protected]
- Adrien Chan-Hon-Tong, Researcher in ML @ Onera Université Paris Saclay – [email protected]
[1] Attention Is All You Need, A. Vaswani et al. (2017).
[2] LIPS - Learning Industrial Physical Simulation benchmark suite, M. Leyli Abadi et al. (2022).
[3] AirfRANS: High Fidelity Computational Fluid Dynamics Dataset for Approximating Reynolds-Averaged Navier-Stokes Solutions, F. Bonnet et al. (2023).