@@ -2468,7 +2468,6 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
24682468
24692469 unsigned long iVertex, iPoint, iPointNormal;
24702470 unsigned short iMarker, iMarker_Monitoring, iDim, jDim;
2471- unsigned short T_INDEX = 0 , TVE_INDEX = 0 , VEL_INDEX = 0 ;
24722471 su2double Viscosity = 0.0 , Area, Density = 0.0 , GradTemperature = 0.0 , WallDistMod, FrictionVel,
24732472 UnitNormal[3 ] = {0.0 }, TauElem[3 ] = {0.0 }, Tau[3 ][3 ] = {{0.0 }}, Cp,
24742473 thermal_conductivity, MaxNorm = 8.0 , Grad_Vel[3 ][3 ] = {{0.0 }}, Grad_Temp[3 ] = {0.0 }, AxiFactor;
@@ -2477,27 +2476,19 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
24772476
24782477 string Marker_Tag, Monitoring_Tag;
24792478
2480- su2double Alpha = config->GetAoA () * PI_NUMBER / 180.0 ;
2481- su2double Beta = config->GetAoS () * PI_NUMBER / 180.0 ;
2482- su2double RefLength = config->GetRefLength ();
2483- su2double RefHeatFlux = config->GetHeat_Flux_Ref ();
2484- su2double Gas_Constant = config->GetGas_ConstantND ();
2479+ const su2double Alpha = config->GetAoA () * PI_NUMBER / 180.0 ;
2480+ const su2double Beta = config->GetAoS () * PI_NUMBER / 180.0 ;
2481+ const su2double RefLength = config->GetRefLength ();
2482+ const su2double RefHeatFlux = config->GetHeat_Flux_Ref ();
2483+ const su2double Gas_Constant = config->GetGas_ConstantND ();
24852484 auto Origin = config->GetRefOriginMoment (0 );
24862485
2487- su2double Prandtl_Lam = config->GetPrandtl_Lam ();
2488- bool energy = config->GetEnergy_Equation ();
2489- bool QCR = config->GetQCR ();
2490- bool axisymmetric = config->GetAxisymmetric ();
2491- bool roughwall = (config->GetnRoughWall () > 0 );
2492- bool nemo = config->GetNEMOProblem ();
2493-
2494- /* --- Get the locations of the primitive variables for NEMO ---*/
2495- if (nemo) {
2496- unsigned short nSpecies = config->GetnSpecies ();
2497- T_INDEX = nSpecies;
2498- TVE_INDEX = nSpecies+1 ;
2499- VEL_INDEX = nSpecies+2 ;
2500- }
2486+ const su2double Prandtl_Lam = config->GetPrandtl_Lam ();
2487+ const bool energy = config->GetEnergy_Equation ();
2488+ const bool QCR = config->GetQCR ();
2489+ const bool axisymmetric = config->GetAxisymmetric ();
2490+ const bool roughwall = (config->GetnRoughWall () > 0 );
2491+ const bool nemo = config->GetNEMOProblem ();
25012492
25022493 const su2double factor = 1.0 / AeroCoeffForceRef;
25032494 const su2double factorFric = config->GetRefArea () * factor;
@@ -2559,15 +2550,9 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
25592550
25602551 for (iDim = 0 ; iDim < nDim; iDim++) {
25612552 for (jDim = 0 ; jDim < nDim; jDim++) {
2562- if (!nemo) Grad_Vel[iDim][jDim] = nodes->GetGradient_Primitive (iPoint, iDim + 1 , jDim);
2563- else Grad_Vel[iDim][jDim] = nodes->GetGradient_Primitive (iPoint, iDim + VEL_INDEX, jDim);
2553+ Grad_Vel[iDim][jDim] = nodes->GetGradient_Primitive (iPoint, prim_idx.Velocity () + iDim, jDim);
25642554 }
2565-
2566- // / TODO: Move the temperature index logic to a function.
2567-
2568- if (FlowRegime == ENUM_REGIME::COMPRESSIBLE) Grad_Temp[iDim] = nodes->GetGradient_Primitive (iPoint, 0 , iDim);
2569-
2570- if (FlowRegime == ENUM_REGIME::INCOMPRESSIBLE) Grad_Temp[iDim] = nodes->GetGradient_Primitive (iPoint, nDim + 1 , iDim);
2555+ Grad_Temp[iDim] = nodes->GetGradient_Primitive (iPoint, prim_idx.Temperature (), iDim);
25712556 }
25722557
25732558 Viscosity = nodes->GetLaminarViscosity (iPoint);
@@ -2660,8 +2645,8 @@ void CFVMFlowSolverBase<V, FlowRegime>::Friction_Forces(const CGeometry* geometr
26602645 const auto & thermal_conductivity_ve = nodes->GetThermalConductivity_ve (iPoint);
26612646 const auto & Grad_PrimVar = nodes->GetGradient_Primitive (iPoint);
26622647
2663- su2double dTn = GeometryToolbox::DotProduct (nDim, Grad_PrimVar[T_INDEX ], UnitNormal);
2664- su2double dTven = GeometryToolbox::DotProduct (nDim, Grad_PrimVar[TVE_INDEX ], UnitNormal);
2648+ su2double dTn = GeometryToolbox::DotProduct (nDim, Grad_PrimVar[prim_idx. Temperature () ], UnitNormal);
2649+ su2double dTven = GeometryToolbox::DotProduct (nDim, Grad_PrimVar[prim_idx. Temperature_ve () ], UnitNormal);
26652650
26662651 /* --- Surface energy balance: trans-rot heat flux, vib-el heat flux,
26672652 enthalpy transport due to mass diffusion ---*/
0 commit comments