Skip to content

Commit 6537a36

Browse files
committed
Initialize newton method with Tve
1 parent faab298 commit 6537a36

6 files changed

Lines changed: 10 additions & 9 deletions

File tree

SU2_CFD/include/fluid/CMutationTCLib.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ class CMutationTCLib : public CNEMOGas {
125125
/*!
126126
* \brief Compute translational and vibrational temperatures vector.
127127
*/
128-
vector<su2double>& ComputeTemperatures(vector<su2double>& val_rhos, su2double rhoE, su2double rhoEve, su2double rhoEvel) final;
128+
vector<su2double>& ComputeTemperatures(vector<su2double>& val_rhos, su2double rhoE, su2double rhoEve, su2double rhoEvel, su2double Tve_old) final;
129129

130130
/*!
131131
* \brief Get species molar mass.

SU2_CFD/include/fluid/CNEMOGas.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ class CNEMOGas : public CFluidModel {
177177
/*!
178178
* \brief Compute translational and vibrational temperatures vector.
179179
*/
180-
virtual vector<su2double>& ComputeTemperatures(vector<su2double>& val_rhos, su2double rhoEmix, su2double rhoEve, su2double rhoEvel) = 0;
180+
virtual vector<su2double>& ComputeTemperatures(vector<su2double>& val_rhos, su2double rhoEmix, su2double rhoEve, su2double rhoEvel, su2double Tve_old) = 0;
181181

182182
/*!
183183
* \brief Compute speed of sound.

SU2_CFD/include/fluid/CSU2TCLib.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class CSU2TCLib : public CNEMOGas {
186186
/*!
187187
* \brief Compute translational and vibrational temperatures vector.
188188
*/
189-
vector<su2double>& ComputeTemperatures(vector<su2double>& val_rhos, su2double rhoEmix, su2double rhoEve, su2double rhoEvel) final;
189+
vector<su2double>& ComputeTemperatures(vector<su2double>& val_rhos, su2double rhoEmix, su2double rhoEve, su2double rhoEvel, su2double Tve_old) final;
190190

191191
private:
192192

SU2_CFD/src/fluid/CMutationTCLib.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ vector<su2double>& CMutationTCLib::GetThermalConductivities(){
185185
return ThermalConductivities;
186186
}
187187

188-
vector<su2double>& CMutationTCLib::ComputeTemperatures(vector<su2double>& val_rhos, su2double rhoE, su2double rhoEve, su2double rhoEvel){
188+
vector<su2double>& CMutationTCLib::ComputeTemperatures(vector<su2double>& val_rhos, su2double rhoE, su2double rhoEve, su2double rhoEvel, su2double Tve_old){
189189

190190
rhos = val_rhos;
191191

SU2_CFD/src/fluid/CSU2TCLib.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1986,7 +1986,7 @@ void CSU2TCLib::ThermalConductivitiesGY(){
19861986

19871987
}
19881988

1989-
vector<su2double>& CSU2TCLib::ComputeTemperatures(vector<su2double>& val_rhos, su2double rhoE, su2double rhoEve, su2double rhoEvel) {
1989+
vector<su2double>& CSU2TCLib::ComputeTemperatures(vector<su2double>& val_rhos, su2double rhoE, su2double rhoEve, su2double rhoEvel, su2double Tve_old) {
19901990

19911991
rhos = val_rhos;
19921992

@@ -2008,8 +2008,8 @@ vector<su2double>& CSU2TCLib::ComputeTemperatures(vector<su2double>& val_rhos, s
20082008
su2double Tve_o = 50.0; su2double Tve2 = 8E4;
20092009

20102010
/* Determine if the temperature lies within the acceptable range */
2011-
if (T < Tmin) T = Tmin;
2012-
else if (T > Tmax) T = Tmax;
2011+
if (T < Tmin) T = Tmin; else if (T > Tmax) T = Tmax;
2012+
if (Tve_old<Tvemin) Tve_old = Tvemin; else if (Tve_old>Tvemax) Tve_old = Tvemax;
20132013

20142014
/*--- Set vibrational temperature algorithm parameters ---*/
20152015
const su2double NRtol = 1.0E-6; // Tolerance for the Newton-Raphson method
@@ -2020,7 +2020,7 @@ vector<su2double>& CSU2TCLib::ComputeTemperatures(vector<su2double>& val_rhos, s
20202020

20212021
/*--- Execute a Newton-Raphson root-finding method for Tve ---*/
20222022
//Initialize solution
2023-
Tve = T;
2023+
Tve = Tve_old;
20242024

20252025
bool Bconvg = false;
20262026
bool NRconvg = false;

SU2_CFD/src/variables/CNEMOEulerVariable.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ bool CNEMOEulerVariable::Cons2PrimVar(su2double *U, su2double *V,
219219
}
220220

221221
/*--- Assign temperatures ---*/
222-
const auto& T = fluidmodel->ComputeTemperatures(rhos, rhoE, rhoEve, 0.5*rho*sqvel);
222+
const su2double Tve_old = V[TVE_INDEX];
223+
const auto& T = fluidmodel->ComputeTemperatures(rhos, rhoE, rhoEve, 0.5*rho*sqvel, Tve_old);
223224

224225
/*--- Temperatures ---*/
225226
V[T_INDEX] = T[0];

0 commit comments

Comments
 (0)