@@ -43,7 +43,8 @@ CNEMOEulerVariable::CNEMOEulerVariable(su2double val_pressure,
4343 ndim,
4444 nvar,
4545 config ),
46- Gradient_Reconstruction(config->GetReconstructionGradientRequired () ? Gradient_Aux : Gradient_Primitive) {
46+ Gradient_Reconstruction(config->GetReconstructionGradientRequired () ? Gradient_Aux : Gradient_Primitive),
47+ implicit(config->GetKind_TimeIntScheme_Flow () == EULER_IMPLICIT) {
4748
4849 unsigned short iDim, iSpecies;
4950
@@ -267,41 +268,20 @@ bool CNEMOEulerVariable::Cons2PrimVar(su2double *U, su2double *V,
267268 V[TVE_INDEX] = T[1 ];
268269
269270 // Determine if the temperature lies within the acceptable range
270- if (V[T_INDEX] <= Tmin) { nonPhys = true ;}
271- else if (V[T_INDEX] >= Tmax) { nonPhys = true ;}
272- else if (V[T_INDEX] != V[T_INDEX] || V[TVE_INDEX] != V[TVE_INDEX]){
273- nonPhys = true ;}
271+ if (V[T_INDEX] <= Tmin) { nonPhys = true ; return nonPhys;}
272+ else if (V[T_INDEX] >= Tmax) { nonPhys = true ; return nonPhys;}
273+ else if (V[T_INDEX] != V[T_INDEX]){ nonPhys = true ; return nonPhys;}
274274
275- /* --- Vibrational-Electronic Temperature ---*/
276- vector<su2double> eves_min = fluidmodel->ComputeSpeciesEve (Tvemin);
277- vector<su2double> eves_max = fluidmodel->ComputeSpeciesEve (Tvemax);
278-
279- // Check for non-physical solutions
280275 if (!monoatomic){
281- su2double rhoEve_min = 0.0 ;
282- su2double rhoEve_max = 0.0 ;
283- for (iSpecies = 0 ; iSpecies < nSpecies; iSpecies++) {
284- rhoEve_min += U[iSpecies] * eves_min[iSpecies];
285- rhoEve_max += U[iSpecies] * eves_max[iSpecies];
286- }
287-
288- if (rhoEve < rhoEve_min) {
289-
290- nonPhys = true ;
291- V[TVE_INDEX] = Tvemin;
292- U[nSpecies+nDim+1 ] = rhoEve_min;
293- } else if (rhoEve > rhoEve_max) {
294- nonPhys = true ;
295- V[TVE_INDEX] = Tvemax;
296- U[nSpecies+nDim+1 ] = rhoEve_max;
297- }
298- } else {
299- // TODO: can e-modes/vibe modes be active?
300- V[TVE_INDEX] = Tve_Freestream;
276+ if (V[TVE_INDEX] <= Tvemin) { nonPhys = true ; return nonPhys;}
277+ else if (V[TVE_INDEX] >= Tvemax) { nonPhys = true ; return nonPhys;}
278+ else if (V[TVE_INDEX] != V[TVE_INDEX]){ nonPhys = true ; return nonPhys;}
301279 }
280+ else {V[TVE_INDEX] = Tve_Freestream;}
302281
303282 // Determine other properties of the mixture at the current state
304283 fluidmodel->SetTDStateRhosTTv (rhos, V[T_INDEX], V[TVE_INDEX]);
284+
305285 const auto & cvves = fluidmodel->ComputeSpeciesCvVibEle ();
306286 vector<su2double> eves = fluidmodel->ComputeSpeciesEve (V[TVE_INDEX]);
307287
@@ -310,11 +290,8 @@ bool CNEMOEulerVariable::Cons2PrimVar(su2double *U, su2double *V,
310290 val_Cvves[iSpecies] = cvves[iSpecies];
311291 }
312292
313- su2double rhoCvtr = fluidmodel->ComputerhoCvtr ();
314- su2double rhoCvve = fluidmodel->ComputerhoCvve ();
315-
316- V[RHOCVTR_INDEX] = rhoCvtr;
317- V[RHOCVVE_INDEX] = rhoCvve;
293+ V[RHOCVTR_INDEX] = fluidmodel->ComputerhoCvtr ();
294+ V[RHOCVVE_INDEX] = fluidmodel->ComputerhoCvve ();
318295
319296 /* --- Pressure ---*/
320297 V[P_INDEX] = fluidmodel->ComputePressure ();
@@ -325,9 +302,11 @@ bool CNEMOEulerVariable::Cons2PrimVar(su2double *U, su2double *V,
325302 }
326303
327304 /* --- Partial derivatives of pressure and temperature ---*/
328- fluidmodel->ComputedPdU (V, eves, val_dPdU );
329- fluidmodel->ComputedTdU (V, val_dTdU );
330- fluidmodel->ComputedTvedU (V, eves, val_dTvedU);
305+ if (implicit){
306+ fluidmodel->ComputedPdU (V, eves, val_dPdU );
307+ fluidmodel->ComputedTdU (V, val_dTdU );
308+ fluidmodel->ComputedTvedU (V, eves, val_dTvedU);
309+ }
331310
332311 /* --- Sound speed ---*/
333312 V[A_INDEX] = fluidmodel->ComputeSoundSpeed ();
0 commit comments