@@ -2003,20 +2003,20 @@ vector<su2double>& CSU2TCLib::ComputeTemperatures(vector<su2double>& val_rhos, s
20032003 T = (rhoE - rhoEve - rhoE_f + rhoE_ref - rhoEvel) / rhoCvtr;
20042004
20052005 /* --- Set temperature clipping values ---*/
2006- su2double Tmin = 50.0 ; su2double Tmax = 8E4 ;
2007- su2double Tvemin = 50.0 ; su2double Tvemax = 8E4 ;
2006+ const su2double Tmin = 50.0 ; const su2double Tmax = 8E4 ;
2007+ const su2double Tvemin = 50.0 ; const su2double Tvemax = 8E4 ;
20082008 su2double Tve_o = 50.0 ; su2double Tve2 = 8E4 ;
20092009
20102010 /* Determine if the temperature lies within the acceptable range */
20112011 if (T < Tmin) T = Tmin;
20122012 else if (T > Tmax) T = Tmax;
20132013
20142014 /* --- Set vibrational temperature algorithm parameters ---*/
2015- su2double NRtol = 1.0E-6 ; // Tolerance for the Newton-Raphson method
2016- su2double Btol = 1.0E-6 ; // Tolerance for the Bisection method
2017- unsigned short maxBIter = 50 ; // Maximum Bisection method iterations
2018- unsigned short maxNIter = 50 ; // Maximum Newton-Raphson iterations
2019- su2double scale = 0.9 ; // Scaling factor for Newton-Raphson step
2015+ const su2double NRtol = 1.0E-6 ; // Tolerance for the Newton-Raphson method
2016+ const su2double Btol = 1.0E-6 ; // Tolerance for the Bisection method
2017+ const unsigned short maxBIter = 50 ; // Maximum Bisection method iterations
2018+ const unsigned short maxNIter = 50 ; // Maximum Newton-Raphson iterations
2019+ const su2double scale = 0.9 ; // Scaling factor for Newton-Raphson step
20202020
20212021 /* --- Execute a Newton-Raphson root-finding method for Tve ---*/
20222022 // Initialize solution
@@ -2025,14 +2025,12 @@ vector<su2double>& CSU2TCLib::ComputeTemperatures(vector<su2double>& val_rhos, s
20252025 bool Bconvg = false ;
20262026 bool NRconvg = false ;
20272027 su2double rhoEve_t = 0.0 , rhoCvve = 0.0 ;
2028- vector<su2double> val_eves;
2029- vector<su2double> val_cvves;
20302028
20312029 /* --- Newton-Raphson Method --*/
20322030 for (unsigned short iIter = 0 ; iIter < maxNIter; iIter++) {
20332031 rhoEve_t = rhoCvve = 0.0 ;
2034- val_eves = ComputeSpeciesEve (Tve);
2035- val_cvves = ComputeSpeciesCvVibEle (Tve);
2032+ const auto & val_eves = ComputeSpeciesEve (Tve);
2033+ const auto & val_cvves = ComputeSpeciesCvVibEle (Tve);
20362034
20372035 for (iSpecies = 0 ; iSpecies < nSpecies; iSpecies++){
20382036 rhoEve_t += rhos[iSpecies] * val_eves[iSpecies];
@@ -2060,7 +2058,7 @@ vector<su2double>& CSU2TCLib::ComputeTemperatures(vector<su2double>& val_rhos, s
20602058 if (!NRconvg) {
20612059 for (unsigned short iIter = 0 ; iIter < maxBIter; iIter++) {
20622060 Tve = (Tve_o+Tve2)/2.0 ;
2063- val_eves = ComputeSpeciesEve (Tve);
2061+ const auto & val_eves = ComputeSpeciesEve (Tve);
20642062 rhoEve_t = 0.0 ;
20652063 for (iSpecies = 0 ; iSpecies < nSpecies; iSpecies++) rhoEve_t += rhos[iSpecies] * val_eves[iSpecies];
20662064 if (fabs (rhoEve_t - rhoEve) < Btol) {
0 commit comments