-
Notifications
You must be signed in to change notification settings - Fork 849
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
NEMO - Improvements on the Preprocessing phase and inclusion of Chapmann-Enskog for Mutation++ #1343
Conversation
|
||
V[RHOCVTR_INDEX] = rhoCvtr; | ||
V[RHOCVVE_INDEX] = rhoCvve; | ||
V[RHOCVTR_INDEX] = fluidmodel->ComputerhoCvtr(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
fluidmodel->ComputedTdU (V, val_dTdU ); | ||
fluidmodel->ComputedTvedU(V, eves, val_dTvedU); | ||
if(implicit){ | ||
fluidmodel->ComputedPdU (V, eves, val_dPdU ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These may be required for some explicit schemes/viscous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The rest of the code code seems okay, going to take a further look to see which schemes and routines use those quantities
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If in doubt and the computations are not expensive...
This pull request fixes 1 alert when merging 8450d94 into f47e22b - view on LGTM.com fixed alerts:
|
Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com>
@WallyMaier @CatarinaGarbacz just checked with the testcases Wally provided. All of them pass |
@@ -46,6 +46,9 @@ CNEMOEulerVariable::CNEMOEulerVariable(su2double val_pressure, | |||
Gradient_Reconstruction(config->GetReconstructionGradientRequired() ? Gradient_Aux : Gradient_Primitive) { | |||
|
|||
unsigned short iDim, iSpecies; | |||
|
|||
/*--- Setting flags ---*/ | |||
implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
something like this?
implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); | |
bool implicit = (config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I initialize the variable inside the CNEMOEulerVariable instantiaton function, it can't be used for other functions. If I am not mistaken, that variable will be deleted when the function returns
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is it used in other functions wuth the variable structure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry @WallyMaier didn't get it. What variable structure are you mentioning ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the boolean implicit is only used in this function in NEMOVariable, I dont think we should declare in the hpp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think I can do it any other way, else the CConfig parameter would have to be passed as argument to the Cons2PrimVar function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't rely on passing the config around too much.
This pull request fixes 1 alert when merging fbbc6ee into f47e22b - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging 0cd78e4 into f47e22b - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging a8b0b93 into df2469f - view on LGTM.com fixed alerts:
|
static const MapType<std::string, TRANSCOEFFMODEL> TransCoeffModel_Map = { | ||
MakePair("WILKE", TRANSCOEFFMODEL::WILKE) | ||
MakePair("GUPTA-YOS", TRANSCOEFFMODEL::GUPTAYOS) | ||
MakePair("CHAPMANN-ENSKOG", TRANSCOEFFMODEL::CHAPMANN_ENSKOG) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you guys have these options documented somewhere? I don't see them in the config_template but maybe in one of NEMO testcases?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have now included this option in the config_template file. It's not used on NEMO test-cases though
This pull request fixes 1 alert when merging b2a783e into df2469f - view on LGTM.com fixed alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I'm late to the party... but lgtm @fmpmorgado . Just 2 very little comments one might consider for the next PR
if (V[T_INDEX] <= Tmin) { nonPhys = true; return nonPhys;} | ||
else if (V[T_INDEX] >= Tmax) { nonPhys = true; return nonPhys;} | ||
else if (V[T_INDEX] != V[T_INDEX]){ nonPhys = true; return nonPhys;} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here I would have gone with sth like
if ((V[T_INDEX] <= Tmin) || condition2 || condition3) {
nonPhys = true; return nonPhys;
}
The same below for Tve
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @TobiKattmann, I'll address your comments in #1347
Gradient_Reconstruction(config->GetReconstructionGradientRequired() ? Gradient_Aux : Gradient_Primitive), | ||
implicit(config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here a little indentation more
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A little clang-format you mean? 😄
Proposed Changes
Optimization of the Preprocessing phase;
Inclusion of the Chapmann-Enskog option for Mutation++
Related Work
None
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.
Work Performed
I have reduced almost by half the time of the preprocessing phase, leading to a ~10% less time per iteration. This was done by:
Additionally, I have included the option of using Chapmann-Enskog for the calculation of transport equations and thermal conductivity using Mutation++