GithubHelp home page GithubHelp logo

erdc / pynirom Goto Github PK

View Code? Open in Web Editor NEW
14.0 7.0 7.0 10.41 MB

Python tools for non-intrusive reduced order modeling

License: MIT License

Python 99.52% Shell 0.48%
deep-learning model-order-reduction data-driven proper-orthogonal-decomposition dynamic-mode-decomposition neural-odes radial-basis-function

pynirom's Introduction

pyNIROM: Non-Intrusive Reduced Order Modeling using Python

A collection of Python implementations of non-intrusive reduced order modeling techniques. This repo provides modules for

  1. linear dimension reduction using Proper Orthogonal Decomposition (POD),
  2. evolution of latent-space coefficients using a greedy Radial Basis Function (RBF) interpolation,
  3. evolution of latent-space coefficients using a Tensorflow-based implementation of neural ordinary differential equations (NODE), and
  4. extracting spatio-temporal coherent structures from snapshot data using Dynamic Mode Decomposition (DMD). Numerical examples are provided using a benchmark CFD problem and real world applications of shallow water flow problems.

For details on each method and the numerical examples please refer to -

[1] S. Dutta, M. W. Farthing, E. Perracchione, G. Savant, and M. Putti, “A greedy non-intrusive reduced order model for shallow water equations,” J. Comput. Phys., vol. 439, p. 110378, 2021. Journal arXiv

[2] S. Dutta, P. Rivera-casillas, and M. W. Farthing, “Neural Ordinary Differential Equations for Data-Driven Reduced Order Modeling of Environmental Hydrodynamics,” in Proceedings of the AAAI 2021 Spring Symposium on Combining Artificial Intelligence and Machine Learning with Physical Sciences, 2021. Proceedings arXiv

[3] S. Dutta, P. Rivera-Casillas, O. M. Cecil, M. W. Farthing, E. Perracchione, and M. Putti, “Data-driven reduced order modeling of environmental hydrodynamics using deep autoencoders and neural ODEs,” in Proceedings of the IXth International Conference on Computational Methods for Coupled Problems in Science and Engineering (COUPLED PROBLEMS 2021), 2021, pp. 1–16. arXiv

Getting Started

Dependencies and installation

  • Python 3.x
  • Tensorflow TF 2 / 1.15.0 or above. Prefereably TF 2.0+, as the entire tfdiffeq codebase requires Eager Execution. Install either the CPU or the GPU version depending on available resources.
  • tfdiffeq - Installation directions are available at tfdiffeq.

The code has been tested with Python3.7 and Python 3.8, but it should be compatible with any Python3.x. Python2 support is no longer maintained. A list of all the package requirements along with version information is provided in the requirements file.

For installation, it is assumed that Anaconda, pip, and all Nvidia drivers (GPU support) are already installed. Then the following steps can be used to create a conda environment and install all necessary dependencies. Alternatively, python virtual environments can also be used.

  1. Create a conda environment: conda create -n newenv python==3.8
  2. Activate conda environment: conda activate newenv
  3. Clone the package repository: git clone https://github.com/erdc/pynirom.git && cd pynirom
  4. To install the dependencies for the CPU version of the package type: python3 -m pip install -r requirements.txt .
  5. Alternatively, to install the dependencies for GPU support type: ./install_gpu.sh

Note: the dependencies can also be manually installed from the appropriate requirements file using pip or conda and then, the pynirom package can be installed by typing: python3 setup.py install. For the GPU version, we recommend using conda to install dependencies in order to ensure that any missing Cuda libraries are also added to the environment.

Example notebooks to get started

The examples directory contains several Jupyter notebooks that demonstrate how to use the different NIROM methodologies to build reduced order models for fluid flow problems governed by the incompressible Navier Stokes equations, the shallow water equations and 2D Burgers' equation. The high-fidelity snapshot data files are available at Shallow Water example, Navier Stokes example, and 2D Burgers' example. These data files should be placed in the <./data/> directory.

  1. The PODRBF_cylinder.ipynb and PODRBF_SW.ipynb notebooks demonstrate the use of the PODRBF method for 2D flow around a cylinder and 2D shallow water flows in real world domains respectively.
  2. The DMD_cylinder.ipynb and DMD_SW.ipynb notebooks illustrate the use of DMD for these problems.
  3. The PODNODE_cylinder.ipynb, PODNODE_SW.ipynb, and PODNODE_burgers2d notebooks illustrate the use of the PODNODE method for the example problems.
  4. The comparison_cylinder.ipynb and comparison_SW.ipynb notebooks contain visualizations to compare the predictions obtained using the different NIROM methods. To run these notebooks download the pre-computed PODNODE solution files from Link and place these files according to the instructions in the notebooks. Also, run the DMD and PODRBF notebooks for each example problem to generate the respective NIROM solutions.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

Reference

If you found this library useful in your research, please consider citing

@article{Dutta_JCP2021,
archivePrefix = {arXiv},
arxivId = {2002.11329},
author = {Dutta, Sourav and Farthing, Matthew W. and Perracchione, Emma and Savant, Gaurav and Putti, Mario},
doi = {10.1016/j.jcp.2021.110378},
eprint = {2002.11329},
journal = {J. Comput. Phys.},
pages = {110378},
publisher = {Elsevier Inc.},
title = {{A greedy non-intrusive reduced order model for shallow water equations}},
volume = {439},
year = {2021}
}

@inproceedings{Dutta_AAAI2021,
title={Neural Ordinary Differential Equations for Data-Driven Reduced Order Modeling of Environmental Hydrodynamics},
author={Dutta, Sourav and Rivera-Casillas, Peter and Farthing, Matthew W.},
booktitle={Proceedings of the AAAI 2021 Spring Symposium on Combining Artificial Intelligence and Machine Learning with Physical Sciences},
archivePrefix = {arXiv},
arxivId = {2104.13962},
eprint = {2104.13962},
year={2021},
publisher={CEUR-WS},
address={Stanford, CA, USA, March 22nd to 24th, 2021},
}

@inproceedings{Dutta_Coupled2021,
address = {Barcelona, Spain},
archivePrefix = {arXiv},
arxivId = {2107.02784},
author = {Dutta, Sourav and Rivera-Casillas, Peter and Cecil, Orie M. and Farthing, Matthew W. and Perracchione, Emma and Putti, Mario},
booktitle = {Proc. IXth Int. Conf. Comput. Methods Coupled Probl. Sci. Eng. (COUPLED Probl. 2021)},
eprint = {2107.02784},
pages = {1--16},
publisher = {International Center for Numerical Methods in Engineering (CIMNE)},
title = {{Data-driven reduced order modeling of environmental hydrodynamics using deep autoencoders and neural ODEs}},
year = {2021}
}

Acknowledgments

  • Thank you to ERDC-HPC facilities for support with valuable computational infrastructure.
  • Thank you to ORISE for support with appointment to the Postgraduate Research Participation Program.

Inspiration, code snippets, etc.

  • tfdiffeq for Tensorflow implementation of NODE.

pynirom's People

Contributors

sdutta-math avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.