Skip to main content

Package to solve fluid flow PDEs using deep learning

Project description

FluidLearn


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 training 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.

flow_learn_diagram              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-dependency
                 FluidLearn package dependency tree

Author


Manu Jayadharan, Department of Mathematics at University of Pittsburgh, 2020.
email: manu.jayadharan@gmail.com, manu.jayadharan@pitt.edu
researchgate
linkedin

Installation


FluidLearn depends primarily on tensorflow (>=v2.2) and numpy. Make sure you have these packages already available, otherwise 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.

Installing tensorflow

Installing latest version of tensorflow would automatically install numpy as well.

#to make sure latest verson of pip is installed.
pip install --upgrade pip
#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'

Installing FluidLearn

pip install fluidlearn

Other recommended packages for easy visualization

  • 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

Getting started with FluidLearn

  • 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.

Coming in future versions

  • More examples demonstrating the abilities of the package.
  • More types of nueral network like convolutional nets.
  • Building user interface for physical parameter estimation.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

fluidlearn-0.2.0.tar.gz (13.7 kB view hashes)

Uploaded Source

Built Distribution

fluidlearn-0.2.0-py3-none-any.whl (14.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page