Skip to content

Commit 0809781

Browse files
authored
Merge pull request #1212 from su2code/small_fixes
Small fixes
2 parents fc99863 + 5960bf1 commit 0809781

5 files changed

Lines changed: 34 additions & 66 deletions

File tree

SU2_CFD/include/fluid/CMutationTCLib.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,7 @@ class CMutationTCLib : public CNEMOGas {
4545

4646
vector<su2double> Cv_ks, /*!< \brief Species specific heats at constant volume. */
4747
es, /*!< \brief Species energies. */
48-
omega_vec, /*!< \brief Dummy vector for vibrational energy source term. */
49-
h_RT; /*!< \brief Enthalpy divided by R*T. */
48+
omega_vec; /*!< \brief Dummy vector for vibrational energy source term. */
5049

5150
su2double Tref; /*!< \brief Reference temperature. */
5251

SU2_CFD/src/fluid/CMutationTCLib.cpp

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ CMutationTCLib::CMutationTCLib(const CConfig* config, unsigned short val_nDim):
3636

3737
/* Allocating memory*/
3838
Cv_ks.resize(nEnergyEq*nSpecies,0.0);
39-
h_RT.resize(nSpecies,0.0);
4039
es.resize(nEnergyEq*nSpecies,0.0);
4140
omega_vec.resize(1,0.0);
4241

@@ -148,12 +147,7 @@ su2double CMutationTCLib::ComputeEveSourceTerm(){
148147

149148
vector<su2double>& CMutationTCLib::ComputeSpeciesEnthalpy(su2double val_T, su2double val_Tve, su2double *val_eves){
150149

151-
su2double RuSI = UNIVERSAL_GAS_CONSTANT;
152-
su2double Ru = 1000.0*RuSI;
153-
154-
mix->speciesHOverRT(val_T, val_Tve, val_T, val_Tve, val_Tve, h_RT.data(), NULL, NULL, NULL, NULL, NULL);
155-
156-
for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) hs[iSpecies] = h_RT[iSpecies]*(RuSI*val_T);
150+
mix->getEnthalpiesMass(hs.data());
157151

158152
return hs;
159153
}
@@ -213,7 +207,7 @@ vector<su2double>& CMutationTCLib::GetSpeciesFormationEnthalpy() {
213207

214208
mix->speciesHOverRT(Tref, Tref, Tref, Tref, Tref, NULL, NULL, NULL, NULL, NULL, hf_RT.data());
215209

216-
for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) Enthalpy_Formation[iSpecies] = hf_RT[iSpecies]*(RuSI*Tref);
210+
for (iSpecies = 0; iSpecies < nSpecies; iSpecies++) Enthalpy_Formation[iSpecies] = hf_RT[iSpecies]*(RuSI*Tref*1000.0)/MolarMass[iSpecies];
217211

218212
return Enthalpy_Formation;
219213
}

SU2_CFD/src/numerics/NEMO/NEMO_sources.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ CNumerics::ResidualType<> CSource_NEMO::ComputeAxisymmetric(const CConfig *confi
376376
+v*TWO3*(2*PrimVar_Grad_i[nSpecies+2][1]-PrimVar_Grad_i[nSpecies+2][0]
377377
-v*yinv+rho*turb_ke_i))
378378
-total_conductivity_i*PrimVar_Grad_i[nSpecies][1])
379-
-TWO3*(AuxVar_Grad_i[1][1]+AuxVar_Grad_i[2][1]));
379+
-TWO3*(AuxVar_Grad_i[1][1]+AuxVar_Grad_i[2][0]));
380380
residual[nSpecies+3] -= Volume*(yinv*(sumJeve_y -qy_ve));
381381
}
382382

SU2_CFD/src/output/COutput.cpp

Lines changed: 29 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -912,34 +912,9 @@ bool COutput::Convergence_Monitoring(CConfig *config, unsigned long Iteration) {
912912

913913
/*--- Apply the same convergence criteria to all the processors ---*/
914914

915-
#ifdef HAVE_MPI
916-
917-
unsigned short *sbuf_conv = NULL, *rbuf_conv = NULL;
918-
sbuf_conv = new unsigned short[1]; sbuf_conv[0] = 0;
919-
rbuf_conv = new unsigned short[1]; rbuf_conv[0] = 0;
920-
921-
/*--- Convergence criteria ---*/
922-
923-
sbuf_conv[0] = convergence;
924-
SU2_MPI::Reduce(sbuf_conv, rbuf_conv, 1, MPI_UNSIGNED_SHORT, MPI_SUM, MASTER_NODE, SU2_MPI::GetComm());
925-
926-
/*-- Compute global convergence criteria in the master node --*/
927-
928-
sbuf_conv[0] = 0;
929-
if (rank == MASTER_NODE) {
930-
if (rbuf_conv[0] == size) sbuf_conv[0] = 1;
931-
else sbuf_conv[0] = 0;
932-
}
933-
934-
SU2_MPI::Bcast(sbuf_conv, 1, MPI_UNSIGNED_SHORT, MASTER_NODE, SU2_MPI::GetComm());
935-
936-
if (sbuf_conv[0] == 1) { convergence = true; }
937-
else { convergence = false; }
938-
939-
delete [] sbuf_conv;
940-
delete [] rbuf_conv;
941-
942-
#endif
915+
unsigned short local = convergence, global = 0;
916+
SU2_MPI::Allreduce(&local, &global, 1, MPI_UNSIGNED_SHORT, MPI_MAX, SU2_MPI::GetComm());
917+
convergence = global > 0;
943918

944919
return convergence;
945920
}
@@ -1149,49 +1124,49 @@ void COutput::SetScreen_Output(CConfig *config) {
11491124

11501125
void COutput::PreprocessHistoryOutput(CConfig *config, bool wrt){
11511126

1152-
noWriting = !wrt;
1153-
1154-
/*--- Set the common output fields ---*/
1127+
noWriting = !wrt;
11551128

1156-
SetCommonHistoryFields(config);
1129+
/*--- Set the common output fields ---*/
11571130

1158-
/*--- Set the History output fields using a virtual function call to the child implementation ---*/
1131+
SetCommonHistoryFields(config);
11591132

1160-
SetHistoryOutputFields(config);
1133+
/*--- Set the History output fields using a virtual function call to the child implementation ---*/
11611134

1162-
/*--- Postprocess the history fields. Creates new fields based on the ones set in the child classes ---*/
1135+
SetHistoryOutputFields(config);
11631136

1164-
Postprocess_HistoryFields(config);
1137+
/*--- Postprocess the history fields. Creates new fields based on the ones set in the child classes ---*/
11651138

1166-
/*--- We use a fixed size of the file output summary table ---*/
1139+
Postprocess_HistoryFields(config);
11671140

1168-
int total_width = 72;
1169-
fileWritingTable->AddColumn("File Writing Summary", (total_width)/2-1);
1170-
fileWritingTable->AddColumn("Filename", total_width/2-1);
1171-
fileWritingTable->SetAlign(PrintingToolbox::CTablePrinter::LEFT);
1141+
/*--- We use a fixed size of the file output summary table ---*/
11721142

1173-
/*--- Check for consistency and remove fields that are requested but not available --- */
1143+
int total_width = 72;
1144+
fileWritingTable->AddColumn("File Writing Summary", (total_width)/2-1);
1145+
fileWritingTable->AddColumn("Filename", total_width/2-1);
1146+
fileWritingTable->SetAlign(PrintingToolbox::CTablePrinter::LEFT);
11741147

1175-
CheckHistoryOutput();
1148+
/*--- Check for consistency and remove fields that are requested but not available --- */
11761149

1177-
if (rank == MASTER_NODE && !noWriting){
1150+
CheckHistoryOutput();
11781151

1179-
/*--- Open history file and print the header ---*/
1180-
if (!config->GetMultizone_Problem() || config->GetWrt_ZoneHist())
1181-
PrepareHistoryFile(config);
1152+
if (rank == MASTER_NODE && !noWriting){
11821153

1183-
total_width = nRequestedScreenFields*fieldWidth + (nRequestedScreenFields-1);
1154+
/*--- Open history file and print the header ---*/
1155+
if (!config->GetMultizone_Problem() || config->GetWrt_ZoneHist())
1156+
PrepareHistoryFile(config);
11841157

1185-
/*--- Set the multizone screen header ---*/
1158+
total_width = nRequestedScreenFields*fieldWidth + (nRequestedScreenFields-1);
11861159

1187-
if (config->GetMultizone_Problem()){
1188-
multiZoneHeaderTable->AddColumn(multiZoneHeaderString, total_width);
1189-
multiZoneHeaderTable->SetAlign(PrintingToolbox::CTablePrinter::CENTER);
1190-
multiZoneHeaderTable->SetPrintHeaderBottomLine(false);
1191-
}
1160+
/*--- Set the multizone screen header ---*/
11921161

1162+
if (config->GetMultizone_Problem()){
1163+
multiZoneHeaderTable->AddColumn(multiZoneHeaderString, total_width);
1164+
multiZoneHeaderTable->SetAlign(PrintingToolbox::CTablePrinter::CENTER);
1165+
multiZoneHeaderTable->SetPrintHeaderBottomLine(false);
11931166
}
11941167

1168+
}
1169+
11951170
}
11961171

11971172
void COutput::PreprocessMultizoneHistoryOutput(COutput **output, CConfig **config, CConfig* driver_config, bool wrt){

preconfigure.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ def init_codi(argument_dict, modes, mpi_support = False, update = False):
289289
# The sha tag must be maintained manually to point to the correct commit
290290
sha_version_codi = '1b8d3f5f03de560fb63a2a76ad91ab7bb3fa67d8'
291291
github_repo_codi = 'https://github.com/scicompkl/CoDiPack'
292-
sha_version_medi = 'b84cef4272ab8bad981c0d0386d855daa8fbd340'
292+
sha_version_medi = '6aef76912e7099c4f08c9705848797ca9e8070da'
293293
github_repo_medi = 'https://github.com/SciCompKL/MeDiPack'
294294

295295
medi_name = 'MeDiPack'

0 commit comments

Comments
 (0)