pyIBAML: A Python package for Immersed Boundary Aware/Agnostic Machine Learning currently consists an implementation of the recent research paper "Physics-informed neural networks modeling for systems with moving immersed boundaries: application to an unsteady flow past a plunging foil.".
Abstract: (Concerning the current implementation) Recently, physics informed neural networks (PINNs) have been explored extensively for solving various forward and inverse problems and facilitating querying applications in fluid mechanics applications. However, work on PINNs for unsteady flows past moving bodies, such as flapping wings is scarce. Earlier studies mostly relied on transferring to a body attached frame of reference which is restrictive towards handling multiple moving bodies or deforming structures. Hence, in the present work, an immersed boundary aware framework has been explored for developing surrogate models for unsteady flows past moving bodies. Specifically, simultaneous pressure recovery and velocity reconstruction from Immersed boundary method (IBM) simulation data has been investigated. While, efficacy of velocity reconstruction has been tested against the fine resolution IBM data, as a step further, the pressure recovered was compared with that of an arbitrary Lagrange Eulerian (ALE) based solver. Under this framework, two PINN variants, (i) a moving-boundary-enabled standard Navier-Stokes based PINN (MB-PINN), and, (ii) a moving-boundary-enabled IBM based PINN (MB-IBM-PINN) have been formulated. A fluid-solid partitioning of the physics losses in MB-IBM-PINN has been allowed, in order to investigate the effects of solid body points while training. This enables MB-IBM-PINN to match with the performance of MB-PINN under certain loss weighting conditions. MB-PINN is found to be superior to MB-IBM-PINN when {\it a priori} knowledge of the solid body position and velocity are available. To improve the data efficiency of MB-PINN, a physics based data sampling technique has also been investigated. It is observed that a suitable combination of physics constraint relaxation and physics based sampling can achieve a model performance comparable to the case of using all the data points, under a fixed training budget.
- PyIBAML aims to bridge the gap between Unsteady Aerodynamicists/Fluid Dynamicists/Multiphysics modeling engineers working with moving boundaries and Machine Learning engineers through physics informed/guided/constrained machine learning.
- This shall be achieved as follows:
- Unsteady aerodynamicists can use this package as a black box for their inverse problem workloads.
- Machine learning engineers have a space to test their algorithms in the context of unsteady fluid flows involving moving boundaries.
The code base is as follows:
If you want to run the codes on a local machine, it is advised to download and install anaconda.
- Get the linux dependencies installed:
apt-get install libgl1-mesa-glx libegl1-mesa libxrandr2 libxrandr2 libxss1 libxcursor1 libxcomposite1 libasound2 libxi6 libxtst6 - Download the installer from
https://repo.anaconda.com/archive/ - Follow the detailed installation instructions on
https://docs.anaconda.com/free/anaconda/install/linux/ - Create an anaconda environment:
conda create -n <yourname> python=3.10 - Open a terminal shell and activate your environment:
conda activate <yourname> - Install all the python dependency requirements:
pip install -r requirements - Install Ipython shell and jupyter notebooks:
conda install jupyter
A test case of low Reynolds number flow over a plunging foil has been provided similar to the one in supplementary material of sundar et al. (2024). Here, given fluid velocity data 5 grid cells away from the body, the aim is to recover pressure and reconstruct velocity field in the entire domain. Once the models are trained, one can carry out post processing techniques as in supplementary material of Sundar et al. (2024) to detect the body position, velocity and shape.
- First initialise your Anaconda environment
conda activate <YOUR ENVIRONMENT NAME>
- If training an MB-PINN:
python Train_PINN_2C1FL_nosplit_gradientForcing_5cells.py
- If training an MB-IBM-PINN (no multipart loss weighting in this case):
python Train_IBMPINN_2C1FL_nosplit_gradientForcing_5cells.py
The scripts after running would save the Loss histories and the predictions on the training dataset.
- First initialise your Anaconda environment
conda activate <YOUR ENVIRONMENT NAME>
- If testing MB-PINN:
python Test_PINN_2C1FL_nosplit_gradientForcing_5cells.py
- If testing MB-IBM-PINN (no multipart loss weighting in this case):
python Test_IBMPINN_2C1FL_nosplit_gradientForcing_5cells.py
The scripts after running would save the Loss histories and the predictions on the testing dataset.
Note: The results would be stored in ./Results/RUN_NAME directory
@article{sundar2024physics,
title={Physics-informed neural networks modelling for systems with moving immersed boundaries: Application to an unsteady flow past a plunging foil},
author={Sundar, Rahul and Majumdar, Dipanjan and Lucor, Didier and Sarkar, Sunetra},
journal={Journal of Fluids and Structures},
volume={125},
pages={104066},
year={2024},
publisher={Elsevier}
}
title={Understanding the training of PINNs for unsteady flow past a plunging foil through the lens of input subdomain level loss function gradients},
author={Sundar, Rahul and Lucor, Didier and Sarkar, Sunetra},
year={2024}
}
If you find the software useful, please do feel free to cite the following: 3. "pyIBAML:A Python package for Immersed Boundary Aware Machine Learning"
@software{pyIBAML2024,
author = "Rahul Sundar",
address = "Biomimetics and dynamics lab, IIT Madras, Chennai - 60036, India",
title = "pyIBAML: A Python package for Immersed Boundary Aware Machine Learning",
year = "2024",
}

