Skip to content

Coupling of SU2 and CoolProp#1782

Merged
pcarruscag merged 49 commits intosu2code:feature_coolpropfrom
PENGYAN777:develop
Nov 5, 2022
Merged

Coupling of SU2 and CoolProp#1782
pcarruscag merged 49 commits intosu2code:feature_coolpropfrom
PENGYAN777:develop

Conversation

@PENGYAN777
Copy link
Contributor

@PENGYAN777 PENGYAN777 commented Oct 5, 2022

Proposed Changes

This project aims to couple the free and open-source thermodynamics library CoolProp with SU2.

There are two advantages:

  1. More accurate numerical results.
    CoolProp can provide accurate thermodynamics properties (P, T, rho, ect) of commone fluids by either extracting experiment data from published papers, or computing based on the state-of-the-art Helmholtz energy formulations.
    So, thermodynamics properties obtained from CoolProp should be more accurate than those obtained from Van der Waals or peng robinson gas model embedded in SU2. Also, the numerical results should be more accurate.
  2. More user-friendly
    To use CoolProp feature, the ony input from the user is the name of fluid. Then all other thermodynamics can be provided by CoolProp.
    %FLUID_MODEL = COOLPROP
    %FLUID_NAME = nitrogen

Related Work

This project references the following work:
1.the work of coupling 'Mutationpp' with SU2.
4. the pull request of 'Feature nppr gas #1718'

PR Checklist

  • I am submitting my contribution to the develop branch.
  • My contribution generates no new compiler warnings.
  • My contribution is commented and consistent with SU2 style (https://su2code.github.io/docs_v7/Style-Guide/).
  • Simulations with the following test fluids succeed: nitrogen, oxygen, carbon dioxide, MM.
  • Currently, this new feature is applied for only Euler flow. For viscous flow, further work need to be done, including viscosity, conductivity from CoolProp.
  • CoolProp does not support non-dimension.

@PENGYAN777 PENGYAN777 changed the title Develop Coupling of SU2 and CoolProp Oct 5, 2022
@PENGYAN777 PENGYAN777 changed the title Coupling of SU2 and CoolProp [WIP]Coupling of SU2 and CoolProp Oct 5, 2022
@pr-triage pr-triage bot removed the PR: unreviewed label Oct 5, 2022
@bigfooted
Copy link
Contributor

could you clean up unnecessary files first, please?

@PENGYAN777
Copy link
Contributor Author

PENGYAN777 commented Oct 5, 2022 via email

@bigfooted
Copy link
Contributor

Yes, all those automatically generated files should be removed, so everything in the folder .idea (including the folder), and the entire cmake-build-debug folder. If they come from coolprop, tell it to install into another directory outside of SU2.

@PENGYAN777
Copy link
Contributor Author

PENGYAN777 commented Oct 5, 2022 via email

@lgtm-com
Copy link

lgtm-com bot commented Oct 5, 2022

This pull request introduces 293 alerts when merging a6ce86a into 4f3e0af - view on LGTM.com

new alerts:

  • 131 for FIXME comment
  • 43 for Comparison result is always the same
  • 38 for Multiplication result converted to larger type
  • 34 for Constant return type on member
  • 24 for Inconsistent definition of copy constructor and assignment ('Rule of Two')
  • 10 for Empty branch of conditional
  • 4 for Declaration hides parameter
  • 2 for Expression has no effect
  • 2 for Catching by value
  • 1 for Overloaded assignment does not return 'this'
  • 1 for Virtual call from constructor or destructor
  • 1 for Unclear comparison precedence
  • 1 for Local variable hides global variable
  • 1 for Short global name

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.

Welcome to SU2
Run clang-format on new files and please format your changes to existing files according to SU2 style.

addEnumOption("FLUID_MODEL", Kind_FluidModel, FluidModel_Map, STANDARD_AIR);
addEnumOption("FLUID_MODEL", Kind_FluidModel, FluidModel_Map, COOLPROP);
/*!\brief FLUID_NAME \n DESCRIPTION: Fluid name \n OPTIONS: see coolprop homepage \n DEFAULT: nitrogen \ingroup Config*/
addStringOption("FLUID_NAME", FLUID_NAME, string("nitrogen"));
Copy link
Contributor

Choose a reason for hiding this comment

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

I wonder if there is a way to combine this with the Mutation++ options.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is a good idea.
I will try to finish this new feature as soon, and then if it is possible, I am happy to work with others on this combination.

Copy link
Contributor

@WallyMaier WallyMaier left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!
Be sure to run remove the unnecessary files and run clang_format to clean up new files.

I wonder with the new additions of the NEMO, Species and now CoolProp fluids, there would be a smart way to consolidate

@PENGYAN777
Copy link
Contributor Author

Do that in a different order please, add the regression now, we merge the PR, and then you continue the work. We want short PRs.

ok, I will add the regression recently.

@PENGYAN777
Copy link
Contributor Author

Do that in a different order please, add the regression now, we merge the PR, and then you continue the work. We want short PRs.

Hi, I meet a problem when I change /.github/workflows/regression.yaml to enable compilation with CoolProp for one of the config sets (BaseMPI).

To compile CoolProp, I import cmake submodule of meson. However, when github workflow builds BaseMPI, the error message is 'can not find cmake.'

I think this is because github does not have cmake.

Do you have any advice? Thank you.

(the other subproject Mutationpp also import cmake submodule, do you know how that new feature is built on github?)

@pcarruscag
Copy link
Member

Mutation++ is currently not built on github

@pcarruscag
Copy link
Member

I will try to update the docker images to make cmake available

@PENGYAN777
Copy link
Contributor Author

I will try to update the docker images to make cmake available

Thank you. Once cmake is avalible on github, then I will continue to enable BaseMPI to compile CoolProp.

@pcarruscag pcarruscag changed the title [WIP]Coupling of SU2 and CoolProp Coupling of SU2 and CoolProp Nov 5, 2022
@pcarruscag pcarruscag changed the base branch from develop to feature_coolprop November 5, 2022 21:22
@pcarruscag pcarruscag merged commit ee3a389 into su2code:feature_coolprop Nov 5, 2022
@pcarruscag
Copy link
Member

You should be able to create the new PR from this link https://github.com/su2code/SU2/compare/develop...feature_coolprop?expand=1
Please copy the description from this PR

@pcarruscag
Copy link
Member

@PENGYAN777 the issues with the GitHub actions are fixed now. Please open the new PR so that we can merge this work into develop.

@PENGYAN777
Copy link
Contributor Author

@PENGYAN777 the issues with the GitHub actions are fixed now. Please open the new PR so that we can merge this work into develop.

Thank you for your help.

I created the new PR request with title ' Feature coolprop #1806 '.

Next, I will work to introduce viscosity and conductivity from CoolProp, then this new feature should be done.

@PENGYAN777 PENGYAN777 deleted the develop branch November 7, 2022 07:39
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.

4 participants