-
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
NEMO - Improvements on the Preprocessing phase and inclusion of Chapmann-Enskog for Mutation++ #1343
Changes from all commits
8955576
e25f18b
4f3aaf2
42f2fd2
8450d94
2dbe2d1
fbbc6ee
0cd78e4
d62b1b7
a8b0b93
b2b8dae
b2a783e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,7 +43,8 @@ CNEMOEulerVariable::CNEMOEulerVariable(su2double val_pressure, | |
ndim, | ||
nvar, | ||
config ), | ||
Gradient_Reconstruction(config->GetReconstructionGradientRequired() ? Gradient_Aux : Gradient_Primitive) { | ||
Gradient_Reconstruction(config->GetReconstructionGradientRequired() ? Gradient_Aux : Gradient_Primitive), | ||
implicit(config->GetKind_TimeIntScheme_Flow() == EULER_IMPLICIT) { | ||
Comment on lines
+46
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. A little clang-format you mean? 😄 |
||
|
||
unsigned short iDim, iSpecies; | ||
|
||
|
@@ -267,41 +268,20 @@ bool CNEMOEulerVariable::Cons2PrimVar(su2double *U, su2double *V, | |
V[TVE_INDEX] = T[1]; | ||
|
||
// Determine if the temperature lies within the acceptable range | ||
if (V[T_INDEX] <= Tmin) { nonPhys = true;} | ||
else if (V[T_INDEX] >= Tmax) { nonPhys = true;} | ||
else if (V[T_INDEX] != V[T_INDEX] || V[TVE_INDEX] != V[TVE_INDEX]){ | ||
nonPhys = true;} | ||
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;} | ||
Comment on lines
+271
to
+273
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. Thanks @TobiKattmann, I'll address your comments in #1347 |
||
|
||
/*--- Vibrational-Electronic Temperature ---*/ | ||
vector<su2double> eves_min = fluidmodel->ComputeSpeciesEve(Tvemin); | ||
vector<su2double> eves_max = fluidmodel->ComputeSpeciesEve(Tvemax); | ||
|
||
// Check for non-physical solutions | ||
if (!monoatomic){ | ||
su2double rhoEve_min = 0.0; | ||
su2double rhoEve_max = 0.0; | ||
for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) { | ||
rhoEve_min += U[iSpecies] * eves_min[iSpecies]; | ||
rhoEve_max += U[iSpecies] * eves_max[iSpecies]; | ||
} | ||
|
||
if (rhoEve < rhoEve_min) { | ||
|
||
nonPhys = true; | ||
V[TVE_INDEX] = Tvemin; | ||
U[nSpecies+nDim+1] = rhoEve_min; | ||
} else if (rhoEve > rhoEve_max) { | ||
nonPhys = true; | ||
V[TVE_INDEX] = Tvemax; | ||
U[nSpecies+nDim+1] = rhoEve_max; | ||
} | ||
} else { | ||
//TODO: can e-modes/vibe modes be active? | ||
V[TVE_INDEX] = Tve_Freestream; | ||
if (V[TVE_INDEX] <= Tvemin) { nonPhys = true; return nonPhys;} | ||
fmpmorgado marked this conversation as resolved.
Show resolved
Hide resolved
|
||
else if (V[TVE_INDEX] >= Tvemax) { nonPhys = true; return nonPhys;} | ||
else if (V[TVE_INDEX] != V[TVE_INDEX]){ nonPhys = true; return nonPhys;} | ||
} | ||
else {V[TVE_INDEX] = Tve_Freestream;} | ||
|
||
// Determine other properties of the mixture at the current state | ||
fluidmodel->SetTDStateRhosTTv(rhos, V[T_INDEX], V[TVE_INDEX]); | ||
|
||
const auto& cvves = fluidmodel->ComputeSpeciesCvVibEle(); | ||
vector<su2double> eves = fluidmodel->ComputeSpeciesEve(V[TVE_INDEX]); | ||
|
||
|
@@ -310,11 +290,8 @@ bool CNEMOEulerVariable::Cons2PrimVar(su2double *U, su2double *V, | |
val_Cvves[iSpecies] = cvves[iSpecies]; | ||
} | ||
|
||
su2double rhoCvtr = fluidmodel->ComputerhoCvtr(); | ||
su2double rhoCvve = fluidmodel->ComputerhoCvve(); | ||
|
||
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 commentThe reason will be displayed to describe this comment to others. Learn more. Nice! |
||
V[RHOCVVE_INDEX] = fluidmodel->ComputerhoCvve(); | ||
|
||
/*--- Pressure ---*/ | ||
V[P_INDEX] = fluidmodel->ComputePressure(); | ||
|
@@ -325,9 +302,11 @@ bool CNEMOEulerVariable::Cons2PrimVar(su2double *U, su2double *V, | |
} | ||
|
||
/*--- Partial derivatives of pressure and temperature ---*/ | ||
fluidmodel->ComputedPdU (V, eves, val_dPdU ); | ||
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 commentThe 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 commentThe 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 commentThe reason will be displayed to describe this comment to others. Learn more. If in doubt and the computations are not expensive... |
||
fluidmodel->ComputedTdU (V, val_dTdU ); | ||
fluidmodel->ComputedTvedU(V, eves, val_dTvedU); | ||
} | ||
|
||
/*--- Sound speed ---*/ | ||
V[A_INDEX] = fluidmodel->ComputeSoundSpeed(); | ||
|
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