Coder Social home page Coder Social logo

lwk205 / acse-9-independent-research-project-wade003 Goto Github PK

View Code? Open in Web Editor NEW

This project forked from msc-acse/acse-9-independent-research-project-wade003

0.0 1.0 0.0 894.54 MB

acse-9-independent-research-project-Wade003 created by GitHub Classroom

License: MIT License

Fortran 43.92% Python 12.37% Roff 0.18% Makefile 5.26% Shell 9.20% TeX 6.23% C 10.84% C++ 10.19% Opal 0.02% CMake 0.05% Groovy 0.01% M4 0.12% GLSL 0.79% CSS 0.01% Dockerfile 0.01% HTML 0.33% Batchfile 0.03% Gnuplot 0.47% Visual Basic 0.01%

acse-9-independent-research-project-wade003's Introduction

Introduction

Reduced order modelling is a powerful technique for rapidly modelling high dimensional fluid dynamics systems. Its speed could enable real-time decision making and operational modelling.

  • Results from LSTM and DD-GPR, 2D flow past a cylinder

  • 3D London South Bank University original data and GPR's result on a cut plane

In this repository you can find the tools for reduced order modelling.

The follow test case are in this repository, including:

  • A 1D square wave prediction by LSTM (see: test_cases/square_wave/square_wave_lstm.py)
  • A 1D square wave training by DD-LSTM (see: test_cases/square_wave/square_wave_dd_lstm.py)
  • A 2D flow past a cylinder test case using LSTM (see: test_cases/LSTM_fpc)
  • A 2D flow past a cylinder test case using GPR (see: test_cases/GPR_fpc)
  • A 2D flow past a cylinder test case using DD-LSTM (see: test_cases/DD_LSTM_fpc) (not recommand, discussed in report)
  • A 2D flow past a cylinder test case using DD-GPR (see: test_cases/DD_GPR_fpc)

The test case for 3D problem is too large to be here. To run that test case, you need to:

Install Putty (from: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html)

Install Xming (from: https://netix.dl.sourceforge.net/project/xming/Xming/6.9.0.31/Xming-6-9-0-31-setup.exe)

Open Putty. Set host name as: ese-theos.ese.ic.ac.uk

Set Connection/SSH/X11, Enable X11 forwarding.

Open Putty and login.

Ask for account and password from e-mail: [email protected]

After logging in:

  cd /data/wade/test/Opal-master/tests/
  cd GPR_LSBU
   export PYTHONPATH='/data/wade/test/multifluids_icferst-master/python:$PYTHONPATH'
   export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/data/wade/test/Opal-master/spud
   export PATH="/data/wade/test/Opal-master/spud:$PATH"
   diamond -s ../../schemas/opal.rng lsbu_gpr.opal

After editing the settings (or just use default)

   python2 ../../opal.py lsbu_gpr.opal

Finish running, see the visualization of result

   paraview

Open the nirom_replication.vtu and change the field from solid color to velocity.

System requirement

Linux.

Installation instructions

To download the repository to your local machine.

  git clone https://github.com/msc-acse/acse-9-independent-research-project-Wade003.git

Installing all packages below.

   pip install -U numpy
   pip install sklearn 
   pip install keras
   pip install tensorflow
   pip install matplotlib
   pip install torch==1.2.0+cpu torchvision==0.4.0+cpu -f https://download.pytorch.org/whl/torch_stable.html
   pip install vtk

Adding environment path for Opal and IC-Ferst

   export PYTHONPATH='[path_to_this_repo]/software/multifluids_icferst/python:$PYTHONPATH'
   export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:[path_to_this_repo]/software/Opal/spud
   export PATH="[path_to_this_repo]/software/Opal/spud:$PATH"

Dependencies

The external libraries:

  • python 2.7 (Recommand)
  • numpy >= 1.16.4
  • scipy >= 1.2.2
  • matplotlib >= 3.1.0
  • jupyter >= 1.0.0 (to run demo notebooks)
  • Sphinx >= 1.8.5 (to compile documentation)
  • Keras >= 2.2.4
  • scikit-learn >= 0.20.3
  • tensorflow >= 1.14.0
  • torch >= 1.1.0
  • torchvision >= 0.3.0
  • vtk >= 8.1.2

Repository Information

  • animation - recorded animation video for several test case
  • images - report related images
  • software - contains Opal (which is the major software I developed) and IC-Ferst (support to run the Opal)
  • report - contains the final report, detailing this project's motivations, software design, analysis, and conclusions
  • test_cases - 1D square wave and 2D flow past a cylinder test cases

Instructions to run a test case

In the root directory of this repository

   diamond -s ../../software/Opal/schemas/opal.rng fpc_nirom.opal

The file name(fpc_nirom.opal) should be changed to the opal file's name in another test case. As for the configuration of 2D problem, I recommend to remain the same; if you do need you change it and still want to test a 2D test case, you can change the nPOD in field_name(Velocity) in svd_type in compression. But too many or two small POD number would affect the performance.

Another setting could be changed is to change the training method from LSTM to GPR. We using GPR, it needs further setting. The scaling bounds are 0 10. The constant value is 1. The constant bounds are 1e-3 1e3. The RBF length scale is 100. The RBF length scale bounds are 1e-2 1e2. Ctrl + s to save your settings.

Run the model:

   python2 ../../software/Opal/opal.py fpc_nirom.opal

Visualize the result:

   paraview

Open the nirom_replication.vtu files, Click apply, and click a dropbox showing solid colour, switch that to velocity. Then click a button to go to the second snapshots, click the re-scale button so you can see the result in reasonable colour. Then you can click play button to see the whole animation. If you want to see the original data, go to snapshots and open that in paraview.

Author and Course Information

Author: Wade Song Github: Wade003 CID: 01569843

This project is completed for Imperial College's MSc in Applied Computational Science and Engineering program, as part of the final course module ACSE9.

This project was completed under the supervision of Professor Christopher Pain.

To Markers:

My major development is in software/Opal

f2py.py LSTM_DD.py LSTM_Global.py nirom.py(part) nirom_LSTM_tools.py nirom_tools.py(part) opal_classes.py(part)

And in software/Opal/schemas opal.rnc(part)

The other code is pre-existing

License

Licensed under the MIT license

acse-9-independent-research-project-wade003's People

Contributors

wade003 avatar

Watchers

 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.