Skip to content

Commit daae8ff

Browse files
committed
fix some warnings, replace exit with SU2_MPI::Error
1 parent f20d790 commit daae8ff

8 files changed

Lines changed: 87 additions & 137 deletions

File tree

Common/src/CConfig.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4142,9 +4142,7 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_
41424142
/* Check if the byte alignment of the matrix multiplications is a
41434143
multiple of 64. */
41444144
if( byteAlignmentMatMul%64 ) {
4145-
if(rank == MASTER_NODE)
4146-
cout << "ALIGNED_BYTES_MATMUL must be a multiple of 64." << endl;
4147-
exit(EXIT_FAILURE);
4145+
SU2_MPI::Error("ALIGNED_BYTES_MATMUL must be a multiple of 64.", CURRENT_FUNCTION);
41484146
}
41494147

41504148
/* Determine the value of sizeMatMulPadding, which is the matrix size in

SU2_CFD/include/sgs_model.inl

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*
77
* SU2 Project Website: https://su2code.github.io
88
*
9-
* The SU2 Project is maintained by the SU2 Foundation
9+
* The SU2 Project is maintained by the SU2 Foundation
1010
* (http://su2foundation.org)
1111
*
1212
* Copyright 2012-2020, SU2 Contributors (cf. AUTHORS.md)
@@ -191,8 +191,7 @@ inline void CSmagorinskyModel::ComputeGradEddyViscosity_2D(const su2double rho,
191191
const su2double distToWall,
192192
su2double &dMuTdx,
193193
su2double &dMuTdy) {
194-
cout << "CSmagorinskyModel::ComputeGradEddyViscosity_2D: Not implemented yet" << endl;
195-
exit(1);
194+
SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION);
196195
}
197196

198197
inline void CSmagorinskyModel::ComputeGradEddyViscosity_3D(const su2double rho,
@@ -231,8 +230,7 @@ inline void CSmagorinskyModel::ComputeGradEddyViscosity_3D(const su2double rho,
231230
su2double &dMuTdx,
232231
su2double &dMuTdy,
233232
su2double &dMuTdz) {
234-
cout << "CSmagorinskyModel::ComputeGradEddyViscosity_3D: Not implemented yet" << endl;
235-
exit(1);
233+
SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION);
236234
}
237235

238236
inline CWALEModel::CWALEModel(void) : CSGSModel() {
@@ -363,8 +361,7 @@ inline void CWALEModel::ComputeGradEddyViscosity_2D(const su2double rho,
363361
const su2double distToWall,
364362
su2double &dMuTdx,
365363
su2double &dMuTdy) {
366-
cout << "CWALEModel::ComputeGradEddyViscosity_2D: Not implemented yet" << endl;
367-
exit(1);
364+
SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION);
368365
}
369366

370367
inline void CWALEModel::ComputeGradEddyViscosity_3D(const su2double rho,
@@ -403,12 +400,11 @@ inline void CWALEModel::ComputeGradEddyViscosity_3D(const su2double rho,
403400
su2double &dMuTdx,
404401
su2double &dMuTdy,
405402
su2double &dMuTdz) {
406-
cout << "CWALEModel::ComputeGradEddyViscosity_3D: Not implemented yet" << endl;
407-
exit(1);
403+
SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION);
408404
}
409405

410406
inline CVremanModel::CVremanModel(void) : CSGSModel() {
411-
407+
412408
/* const_Vreman = 2.5*Cs*Cs where Cs is the Smagorinsky constant */
413409
const_Vreman = 0.07;
414410
}
@@ -422,8 +418,8 @@ inline su2double CVremanModel::ComputeEddyViscosity_2D(const su2double rho,
422418
const su2double dvdy,
423419
const su2double lenScale,
424420
const su2double distToWall) {
425-
cout << "CVremanModel::ComputeEddyViscosity_2D: Not implemented yet" << endl;
426-
exit(1);
421+
SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION);
422+
return 0;
427423
}
428424

429425
inline su2double CVremanModel::ComputeEddyViscosity_3D(const su2double rho,
@@ -438,7 +434,7 @@ inline su2double CVremanModel::ComputeEddyViscosity_3D(const su2double rho,
438434
const su2double dwdz,
439435
const su2double lenScale,
440436
const su2double distToWall) {
441-
437+
442438
su2double alpha11 = dudx;
443439
su2double alpha22 = dvdy;
444440
su2double alpha33 = dwdz;
@@ -495,8 +491,7 @@ inline void CVremanModel::ComputeGradEddyViscosity_2D(const su2double rho,
495491
const su2double distToWall,
496492
su2double &dMuTdx,
497493
su2double &dMuTdy) {
498-
cout << "CWALEModel::ComputeGradEddyViscosity_2D: Not implemented yet" << endl;
499-
exit(1);
494+
SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION);
500495
}
501496

502497
inline void CVremanModel::ComputeGradEddyViscosity_3D(const su2double rho,
@@ -535,6 +530,5 @@ inline void CVremanModel::ComputeGradEddyViscosity_3D(const su2double rho,
535530
su2double &dMuTdx,
536531
su2double &dMuTdy,
537532
su2double &dMuTdz) {
538-
cout << "CWALEModel::ComputeGradEddyViscosity_3D: Not implemented yet" << endl;
539-
exit(1);
533+
SU2_MPI::Error("Not implemented yet", CURRENT_FUNCTION);
540534
}

SU2_CFD/src/fluid/CNEMOGas.cpp

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,16 @@ CNEMOGas::CNEMOGas(const CConfig* config, unsigned short val_nDim): CFluidModel(
3737
MolarMass.resize(nSpecies,0.0);
3838
MolarFractions.resize(nSpecies,0.0);
3939
rhos.resize(nSpecies,0.0);
40-
Cvtrs.resize(nSpecies,0.0);
41-
Cvves.resize(nSpecies,0.0);
42-
eves.resize(nSpecies,0.0);
43-
hs.resize(nSpecies,0.0);
44-
ws.resize(nSpecies,0.0);
40+
Cvtrs.resize(nSpecies,0.0);
41+
Cvves.resize(nSpecies,0.0);
42+
eves.resize(nSpecies,0.0);
43+
hs.resize(nSpecies,0.0);
44+
ws.resize(nSpecies,0.0);
4545
DiffusionCoeff.resize(nSpecies,0.0);
4646
Enthalpy_Formation.resize(nSpecies,0.0);
4747
Ref_Temperature.resize(nSpecies,0.0);
4848
temperatures.resize(nEnergyEq,0.0);
49-
energies.resize(nEnergyEq,0.0);
49+
energies.resize(nEnergyEq,0.0);
5050
ThermalConductivities.resize(nEnergyEq,0.0);
5151

5252
gas_model = config->GetGasModel();
@@ -62,12 +62,12 @@ void CNEMOGas::SetTDStatePTTv(su2double val_pressure, const su2double *val_massf
6262
su2double denom;
6363

6464
for (iSpecies = 0; iSpecies < nHeavy; iSpecies++)
65-
MassFrac[iSpecies] = val_massfrac[iSpecies];
66-
Pressure = val_pressure;
67-
T = val_temperature;
68-
Tve = val_temperature_ve;
69-
70-
denom = 0.0;
65+
MassFrac[iSpecies] = val_massfrac[iSpecies];
66+
Pressure = val_pressure;
67+
T = val_temperature;
68+
Tve = val_temperature_ve;
69+
70+
denom = 0.0;
7171

7272
/*--- Calculate mixture density from supplied primitive quantities ---*/
7373
for (iSpecies = 0; iSpecies < nHeavy; iSpecies++)
@@ -79,15 +79,15 @@ void CNEMOGas::SetTDStatePTTv(su2double val_pressure, const su2double *val_massf
7979
for (iSpecies = 0; iSpecies < nSpecies; iSpecies++){
8080
rhos[iSpecies] = MassFrac[iSpecies]*Density;
8181
MassFrac[iSpecies] = rhos[iSpecies]/Density;
82-
}
82+
}
8383
}
8484

8585
su2double CNEMOGas::ComputeSoundSpeed(){
8686

8787
su2double conc, rhoCvtr;
8888

8989
conc = 0.0;
90-
rhoCvtr = 0.0;
90+
rhoCvtr = 0.0;
9191
Density = 0.0;
9292

9393
auto& Cvtrs = GetSpeciesCvTraRot();
@@ -127,7 +127,7 @@ su2double CNEMOGas::ComputeGasConstant(){
127127
for (iSpecies = 0; iSpecies < nHeavy; iSpecies++)
128128
Mass += MassFrac[iSpecies] * MolarMass[iSpecies];
129129
GasConstant = Ru / Mass;
130-
130+
131131
return GasConstant;
132132
}
133133

@@ -166,8 +166,7 @@ void CNEMOGas::ComputedPdU(su2double *V, vector<su2double>& val_eves, su2double
166166
su2double CvtrBAR, rhoCvtr, rhoCvve, rho_el, sqvel, conc, ef;
167167

168168
if (val_dPdU == NULL) {
169-
cout << "ERROR: CNEMOGas - CalcdPdU - Array dPdU not allocated!" << endl;
170-
exit(1);
169+
SU2_MPI::Error("Array dPdU not allocated!", CURRENT_FUNCTION);
171170
}
172171

173172
/*--- Determine the electron density (if ionized) ---*/
@@ -188,7 +187,7 @@ void CNEMOGas::ComputedPdU(su2double *V, vector<su2double>& val_eves, su2double
188187
Cvtrs = GetSpeciesCvTraRot();
189188
Enthalpy_Formation = GetSpeciesFormationEnthalpy();
190189
Ref_Temperature = GetRefTemperature();
191-
190+
192191
/*--- Rename for convenience ---*/
193192
rhoCvtr = V[RHOCVTR_INDEX];
194193
rhoCvve = V[RHOCVVE_INDEX];
@@ -241,7 +240,7 @@ void CNEMOGas::ComputedPdU(su2double *V, vector<su2double>& val_eves, su2double
241240

242241
/*--- Vib.-el energy derivative ---*/
243242
val_dPdU[nSpecies+nDim+1] = -val_dPdU[nSpecies+nDim] +
244-
rho_el*Ru/MolarMass[nSpecies-1]*1.0/rhoCvve;
243+
rho_el*Ru/MolarMass[nSpecies-1]*1.0/rhoCvve;
245244

246245
}
247246

@@ -273,9 +272,9 @@ void CNEMOGas::ComputedTdU(su2double *V, su2double *val_dTdU){
273272
ef = Enthalpy_Formation[iSpecies] - Ru/MolarMass[iSpecies]*Ref_Temperature[iSpecies];
274273
val_dTdU[iSpecies] = (-ef + 0.5*v2 + Cvtrs[iSpecies]*(Ref_Temperature[iSpecies]-T)) / rhoCvtr;
275274
}
275+
276276
if (ionization) {
277-
cout << "CNEMOGas: NEED TO IMPLEMENT dTdU for IONIZED MIX" << endl;
278-
exit(1);
277+
SU2_MPI::Error("NEED TO IMPLEMENT dTdU for IONIZED MIX",CURRENT_FUNCTION);
279278
}
280279

281280
/*--- Momentum derivatives ---*/
@@ -286,15 +285,15 @@ void CNEMOGas::ComputedTdU(su2double *V, su2double *val_dTdU){
286285
val_dTdU[nSpecies+nDim] = 1.0 / V[RHOCVTR_INDEX];
287286
val_dTdU[nSpecies+nDim+1] = -1.0 / V[RHOCVTR_INDEX];
288287

289-
}
288+
}
290289

291290
void CNEMOGas::ComputedTvedU(su2double *V, vector<su2double>& val_eves, su2double *val_dTvedU){
292291

293292
su2double rhoCvve;
294293

295-
/*--- Necessary indexes to assess primitive variables ---*/
294+
/*--- Necessary indexes to assess primitive variables ---*/
296295
unsigned long RHOCVVE_INDEX = nSpecies+nDim+7;
297-
296+
298297
/*--- Rename for convenience ---*/
299298
rhoCvve = V[RHOCVVE_INDEX];
300299

@@ -308,7 +307,7 @@ void CNEMOGas::ComputedTvedU(su2double *V, vector<su2double>& val_eves, su2doubl
308307

309308
/*--- Energy derivatives ---*/
310309
val_dTvedU[nSpecies+nDim] = 0.0;
311-
val_dTvedU[nSpecies+nDim+1] = 1.0 / rhoCvve;
310+
val_dTvedU[nSpecies+nDim+1] = 1.0 / rhoCvve;
312311

313312
}
314313

SU2_CFD/src/fluid/CSU2TCLib.cpp

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou
6666
if (mf != 1.0) {
6767
cout << "CONFIG ERROR: Intial gas mass fractions do not sum to 1!" << " mf is equal to "<< mf <<endl;
6868
}
69-
69+
7070
/*--- Define parameters of the gas model ---*/
7171
gamma = 1.667;
7272
nReactions = 0;
@@ -78,9 +78,9 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou
7878
// Characteristic vibrational temperatures
7979
CharVibTemp[0] = 0.0;
8080

81-
Enthalpy_Formation[0] = 0.0;
81+
Enthalpy_Formation[0] = 0.0;
8282
Ref_Temperature[0] = 0.0;
83-
nElStates[0] = 7;
83+
nElStates[0] = 7;
8484

8585
for (iSpecies = 0; iSpecies < nSpecies; iSpecies++)
8686
maxEl = max(maxEl, nElStates[iSpecies]);
@@ -90,16 +90,16 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou
9090
ElDegeneracy.resize(nSpecies,maxEl) = su2double(0.0);
9191

9292
/*--- AR: Blottner coefficients. ---*/
93-
Blottner(0,0) = 3.83444322E-03; Blottner(0,1) = 6.74718764E-01; Blottner(0,2) = -1.24290388E+01;
94-
93+
Blottner(0,0) = 3.83444322E-03; Blottner(0,1) = 6.74718764E-01; Blottner(0,2) = -1.24290388E+01;
94+
9595
/*--- AR: 7 states ---*/
9696
CharElTemp(0,0) = 0.000000000000000E+00;
9797
CharElTemp(0,1) = 1.611135736988230E+05;
9898
CharElTemp(0,2) = 1.625833076870950E+05;
9999
CharElTemp(0,3) = 1.636126382960720E+05;
100100
CharElTemp(0,4) = 1.642329518358000E+05;
101-
CharElTemp(0,5) = 1.649426852542080E+05;
102-
CharElTemp(0,6) = 1.653517702884570E+05;
101+
CharElTemp(0,5) = 1.649426852542080E+05;
102+
CharElTemp(0,6) = 1.653517702884570E+05;
103103
ElDegeneracy(0,0) = 1;
104104
ElDegeneracy(0,1) = 9;
105105
ElDegeneracy(0,2) = 21;
@@ -252,7 +252,7 @@ CSU2TCLib::CSU2TCLib(const CConfig* config, unsigned short val_nDim, bool viscou
252252
Omega11(0,1,0) = -8.3493693E-03; Omega11(0,1,1) = 1.7808911E-01; Omega11(0,1,2) = -1.4466155E+00; Omega11(0,1,3) = 1.9324210E+03;
253253
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;
254254
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;
255-
255+
256256
} else if (gas_model == "AIR-5"){
257257

258258
/*--- Check for errors in the initialization ---*/
@@ -1085,7 +1085,7 @@ void CSU2TCLib::DiffusionCoeffWBE(){
10851085

10861086
if (nSpecies==1) DiffusionCoeff[0] = 0;
10871087
else DiffusionCoeff[iSpecies] = (1-MolarFracWBE[iSpecies])/denom;
1088-
}
1088+
}
10891089
}
10901090

10911091
void CSU2TCLib::ViscosityWBE(){
@@ -1189,26 +1189,26 @@ void CSU2TCLib::DiffusionCoeffGY(){
11891189
jSpecies = nSpecies-1;
11901190
Mj = MolarMass[jSpecies];
11911191
gam_j = rhos[iSpecies] / (Density*Mj);
1192-
1192+
11931193
/*--- Calculate the Omega^(0,0)_ij collision cross section ---*/
11941194
Omega_ij = 1E-20 * Omega00(iSpecies,jSpecies,3)
11951195
* pow(Tve, Omega00(iSpecies,jSpecies,0)*log(Tve)*log(Tve)
11961196
+ Omega00(iSpecies,jSpecies,1)*log(Tve)
11971197
+ Omega00(iSpecies,jSpecies,2));
1198-
1198+
11991199
/*--- Calculate "delta1_ij" ---*/
12001200
d1_ij = 8.0/3.0 * sqrt((2.0*Mi*Mj) / (pi*Ru*Tve*(Mi+Mj))) * Omega_ij;
12011201
}
1202-
1202+
12031203
/*--- Assign species diffusion coefficient ---*/
12041204
DiffusionCoeff[iSpecies] = gam_t*gam_t*Mi*(1-Mi*gam_i) / denom;
12051205
}
12061206
if (ionization) {
12071207
iSpecies = nSpecies-1;
1208-
1208+
12091209
/*--- Initialize the species diffusion coefficient ---*/
12101210
DiffusionCoeff[iSpecies] = 0.0;
1211-
1211+
12121212
/*--- Calculate molar concentration ---*/
12131213
Mi = MolarMass[iSpecies];
12141214
gam_i = rhos[iSpecies] / (Density*Mi);
@@ -1217,16 +1217,16 @@ void CSU2TCLib::DiffusionCoeffGY(){
12171217
if (iSpecies != jSpecies) {
12181218
Mj = MolarMass[jSpecies];
12191219
gam_j = rhos[iSpecies] / (Density*Mj);
1220-
1220+
12211221
/*--- Calculate the Omega^(0,0)_ij collision cross section ---*/
12221222
Omega_ij = 1E-20 * Omega00(iSpecies,jSpecies,3)
12231223
* pow(Tve, Omega00(iSpecies,jSpecies,0)*log(Tve)*log(Tve)
12241224
+ Omega00(iSpecies,jSpecies,1)*log(Tve)
12251225
+ Omega00(iSpecies,jSpecies,2));
1226-
1226+
12271227
/*--- Calculate "delta1_ij" ---*/
12281228
d1_ij = 8.0/3.0 * sqrt((2.0*Mi*Mj) / (pi*Ru*Tve*(Mi+Mj))) * Omega_ij;
1229-
1229+
12301230
/*--- Calculate heavy-particle binary diffusion coefficient ---*/
12311231
D_ij = kb*Tve/(Pressure*d1_ij);
12321232
denom += gam_j/D_ij;
@@ -1307,8 +1307,7 @@ void CSU2TCLib::ThermalConductivitiesGY(){
13071307
kb = BOLTZMANN_CONSTANT;
13081308

13091309
if (ionization) {
1310-
cout << "SetThermalConductivity: NEEDS REVISION w/ IONIZATION" << endl;
1311-
exit(1);
1310+
SU2_MPI::Error("NEEDS REVISION w/ IONIZATION",CURRENT_FUNCTION);
13121311
}
13131312

13141313
/*--- Mixture vibrational-electronic specific heat ---*/
@@ -1444,7 +1443,7 @@ void CSU2TCLib::GetChemistryEquilConstants(unsigned short iReaction){
14441443
RxnConstantTable(4,0) = 0.52455; RxnConstantTable(4,1) = 2.4715; RxnConstantTable(4,2) = 1.7342; RxnConstantTable(4,3) = -6.55534; RxnConstantTable(4,4) = 0.030209;
14451444
RxnConstantTable(5,0) = 0.50989; RxnConstantTable(5,1) = 2.4773; RxnConstantTable(5,2) = 1.7132; RxnConstantTable(5,3) = -6.5441; RxnConstantTable(5,4) = 0.029591;
14461445

1447-
} else if (gas_model == "N2"){
1446+
} else if (gas_model == "N2"){
14481447

14491448
//N2 + M -> 2N + M
14501449
RxnConstantTable(0,0) = 3.4907; RxnConstantTable(0,1) = 0.83133; RxnConstantTable(0,2) = 4.0978; RxnConstantTable(0,3) = -12.728; RxnConstantTable(0,4) = 0.07487; //n = 1E14
@@ -1517,7 +1516,7 @@ void CSU2TCLib::GetChemistryEquilConstants(unsigned short iReaction){
15171516
RxnConstantTable(5,0) = -0.002428; RxnConstantTable(5,1) = -1.7415; RxnConstantTable(5,2) = -1.2331; RxnConstantTable(5,3) = -0.95365; RxnConstantTable(5,4) = -0.04585;
15181517
}
15191518

1520-
} else if (gas_model == "AIR-7"){
1519+
} else if (gas_model == "AIR-7"){
15211520

15221521
if (iReaction <= 6) {
15231522

0 commit comments

Comments
 (0)