@@ -2118,10 +2118,7 @@ void CIncEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPo
21182118 Cp = nodes->GetSpecificHeatCp (iPoint);
21192119 oneOverCp = 1.0 /Cp;
21202120 Temperature = nodes->GetTemperature (iPoint);
2121- Enthalpy = Cp * Temperature;
2122- if (energy && multicomponent) {
2123- Enthalpy = nodes->GetEnthalpy (iPoint);
2124- }
2121+ Enthalpy = nodes->GetEnthalpy (iPoint);
21252122
21262123 for (iDim = 0 ; iDim < nDim; iDim++)
21272124 Velocity[iDim] = nodes->GetVelocity (iPoint,iDim);
@@ -2131,7 +2128,7 @@ void CIncEulerSolver::SetPreconditioner(const CConfig *config, unsigned long iPo
21312128 law, but in the future, dRhodT should be in the fluid model. ---*/
21322129
21332130 if (variable_density) {
2134- if (multicomponent && energy ){
2131+ if (multicomponent){
21352132 dRhodT = -Density / (Cp * Temperature);
21362133 Cp = oneOverCp = 1.0 ;
21372134 } else {
@@ -2229,7 +2226,7 @@ void CIncEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contain
22292226
22302227 const bool implicit = config->GetKind_TimeIntScheme () == EULER_IMPLICIT;
22312228 const bool viscous = config->GetViscous ();
2232- const bool energy_multicomponent = config->GetKind_FluidModel () == FLUID_MIXTURE && config-> GetEnergy_Equation () ;
2229+ const bool species_model = config->GetKind_Species_Model () != SPECIES_MODEL::NONE ;
22332230
22342231 su2double Normal[MAXNDIM] = {0.0 };
22352232
@@ -2274,14 +2271,12 @@ void CIncEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contain
22742271
22752272 V_infty[prim_idx.Temperature ()] = GetTemperature_Inf ();
22762273
2277- /* -- Enthalpy at far-field is needed for energy equation in multicomponent and reacting flows. ---*/
2278- if (energy_multicomponent) {
2279- CFluidModel* auxFluidModel = solver_container[FLOW_SOL]->GetFluidModel ();
2280- const su2double* scalar_infty = config->GetSpecies_Init ();
2281- auxFluidModel->SetTDState_T (V_infty[prim_idx.Temperature ()],
2282- scalar_infty); // obtain enthalpy from temperature and species mass fractions
2283- V_infty[prim_idx.Enthalpy ()] = auxFluidModel->GetEnthalpy ();
2284- }
2274+ /* -- Enthalpy at far-field. ---*/
2275+ const su2double* scalar_infty = nullptr ;
2276+ if (species_model) scalar_infty = config->GetSpecies_Init ();
2277+ CFluidModel* auxFluidModel = solver_container[FLOW_SOL]->GetFluidModel ();
2278+ auxFluidModel->SetTDState_T (V_infty[prim_idx.Temperature ()], scalar_infty);
2279+ V_infty[prim_idx.Enthalpy ()] = auxFluidModel->GetEnthalpy ();
22852280
22862281 /* --- Store the density. ---*/
22872282
@@ -2318,7 +2313,7 @@ void CIncEulerSolver::BC_Far_Field(CGeometry *geometry, CSolver **solver_contain
23182313
23192314 /* --- Viscous residual contribution ---*/
23202315
2321- if (!viscous || energy_multicomponent ) continue ;
2316+ if (!viscous || species_model ) continue ;
23222317
23232318 /* --- Set transport properties at infinity. ---*/
23242319
@@ -2373,7 +2368,7 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
23732368
23742369 const bool implicit = (config->GetKind_TimeIntScheme () == EULER_IMPLICIT);
23752370 const bool viscous = config->GetViscous ();
2376- const bool energy_multicomponent = config->GetKind_FluidModel () == FLUID_MIXTURE && config-> GetEnergy_Equation () ;
2371+ const bool species_model = config->GetKind_Species_Model () != SPECIES_MODEL::NONE ;
23772372
23782373 string Marker_Tag = config->GetMarker_All_TagBound (val_marker);
23792374
@@ -2537,13 +2532,12 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
25372532 V_inlet[prim_idx.Pressure ()] = nodes->GetPressure (iPoint);
25382533 }
25392534
2540- /* -- Enthalpy is needed for energy equation in multicomponent and reacting flows. ---*/
2541- if (energy_multicomponent) {
2542- CFluidModel* auxFluidModel = solver_container[FLOW_SOL]->GetFluidModel ();
2543- const su2double* scalar_inlet = config->GetInlet_SpeciesVal (config->GetMarker_All_TagBound (val_marker));
2544- auxFluidModel->SetTDState_T (V_inlet[prim_idx.Temperature ()], scalar_inlet);
2545- V_inlet[prim_idx.Enthalpy ()] = auxFluidModel->GetEnthalpy ();
2546- }
2535+ /* -- Enthalpy is needed for energy equation. ---*/
2536+ const su2double* scalar_inlet = nullptr ;
2537+ if (species_model) scalar_inlet = config->GetInlet_SpeciesVal (config->GetMarker_All_TagBound (val_marker));
2538+ CFluidModel* auxFluidModel = solver_container[FLOW_SOL]->GetFluidModel ();
2539+ auxFluidModel->SetTDState_T (V_inlet[prim_idx.Temperature ()], scalar_inlet);
2540+ V_inlet[prim_idx.Enthalpy ()] = auxFluidModel->GetEnthalpy ();
25472541
25482542 /* --- Access density at the node. This is either constant by
25492543 construction, or will be set fixed implicitly by the temperature
@@ -2582,7 +2576,7 @@ void CIncEulerSolver::BC_Inlet(CGeometry *geometry, CSolver **solver_container,
25822576
25832577 /* --- Viscous contribution, commented out because serious convergence problems ---*/
25842578
2585- if (!viscous || energy_multicomponent ) continue ;
2579+ if (!viscous || species_model ) continue ;
25862580
25872581 /* --- Set transport properties at the inlet ---*/
25882582
@@ -2634,7 +2628,7 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container,
26342628
26352629 const bool implicit = (config->GetKind_TimeIntScheme () == EULER_IMPLICIT);
26362630 const bool viscous = config->GetViscous ();
2637- const bool energy_multicomponent = config->GetKind_FluidModel () == FLUID_MIXTURE && config-> GetEnergy_Equation () ;
2631+ const bool species_model = config->GetKind_Species_Model () != SPECIES_MODEL::NONE ;
26382632 string Marker_Tag = config->GetMarker_All_TagBound (val_marker);
26392633
26402634 su2double Normal[MAXNDIM] = {0.0 };
@@ -2761,14 +2755,12 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container,
27612755
27622756 V_outlet[prim_idx.CpTotal ()] = nodes->GetSpecificHeatCp (iPoint);
27632757
2764- /* -- Enthalpy is needed for energy equation in multicomponent and reacting flows. ---*/
2765- if (energy_multicomponent) {
2766- CFluidModel* auxFluidModel = solver_container[FLOW_SOL]->GetFluidModel ();;
2767- const su2double* scalar_outlet = solver_container[SPECIES_SOL]->GetNodes ()->GetSolution (iPoint);
2768- auxFluidModel->SetTDState_T (nodes->GetTemperature (iPoint),
2769- scalar_outlet); // compute total enthalpy from temperature
2770- V_outlet[prim_idx.Enthalpy ()] = auxFluidModel->GetEnthalpy ();
2771- }
2758+ /* -- Enthalpy is needed for energy equation. ---*/
2759+ const su2double* scalar_outlet = nullptr ;
2760+ if (species_model) scalar_outlet = solver_container[SPECIES_SOL]->GetNodes ()->GetSolution (iPoint);
2761+ CFluidModel* auxFluidModel = solver_container[FLOW_SOL]->GetFluidModel ();
2762+ auxFluidModel->SetTDState_T (nodes->GetTemperature (iPoint), scalar_outlet);
2763+ V_outlet[prim_idx.Enthalpy ()] = auxFluidModel->GetEnthalpy ();
27722764
27732765 /* --- Set various quantities in the solver class ---*/
27742766
@@ -2794,7 +2786,7 @@ void CIncEulerSolver::BC_Outlet(CGeometry *geometry, CSolver **solver_container,
27942786
27952787 /* --- Viscous contribution, commented out because serious convergence problems ---*/
27962788
2797- if (!viscous || energy_multicomponent ) continue ;
2789+ if (!viscous || species_model ) continue ;
27982790
27992791 /* --- Set transport properties at the outlet. ---*/
28002792
0 commit comments