Skip to content

Commit f2add99

Browse files
authored
Merge pull request #1702 from su2code/feature_NEMO_suth
Add in Sutherland's law for NEMO problems
2 parents 1993c6b + 15ae0bf commit f2add99

8 files changed

Lines changed: 143 additions & 61 deletions

File tree

Common/include/option_structure.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -613,11 +613,13 @@ MakePair("ONESPECIES", ONESPECIES)
613613
* \brief types of coefficient transport model
614614
*/
615615
enum class TRANSCOEFFMODEL {
616+
SUTHERLAND,
616617
WILKE,
617618
GUPTAYOS,
618619
CHAPMANN_ENSKOG
619620
};
620621
static const MapType<std::string, TRANSCOEFFMODEL> TransCoeffModel_Map = {
622+
MakePair("SUTHERLAND", TRANSCOEFFMODEL::SUTHERLAND)
621623
MakePair("WILKE", TRANSCOEFFMODEL::WILKE)
622624
MakePair("GUPTA-YOS", TRANSCOEFFMODEL::GUPTAYOS)
623625
MakePair("CHAPMANN-ENSKOG", TRANSCOEFFMODEL::CHAPMANN_ENSKOG)

Common/src/CConfig.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3792,8 +3792,8 @@ void CConfig::SetPostprocessing(SU2_COMPONENT val_software, unsigned short val_i
37923792
SU2_MPI::Error("Only STANDARD_AIR fluid model can be used with US Measurement System", CURRENT_FUNCTION);
37933793
}
37943794

3795-
if (Kind_FluidModel == SU2_NONEQ && Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE ) {
3796-
SU2_MPI::Error("Only WILKE transport model is stable for the NEMO solver using SU2TClib. Use Mutation++ instead.", CURRENT_FUNCTION);
3795+
if (Kind_FluidModel == SU2_NONEQ && (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::SUTHERLAND) ) {
3796+
SU2_MPI::Error("Only WILKE and SUTHERLAND transport models are stable for the NEMO solver using SU2TClib. Use Mutation++ instead.", CURRENT_FUNCTION);
37973797
}
37983798

37993799
if (Kind_FluidModel == MUTATIONPP && (Kind_TransCoeffModel != TRANSCOEFFMODEL::WILKE && Kind_TransCoeffModel != TRANSCOEFFMODEL::CHAPMANN_ENSKOG)) {

SU2_CFD/include/fluid/CSU2TCLib.hpp

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,13 @@ class CSU2TCLib : public CNEMOGas {
6464
phis, mus, /*!< \brief Auxiliary vectors to be used in Wilke/Blottner/Eucken model */
6565
A; /*!< \brief Auxiliary vector to be used in net production rate computation */
6666

67+
std::array<su2double,1> mu_ref; /*!< \brief Vector containing reference viscosity for Sutherland's law */
68+
std::array<su2double,1> k_ref; /*!< \brief Vector containing reference thermal conducivities for Sutherland's law */
69+
std::array<su2double,1> Sm_ref; /*!< \brief Vector containing Sutherland's constant for viscosity */
70+
std::array<su2double,1> Sk_ref; /*!< \brief Vector containing Sutherland's constant for thermal conductivities */
71+
72+
const su2double T_ref_suth = 273.15; /*!<\brief Reference temperature for Sutherland's model [K] */
73+
6774
su2activematrix CharElTemp, /*!< \brief Characteristic temperature of electron states. */
6875
ElDegeneracy, /*!< \brief Degeneracy of electron states. */
6976
RxnConstantTable, /*!< \brief Table of chemical equiibrium reaction constants */
@@ -203,35 +210,45 @@ class CSU2TCLib : public CNEMOGas {
203210
void ComputeKeqConstants(unsigned short val_Reaction);
204211

205212
/*!
206-
* \brief Get species diffusion coefficients with Wilke/Blottner/Eucken transport model.
213+
* \brief Calculate species diffusion coefficients with Wilke/Blottner/Eucken transport model.
207214
*/
208215
void DiffusionCoeffWBE();
209216

210217
/*!
211-
* \brief Get viscosity with Wilke/Blottner/Eucken transport model.
218+
* \brief Calculate viscosity with Wilke/Blottner/Eucken transport model.
212219
*/
213220
void ViscosityWBE();
214221

215222
/*!
216-
* \brief Get T-R and V-E thermal conductivities vector with Wilke/Blottner/Eucken transport model.
223+
* \brief Calculate T-R and V-E thermal conductivities vector with Wilke/Blottner/Eucken transport model.
217224
*/
218225
void ThermalConductivitiesWBE();
219226

220227
/*!
221-
* \brief Get species diffusion coefficients with Gupta-Yos transport model.
228+
* \brief Calculate species diffusion coefficients with Gupta-Yos transport model.
222229
*/
223230
void DiffusionCoeffGY();
224231

225232
/*!
226-
* \brief Get viscosity with Gupta-Yos transport model.
233+
* \brief Calculate viscosity with Gupta-Yos transport model.
227234
*/
228235
void ViscosityGY();
229236

230237
/*!
231-
* \brief Get T-R and V-E thermal conductivities vector with Gupta-Yos transport model.
238+
* \brief Calculate T-R and V-E thermal conductivities vector with Gupta-Yos transport model.
232239
*/
233240
void ThermalConductivitiesGY();
234241

242+
/*!
243+
* \brief Calculate viscosity with Sutherland's transport model.
244+
*/
245+
void ViscositySuth();
246+
247+
/*!
248+
* \brief Calculate T-R and V-E thermal conductivities vector with Sutherland's transport model.
249+
*/
250+
void ThermalConductivitiesSuth();
251+
235252
/*!
236253
* \brief Get reference temperature.
237254
*/

SU2_CFD/src/fluid/CSU2TCLib.cpp

Lines changed: 74 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou
5252
eve_eq.resize(nSpecies,0.0);
5353
eve.resize(nSpecies,0.0);
5454

55-
if(viscous){
55+
if (viscous) {
5656
MolarFracWBE.resize(nSpecies,0.0);
5757
phis.resize(nSpecies,0.0);
5858
mus.resize(nSpecies,0.0);
@@ -110,6 +110,14 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou
110110
ElDegeneracy(0,5) = 5;
111111
ElDegeneracy(0,6) = 15;
112112

113+
if (viscous) {
114+
//F.M. White, Viscous Fluid Flow, 3rd ed., McGraw-Hill, 2006.
115+
mu_ref[0] = 2.125E-5;
116+
k_ref[0] = 0.0163;
117+
Sm_ref[0] = 114.0;
118+
Sk_ref[0] = 170;
119+
}
120+
113121
} else if (gas_model == "N2"){
114122
/*--- Check for errors in the initialization ---*/
115123
if (nSpecies != 2) {
@@ -252,6 +260,14 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou
252260
Omega11(1,0,0) = -8.3493693E-03; Omega11(1,0,1) = 1.7808911E-01; Omega11(1,0,2) = -1.4466155E+00; Omega11(1,0,3) = 1.9324210E+03;
253261
Omega11(1,1,0) = -7.7439615E-03; Omega11(1,1,1) = 1.7129007E-01; Omega11(1,1,2) = -1.4809088E+00; Omega11(1,1,3) = 2.1284951E+03;
254262

263+
if (viscous) {
264+
//F.M. White, Viscous Fluid Flow, 3rd ed., McGraw-Hill, 2006.
265+
k_ref[0] = 0.0242;
266+
mu_ref[0] = 1.663E-5;
267+
Sm_ref[0] = 107.0;
268+
Sk_ref[0] = 150.0;
269+
}
270+
255271
} else if (gas_model == "AIR-5"){
256272

257273
/*--- Check for errors in the initialization ---*/
@@ -598,6 +614,14 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou
598614
Omega11(4,3,0) = -5.0478143E-03; Omega11(4,3,1) = 1.0236186E-01; Omega11(4,3,2) = -9.0058935E-01; Omega11(4,3,3) = 4.4472565E+02;
599615
Omega11(4,4,0) = -4.2451096E-03; Omega11(4,4,1) = 9.6820337E-02; Omega11(4,4,2) = -9.9770795E-01; Omega11(4,4,3) = 8.3320644E+02;
600616

617+
if (viscous) {
618+
//F.M. White, Viscous Fluid Flow, 3rd ed., McGraw-Hill, 2006.
619+
k_ref[0] = 0.0241;
620+
mu_ref[0] = 1.716E-5;
621+
Sm_ref[0] = 111.0;
622+
Sk_ref[0] = 194.0;
623+
}
624+
601625
} else if (gas_model == "AIR-7"){
602626

603627
/*--- Check for errors in the initialization ---*/
@@ -1027,6 +1051,14 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou
10271051
Omega11(4,2,0) = -1.0066279E-03; Omega11(4,2,1) = 1.1029264E-02; Omega11(4,2,2) = -2.0671266E-01; Omega11(4,2,3) = 8.2644384E+01;
10281052
Omega11(4,3,0) = -5.0478143E-03; Omega11(4,3,1) = 1.0236186E-01; Omega11(4,3,2) = -9.0058935E-01; Omega11(4,3,3) = 4.4472565E+02;
10291053
Omega11(4,4,0) = -4.2451096E-03; Omega11(4,4,1) = 9.6820337E-02; Omega11(4,4,2) = -9.9770795E-01; Omega11(4,4,3) = 8.3320644E+02;
1054+
1055+
if (viscous) {
1056+
//F.M. White, Viscous Fluid Flow, 3rd ed., McGraw-Hill, 2006.
1057+
k_ref[0] = 0.0241;
1058+
mu_ref[0] = 1.716E-5;
1059+
Sm_ref[0] = 111.0;
1060+
Sk_ref[0] = 194.0;
1061+
}
10301062
}
10311063

10321064
if (ionization) { nHeavy = nSpecies-1; nEl = 1; }
@@ -1598,6 +1630,8 @@ vector<su2double>& CSU2TCLib::GetDiffusionCoeff(){
15981630
DiffusionCoeffWBE();
15991631
if(Kind_TransCoeffModel == TRANSCOEFFMODEL::GUPTAYOS)
16001632
DiffusionCoeffGY();
1633+
if(Kind_TransCoeffModel == TRANSCOEFFMODEL::SUTHERLAND)
1634+
DiffusionCoeffWBE();
16011635

16021636
return DiffusionCoeff;
16031637

@@ -1609,6 +1643,8 @@ su2double CSU2TCLib::GetViscosity(){
16091643
ViscosityWBE();
16101644
if(Kind_TransCoeffModel == TRANSCOEFFMODEL::GUPTAYOS)
16111645
ViscosityGY();
1646+
if(Kind_TransCoeffModel == TRANSCOEFFMODEL::SUTHERLAND)
1647+
ViscositySuth();
16121648

16131649
return Mu;
16141650

@@ -1620,6 +1656,8 @@ vector<su2double>& CSU2TCLib::GetThermalConductivities(){
16201656
ThermalConductivitiesWBE();
16211657
if(Kind_TransCoeffModel == TRANSCOEFFMODEL::GUPTAYOS)
16221658
ThermalConductivitiesGY();
1659+
if(Kind_TransCoeffModel == TRANSCOEFFMODEL::SUTHERLAND)
1660+
ThermalConductivitiesSuth();
16231661

16241662
return ThermalConductivities;
16251663

@@ -1802,7 +1840,7 @@ void CSU2TCLib::DiffusionCoeffGY(){
18021840
//}
18031841

18041842
/*--- Assign species diffusion coefficient ---*/
1805-
DiffusionCoeff[iSpecies] = gam_t*gam_t*Mi*(1-Mi*gam_i) / denom;
1843+
DiffusionCoeff[iSpecies] = (denom > EPS) ? (gam_t*gam_t*Mi*(1-Mi*gam_i) / denom) : su2double(0.0);
18061844
}
18071845
// if (ionization) {
18081846
//TODO: Update correct iElectron....
@@ -1971,18 +2009,48 @@ void CSU2TCLib::ThermalConductivitiesGY(){
19712009
}
19722010

19732011
/*--- Translational contribution to thermal conductivity ---*/
1974-
ThermalCond_tr += (15.0/4.0)*kb*gam_i/denom_t;
2012+
ThermalCond_tr += (denom_t > EPS) ? ((15.0/4.0)*kb*gam_i/denom_t) : su2double(0.0);
19752013

19762014
/*--- Translational contribution to thermal conductivity ---*/
1977-
if (RotationModes[iSpecies] != 0.0)
1978-
ThermalCond_tr += kb*gam_i/denom_r;
2015+
if (RotationModes[iSpecies] != 0.0) ThermalCond_tr += (denom_r > EPS) ? (kb*gam_i/denom_r) : su2double(0.0);
19792016

19802017
/*--- Vibrational-electronic contribution to thermal conductivity ---*/
1981-
ThermalCond_ve += kb*Cvve/R*gam_i / denom_r;
2018+
ThermalCond_ve += (denom_r > EPS) ? (kb*Cvve/R*gam_i / denom_r) : su2double(0.0);
19822019
}
19832020

19842021
ThermalConductivities[0] = ThermalCond_tr;
19852022
ThermalConductivities[1] = ThermalCond_ve;
2023+
}
2024+
2025+
void CSU2TCLib::ViscositySuth(){
2026+
2027+
su2double T_nd = T / T_ref_suth;
2028+
2029+
/*--- Calculate mixture laminar viscosity ---*/
2030+
Mu = mu_ref[0] * T_nd * sqrt(T_nd) * ((T_ref_suth + Sm_ref[0]) / (T + Sm_ref[0]));
2031+
2032+
}
2033+
2034+
void CSU2TCLib::ThermalConductivitiesSuth(){
2035+
2036+
/*--- Compute mixture quantities ---*/
2037+
su2double mass = 0.0, rho = 0.0;
2038+
for (unsigned short ii=0; ii<nSpecies; ii++) rho += rhos[ii];
2039+
for (unsigned short ii=0; ii<nSpecies; ii++) mass += rhos[ii]/rho*MolarMass[ii];
2040+
2041+
su2double Cvtr = ComputerhoCvtr()/rho;
2042+
su2double Cvve = ComputerhoCvve()/rho;
2043+
2044+
/*--- Compute simple Kve scaling factor ---*/
2045+
su2double scl = Cvve/Cvtr;
2046+
2047+
/*--- Compute k's using Sutherland's law ---*/
2048+
su2double T_nd = T / T_ref_suth;
2049+
su2double k = k_ref[0] * T_nd * sqrt(T_nd) * ((T_ref_suth + Sk_ref[0]) / (T + Sk_ref[0]));
2050+
su2double kve = scl*k;
2051+
2052+
ThermalConductivities[0] = k;
2053+
ThermalConductivities[1] = kve;
19862054

19872055
}
19882056

SU2_CFD/src/numerics/NEMO/CNEMONumerics.cpp

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -228,61 +228,58 @@ void CNEMONumerics::GetViscousProjFlux(const su2double *val_primvar,
228228
su2double val_therm_conductivity_ve,
229229
const CConfig *config) {
230230

231+
if (ionization) {
232+
SU2_MPI::Error("NEED TO IMPLEMENT IONIZED FUNCTIONALITY!!!",CURRENT_FUNCTION);
233+
}
234+
231235
// Requires a slightly non-standard primitive vector:
232236
// Assumes - V = [Y1, ... , Yn, T, Tve, ... ]
233237
// and gradient GV = [GY1, ... , GYn, GT, GTve, ... ]
234238
// rather than the standard V = [r1, ... , rn, T, Tve, ... ]
235239

236-
unsigned short iSpecies, iVar, iDim, jDim;
237-
su2double mu, ktr, kve, rho, T, Tve, RuSI, Ru;
238-
auto& Ms = fluidmodel->GetSpeciesMolarMass();
239-
240240
su2activematrix Flux_Tensor(nVar,nDim);
241241

242242
/*--- Initialize ---*/
243-
for (iVar = 0; iVar < nVar; iVar++) {
243+
for (auto iVar = 0; iVar < nVar; iVar++) {
244244
Proj_Flux_Tensor[iVar] = 0.0;
245-
for (iDim = 0; iDim < nDim; iDim++)
245+
for (auto iDim = 0; iDim < nDim; iDim++)
246246
Flux_Tensor[iVar][iDim] = 0.0;
247247
}
248248

249-
/*--- Rename for convenience ---*/
249+
/*--- Rename variables for convenience ---*/
250+
const auto& Ms = fluidmodel->GetSpeciesMolarMass();
250251
const auto& Ds = val_diffusioncoeff;
251-
mu = val_lam_viscosity+val_eddy_viscosity;
252-
ktr = val_therm_conductivity;
253-
kve = val_therm_conductivity_ve;
254-
rho = val_primvar[RHO_INDEX];
255-
T = val_primvar[T_INDEX];
256-
Tve = val_primvar[TVE_INDEX];
252+
const su2double mu = val_lam_viscosity+val_eddy_viscosity;
253+
su2double ktr = val_therm_conductivity;
254+
su2double kve = val_therm_conductivity_ve;
255+
const su2double rho = val_primvar[RHO_INDEX];
256+
const su2double T = val_primvar[T_INDEX];
257+
const su2double Tve = val_primvar[TVE_INDEX];
257258
const auto& V = val_primvar;
258259
const auto& GV = val_gradprimvar;
259-
RuSI= UNIVERSAL_GAS_CONSTANT;
260-
Ru = 1000.0*RuSI;
261-
260+
const su2double Ru = 1000.0*UNIVERSAL_GAS_CONSTANT;
262261
const auto& hs = fluidmodel->ComputeSpeciesEnthalpy(T, Tve, val_eve);
263262

264263
/*--- Scale thermal conductivity with turb visc ---*/
265264
// TODO: Need to determine proper way to incorporate eddy viscosity
266265
// This is only scaling Kve by same factor as ktr
267266
// NOTE: V[iSpecies] is == Ys.
268267
su2double Mass = 0.0;
269-
su2double tmp1, scl, Cptr;
270-
for (iSpecies=0;iSpecies<nSpecies;iSpecies++)
268+
for (auto iSpecies = 0;iSpecies<nSpecies;iSpecies++)
271269
Mass += V[iSpecies]*Ms[iSpecies];
272-
Cptr = V[RHOCVTR_INDEX]/V[RHO_INDEX]+Ru/Mass;
273-
tmp1 = Cptr*(val_eddy_viscosity/Prandtl_Turb);
274-
scl = tmp1/ktr;
270+
271+
su2double Cptr = V[RHOCVTR_INDEX]/V[RHO_INDEX]+Ru/Mass;
272+
su2double tmp1 = Cptr*(val_eddy_viscosity/Prandtl_Turb);
273+
su2double scl = tmp1/ktr;
275274
ktr += Cptr*(val_eddy_viscosity/Prandtl_Turb);
276275
kve = kve*(1.0+scl);
277276
//Cpve = V[RHOCVVE_INDEX]+Ru/Mass;
278277
//kve += Cpve*(val_eddy_viscosity/Prandtl_Turb);
279278

280-
/*--- Pre-compute mixture quantities ---*/
281-
279+
/*--- Pre-compute mixture quantities ---*/ //TODO
282280
su2double Vector[MAXNDIM] = {0.0};
283-
284-
for (iDim = 0; iDim < nDim; iDim++) {
285-
for (iSpecies = 0; iSpecies < nHeavy; iSpecies++) {
281+
for (auto iDim = 0; iDim < nDim; iDim++) {
282+
for (auto iSpecies = 0; iSpecies < nHeavy; iSpecies++) {
286283
Vector[iDim] += rho*Ds[iSpecies]*GV[RHOS_INDEX+iSpecies][iDim];
287284
}
288285
}
@@ -291,37 +288,34 @@ void CNEMONumerics::GetViscousProjFlux(const su2double *val_primvar,
291288
ComputeStressTensor(nDim,tau,val_gradprimvar+VEL_INDEX, mu);
292289

293290
/*--- Populate entries in the viscous flux vector ---*/
294-
for (iDim = 0; iDim < nDim; iDim++) {
291+
for (auto iDim = 0; iDim < nDim; iDim++) {
292+
295293
/*--- Species diffusion velocity ---*/
296-
for (iSpecies = 0; iSpecies < nHeavy; iSpecies++) {
294+
for (auto iSpecies = 0; iSpecies < nHeavy; iSpecies++) {
297295
Flux_Tensor[iSpecies][iDim] = rho*Ds[iSpecies]*GV[RHOS_INDEX+iSpecies][iDim]
298296
- V[RHOS_INDEX+iSpecies]*Vector[iDim];
299297
}
300-
if (ionization) {
301-
SU2_MPI::Error("NEED TO IMPLEMENT IONIZED FUNCTIONALITY!!!",CURRENT_FUNCTION);
302-
}
303298

304-
/*--- Shear stress related terms ---*/
299+
/*--- Shear-stress/momentum related terms ---*/
305300
Flux_Tensor[nSpecies+nDim][iDim] = 0.0;
306-
for (jDim = 0; jDim < nDim; jDim++) {
301+
for (auto jDim = 0; jDim < nDim; jDim++) {
307302
Flux_Tensor[nSpecies+jDim][iDim] = tau[iDim][jDim];
308303
Flux_Tensor[nSpecies+nDim][iDim] += tau[iDim][jDim]*val_primvar[VEL_INDEX+jDim];
309304
}
310305

311306
/*--- Diffusion terms ---*/
312-
for (iSpecies = 0; iSpecies < nHeavy; iSpecies++) {
307+
for (auto iSpecies = 0; iSpecies < nHeavy; iSpecies++) {
313308
Flux_Tensor[nSpecies+nDim][iDim] += Flux_Tensor[iSpecies][iDim] * hs[iSpecies];
314309
Flux_Tensor[nSpecies+nDim+1][iDim] += Flux_Tensor[iSpecies][iDim] * val_eve[iSpecies];
315310
}
316311

317312
/*--- Heat transfer terms ---*/
318-
Flux_Tensor[nSpecies+nDim][iDim] += ktr*GV[T_INDEX][iDim] +
319-
kve*GV[TVE_INDEX][iDim];
313+
Flux_Tensor[nSpecies+nDim][iDim] += ktr*GV[T_INDEX][iDim] + kve*GV[TVE_INDEX][iDim];
320314
Flux_Tensor[nSpecies+nDim+1][iDim] += kve*GV[TVE_INDEX][iDim];
321315
}
322316

323-
for (iVar = 0; iVar < nVar; iVar++) {
324-
for (iDim = 0; iDim < nDim; iDim++) {
317+
for (auto iVar = 0; iVar < nVar; iVar++) {
318+
for (auto iDim = 0; iDim < nDim; iDim++) {
325319
Proj_Flux_Tensor[iVar] += Flux_Tensor[iVar][iDim]*val_normal[iDim];
326320
}
327321
}

SU2_CFD/src/numerics/NEMO/NEMO_diffusion.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -128,14 +128,10 @@ CNumerics::ResidualType<> CAvgGrad_NEMO::ComputeResidual(const CConfig *config)
128128
PrimVar_j[iSpecies] = V_j[iSpecies]/V_j[RHO_INDEX];
129129
Mean_PrimVar[iSpecies] = 0.5*(PrimVar_i[iSpecies] + PrimVar_j[iSpecies]);
130130
for (auto iDim = 0; iDim < nDim; iDim++) {
131-
Mean_GradPrimVar[iSpecies][iDim] = 0.5*(1.0/V_i[RHO_INDEX] *
132-
(PrimVar_Grad_i[iSpecies][iDim] -
133-
PrimVar_i[iSpecies] *
134-
PrimVar_Grad_i[RHO_INDEX][iDim]) +
135-
1.0/V_j[RHO_INDEX] *
136-
(PrimVar_Grad_j[iSpecies][iDim] -
137-
PrimVar_j[iSpecies] *
138-
PrimVar_Grad_j[RHO_INDEX][iDim]));
131+
Mean_GradPrimVar[iSpecies][iDim] = 0.5*(1.0/V_i[RHO_INDEX] * (PrimVar_Grad_i[iSpecies][iDim] -
132+
PrimVar_i[iSpecies] * PrimVar_Grad_i[RHO_INDEX][iDim]) +
133+
1.0/V_j[RHO_INDEX] * (PrimVar_Grad_j[iSpecies][iDim] -
134+
PrimVar_j[iSpecies] * PrimVar_Grad_j[RHO_INDEX][iDim]));
139135
}
140136
}
141137

0 commit comments

Comments
 (0)