FluidLearn is a software package with python interface, capable of solving non-linear fluid flow problems using supervised deep learning techniques. The solution function and the PDE operator are approximated as neural networks, which will be trained using labelled data.
Conceptually, this API could be used to solve any well-posed PDE system on complex geometric structures, given enough labelled data in the form of boundary and initial conditions. The architecture could also be used for physical parameter estimation and surrogate modelling. As of now, the package is oriented towards PDE systems governing fluid flow problems with many popular flow systems inbuilt. Users have the option to train the model from external data, visualize the training curves, save the model, reload the model, continue training the saved model or make predictions from the saved models.
The package could be seen as an application of the Physics Informed Neural Networks (PINNs) which are artificial neural nets trained with PDE constraints. The idea was first introduced in this publication in 2017. For more details on the mathematical theory behind PINNs, please visit the website maintained by the authors of the aforementioned publication here.
A graphical representation of a feed forward type neural net used in the training is shown below.
Approximation of PDE operator using a feedforward neural network
The FluidLearn api is built on top of tensorflow with keras model subclassing. Most of the details are hidden from the end user, who will be dealing only with the fluidlearn package interface. For developers, with knowledge of keras and tensor flow APIs, who would like more control over the package or would like to add more features could do so easily by inspecting the modulular structure of the package. For all users, except developers, installation of the package from python's official PyPi distribution or pip is recommended. The latter users could use the code directly from here after setting up dependencies.
While the users will find no problem accessing the package through a regular python script, just like with any other machine learning library, it will be visually advantageous to use a notebook setting like jupyter notebook. For this reason, all the demo examples are available in both python(.py) and jupyter notebook (.ipynb) formats.
FluidLearn package dependency tree
Manu Jayadharan, Department of Mathematics at University of Pittsburgh, 2020.
GitHub
email: [email protected], [email protected]
researchgate
linkedin
FluidLearn depends primarily on tensorflow (>=v2.2) and numpy. Make sure you have these packages installed before installing fluidlearn, in case they are not available already, please follow the instructions below to install them. Installing all packages inside a separate environment is always recommended in order to prevent version conflicts. You could either use virtualenv package or a package manager like conda to accomplish this.
#to make sure latest verson of pip is installed.
pip install --upgrade pip
#installing latest verson of numpy
pip install numpy
#installing latest version of tensorflow.
pip install tensorflow
Once installed make sure that you have a compatible version of tensorflow by running the following commands inside a py script or notebook.
import tensorflow as tf
import numpy as np
tf.__version__ >= '2.2.0'
pip install fluidlearn
- jupyter notebook for more interactive interface
using pip:
pip install notebook
using conda:
conda install jupyter
- matplotlib for visualization
using pip:
python -m pip install -U pip
python -m pip install -U matplotlib
or using conda:
conda install matplotlib
- Go through examples to understand the user interface of fluidlearn.
- Examples can be treated as tutorials with the two digit numerals at the beginning of the name indicating the order. For example examples/01_difussion_example is the first example in the series. This example shows how to upload data from a csv file, select nerual architechure, train the model, make prediction and finally how to save and reload the model.
- All examples are given in both .ipynb and .py formats.
- If you are using the notebook file (.ipynb), make sure that jupyter notebook is installed in the same environment containing fluidlearn and you have started the notebook using
jupyter notebook
in the appropriate environment.
- More examples demonstrating the abilities of the package.
- More types of nueral network like convolutional nets.
- Building user interface for physical parameter estimation.