Skip to content

Commit 9116803

Browse files
committed
address PR comments
1 parent dfb8a4e commit 9116803

1 file changed

Lines changed: 7 additions & 10 deletions

File tree

SU2_CFD/src/fluid/CSU2TCLib.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1927,14 +1927,15 @@ su2double CSU2TCLib::ComputeCollisionDelta(unsigned iSpecies, unsigned jSpecies,
19271927
}
19281928

19291929
const su2double Omega_ij = ComputeCollisionCrossSection(iSpecies, jSpecies, T, d1, coulomb);
1930-
19311930
const su2double pi = PI_NUMBER;
1931+
su2double delta = 0.0;
19321932

19331933
if (d1) {
1934-
return 8.0/3.0 * sqrt((2.0*Mi*Mj) / (pi*Ru*T*(Mi+Mj))) * Omega_ij; // d1_ij
1934+
delta = 8.0/3.0 * sqrt((2.0*Mi*Mj) / (pi*Ru*T*(Mi+Mj))) * Omega_ij; // d1_ij
19351935
} else {
1936-
return 16.0/5.0 * sqrt((2.0*Mi*Mj) / (pi*Ru*T*(Mi+Mj))) * Omega_ij; // d2_ij
1936+
delta = 16.0/5.0 * sqrt((2.0*Mi*Mj) / (pi*Ru*T*(Mi+Mj))) * Omega_ij; // d2_ij
19371937
}
1938+
return fmin(delta, 1E16)
19381939
}
19391940

19401941
void CSU2TCLib::DiffusionCoeffGY(){
@@ -1967,7 +1968,6 @@ void CSU2TCLib::DiffusionCoeffGY(){
19671968
const su2double T_col = (iSpecies == 0 && ionization) ? Tve : T;
19681969

19691970
su2double d1_ij = ComputeCollisionDelta(iSpecies, jSpecies, Mi, Mj, T_col, true);
1970-
if (d1_ij > 1E16) d1_ij = 1E16;
19711971

19721972
const su2double D_ij = kb*T_col/(Pressure*d1_ij);
19731973
denom += gam_j/D_ij;
@@ -1999,7 +1999,6 @@ void CSU2TCLib::ViscosityGY(){
19991999
const su2double T_col = (iSpecies == 0 && ionization) ? Tve : T;
20002000

20012001
su2double d2_ij = ComputeCollisionDelta(iSpecies, jSpecies, Mi, Mj, T_col, false);
2002-
if (d2_ij > 1E16) d2_ij = 1E16;
20032002

20042003
denom += gam_j*d2_ij;
20052004
}
@@ -2049,8 +2048,6 @@ void CSU2TCLib::ThermalConductivitiesGY(){
20492048

20502049
su2double d1_ij = ComputeCollisionDelta(iSpecies, jSpecies, Mi, Mj, T_col, true);
20512050
su2double d2_ij = ComputeCollisionDelta(iSpecies, jSpecies, Mi, Mj, T_col, false);
2052-
if (d1_ij >1E16) d1_ij = 1E16;
2053-
if (d2_ij >1E16) d2_ij = 1E16;
20542051

20552052
if (jSpecies == 0 && ionization) { denom_t += 3.54*gam_j*d2_ij; }
20562053
else { denom_t += a_ij*gam_j*d2_ij; }
@@ -2060,9 +2057,9 @@ void CSU2TCLib::ThermalConductivitiesGY(){
20602057
}
20612058

20622059
/*--- Prevent divide by 0 ---*/
2063-
if (denom_t == 0.0) denom_t = EPS;
2064-
if (denom_r == 0.0) denom_r = EPS;
2065-
if (denom_re == 0.0) denom_re = EPS;
2060+
if (denom_t <= 0.0) denom_t = EPS;
2061+
if (denom_r <= 0.0) denom_r = EPS;
2062+
if (denom_re <= 0.0) denom_re = EPS;
20662063

20672064
/*--- Translational contribution to thermal conductivity ---*/
20682065
if (!(ionization && iSpecies == 0)) ThermalCond_tr += ((15.0/4.0)*kb*gam_i/denom_t);

0 commit comments

Comments
 (0)