Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature libROM for reduced order modelling #1310

Merged
merged 31 commits into from
Jul 14, 2021
Merged

Feature libROM for reduced order modelling #1310

merged 31 commits into from
Jul 14, 2021

Conversation

jtlau
Copy link
Contributor

@jtlau jtlau commented Jun 24, 2021

Proposed Changes

Adding support to use the external library libROM (https://github.com/LLNL/libROM) for reduced order modeling with SU2.

libROM captures solution data and either computes the proper orthogonal decomposition (POD) over the data, or saves the solution "snapshot" in an hdf5 file for later POD computation. The POD matrix is also saved in an hdf5 file.

Related Work

There are a couple projects using libROM:

  • For projection-based model order reduction (PROM) in the branch feature_MOR

  • It is also being used with the NEMO solver to further test the PROM capabilities

  • libROM was used in a prior project that used the POD matrix as input to a neural network (to be published)

  • libROM also has other features, like help choosing the hyper-parameter nodes (a PROM step) and under development are black-box modeling methods like dynamic mode decomposition (DMD)

Please let me know if you have any questions / comments / recommendations!

I have tested this on macOS and linux.

PR Checklist

Put an X by all that apply. You can fill this out after submitting the PR. If you have any questions, don't hesitate to ask! We want to help. These are a guide for you to know what the reviewers will be looking for in your contribution.

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings (try with the '-Wall -Wextra -Wno-unused-parameter -Wno-empty-body' compiler flags, or simply --warnlevel=2 when using meson).
  • My contribution is commented and consistent with SU2 style.
  • I have added a test case that demonstrates my contribution, if necessary.
  • I have updated appropriate documentation (Tutorials, Docs Page, config_template.cpp) , if necessary.

Steps to Compile:

  1. Compile libROM
  2. Compile SU2 with the following meson options:
    ./meson.py build --prefix=/your/prefix -Denable-librom=true -Dlibrom_root=/path/to/libROM
  3. You may need to add the environment variable:
    export LD_LIBRARY_PATH=/path/to/libROM/build/:$LD_LIBRARY_PATH
  4. You can test by adding SAVE_LIBROM=YES to the Quickstart config

Copy link
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Jessie, thank you for this contribution.
It is not my specialty but I recall one or two interesting presentations.
Some general questions before we get into code details:
Are the results of this ready to use? Or do they need some additional post-processing steps to make sense? If so it would be good to have an example with any scripts needed.
Our current gold standard has been set by @TobiKattmann, see TestCases/incomp_navierstokes/streamwise_periodic.

If you were already planning to add a tutorial then nevermind the above.

SU2_CFD/src/solvers/CSolver.cpp Outdated Show resolved Hide resolved
config_template.cfg Outdated Show resolved Hide resolved
meson.build Show resolved Hide resolved
SU2_CFD/src/solvers/CSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/include/solvers/CSolver.hpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CSolver.cpp Outdated Show resolved Hide resolved
Common/include/CConfig.hpp Outdated Show resolved Hide resolved
Common/include/option_structure.hpp Outdated Show resolved Hide resolved
@jtlau
Copy link
Contributor Author

jtlau commented Jun 28, 2021

Thanks Pedro for the suggestions! I'm working on the changes now.

@jtlau
Copy link
Contributor Author

jtlau commented Jun 29, 2021

There are some post-processing steps involved, so I think it would be a good idea for me to include an example.

The features in this PR are one step to a bigger projection-based ROM process. The code for the bigger process is in feature_MOR, and will take some time for me to prepare the code from "make it work" to "actually good code".

However, this feature-PR can be used by itself by anyone who wants to efficiently compute the POD of SU2 simulation data, and then use the POD for other modeling strategies.

Copy link
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup a short example would be nice, but if there is more work coming we can wait until then.

SU2_CFD/src/solvers/CSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CSolver.cpp Outdated Show resolved Hide resolved
jtlau and others added 4 commits June 29, 2021 13:12
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
Copy link
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the changes, just a couple more things I noticed.

SU2_CFD/include/solvers/CSolver.hpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CSolver.cpp Outdated Show resolved Hide resolved
SU2_CFD/src/solvers/CSolver.cpp Outdated Show resolved Hide resolved
Copy link
Member

@pcarruscag pcarruscag left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jtlau jtlau merged commit 56b6080 into develop Jul 14, 2021
@jtlau jtlau deleted the feature_libROM branch July 14, 2021 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants