Skip to content

Commit ff966f0

Browse files
committed
Finer granularity in turb hist output as well.
RMS_RES, MAX_RES, BGS_RES, TurbLINSOL are all written in separate functions.
1 parent 5195dfd commit ff966f0

5 files changed

Lines changed: 142 additions & 58 deletions

File tree

SU2_CFD/include/output/CFlowOutput.hpp

Lines changed: 34 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,17 +56,44 @@ class CFlowOutput : public CFVMOutput{
5656
void SetAnalyzeSurface(const CSolver *solver, const CGeometry *geometry, CConfig *config, bool output);
5757

5858
/*!
59-
* \brief Add turbulence history fields (FVMComp, FVMInc, FVMNEMO).
60-
* \param[in] config - Definition of the particular problem.
59+
* \brief Add turbulence history fields for the linear solver (FVMComp, FVMInc, FVMNEMO).
6160
*/
62-
void AddHistoryOutputFields_Turb(const CConfig* config);
61+
void AddHistoryOutputFields_TurbRMS_RES(const CConfig* config);
6362

6463
/*!
65-
* \brief Set turbulence history field values.
66-
* \param[in] solver - The container holding all solution data.
67-
* \param[in] config - Definition of the particular problem.
64+
* \brief Set turbulence history field values for the linear solver.
65+
*/
66+
void LoadHistoryData_TurbRMS_RES(const CConfig* config, const CSolver* const* solver);
67+
68+
/*!
69+
* \brief Add turbulence history fields for the linear solver (FVMComp, FVMInc, FVMNEMO).
70+
*/
71+
void AddHistoryOutputFields_TurbMAX_RES(const CConfig* config);
72+
73+
/*!
74+
* \brief Set turbulence history field values for the linear solver.
75+
*/
76+
void LoadHistoryData_TurbMAX_RES(const CConfig* config, const CSolver* const* solver);
77+
78+
/*!
79+
* \brief Add turbulence history fields for the linear solver (FVMComp, FVMInc, FVMNEMO).
80+
*/
81+
void AddHistoryOutputFields_TurbBGS_RES(const CConfig* config);
82+
83+
/*!
84+
* \brief Set turbulence history field values for the linear solver.
85+
*/
86+
void LoadHistoryData_TurbBGS_RES(const CConfig* config, const CSolver* const* solver);
87+
88+
/*!
89+
* \brief Add turbulence history fields for the linear solver (FVMComp, FVMInc, FVMNEMO).
90+
*/
91+
void AddHistoryOutputFields_TurbLinsol(const CConfig* config);
92+
93+
/*!
94+
* \brief Set turbulence history field values for the linear solver.
6895
*/
69-
void LoadHistoryData_Turb(const CConfig* config, const CSolver* const* solver);
96+
void LoadHistoryData_TurbLinsol(const CConfig* config, const CSolver* const* solver);
7097

7198
/*!
7299
* \brief Add turbulence volume solution fields for a point (FVMComp, FVMInc, FVMNEMO).

SU2_CFD/src/output/CFlowCompOutput.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){
116116
if (nDim == 3) AddHistoryOutput("RMS_MOMENTUM-Z", "rms[RhoW]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the momentum z-component.", HistoryFieldType::RESIDUAL);
117117
/// DESCRIPTION: Root-mean square residual of the energy.
118118
AddHistoryOutput("RMS_ENERGY", "rms[RhoE]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the energy.", HistoryFieldType::RESIDUAL);
119+
AddHistoryOutputFields_TurbRMS_RES(config);
119120
/// END_GROUP
120121

121122
/// BEGIN_GROUP: MAX_RES, DESCRIPTION: The maximum residuals of the SOLUTION variables.
@@ -129,6 +130,7 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){
129130
if (nDim == 3) AddHistoryOutput("MAX_MOMENTUM-Z", "max[RhoW]", ScreenOutputFormat::FIXED,"MAX_RES", "Maximum residual of the z-component.", HistoryFieldType::RESIDUAL);
130131
/// DESCRIPTION: Maximum residual of the energy.
131132
AddHistoryOutput("MAX_ENERGY", "max[RhoE]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the energy.", HistoryFieldType::RESIDUAL);
133+
AddHistoryOutputFields_TurbMAX_RES(config);
132134
/// END_GROUP
133135

134136
/// BEGIN_GROUP: BGS_RES, DESCRIPTION: The block Gauss Seidel residuals of the SOLUTION variables.
@@ -142,6 +144,7 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){
142144
if (nDim == 3) AddHistoryOutput("BGS_MOMENTUM-Z", "bgs[RhoW]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the z-component.", HistoryFieldType::RESIDUAL);
143145
/// DESCRIPTION: Maximum residual of the energy.
144146
AddHistoryOutput("BGS_ENERGY", "bgs[RhoE]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the energy.", HistoryFieldType::RESIDUAL);
147+
AddHistoryOutputFields_TurbBGS_RES(config);
145148
/// END_GROUP
146149

147150
vector<string> Marker_Monitoring;
@@ -159,6 +162,7 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){
159162
/// DESCRIPTION: Linear solver iterations
160163
AddHistoryOutput("LINSOL_ITER", "Linear_Solver_Iterations", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver.");
161164
AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver.");
165+
AddHistoryOutputFields_TurbLinsol(config);
162166

163167
/// BEGIN_GROUP: ENGINE_OUTPUT, DESCRIPTION: Engine output
164168
/// DESCRIPTION: Aero CD drag
@@ -219,8 +223,6 @@ void CFlowCompOutput::SetHistoryOutputFields(CConfig *config){
219223
AddHistoryOutput("DEFORM_RESIDUAL", "DeformRes", ScreenOutputFormat::FIXED, "DEFORM", "Residual of the linear solver for the mesh deformation");
220224
}
221225

222-
AddHistoryOutputFields_Turb(config);
223-
224226
/*--- Add analyze surface history fields --- */
225227

226228
AddAnalyzeSurfaceOutput(config);
@@ -447,6 +449,7 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol
447449
SetHistoryOutputValue("RMS_MOMENTUM-Z", log10(flow_solver->GetRes_RMS(3)));
448450
SetHistoryOutputValue("RMS_ENERGY", log10(flow_solver->GetRes_RMS(4)));
449451
}
452+
LoadHistoryData_TurbRMS_RES(config, solver);
450453

451454
SetHistoryOutputValue("MAX_DENSITY", log10(flow_solver->GetRes_Max(0)));
452455
SetHistoryOutputValue("MAX_MOMENTUM-X", log10(flow_solver->GetRes_Max(1)));
@@ -457,6 +460,7 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol
457460
SetHistoryOutputValue("MAX_MOMENTUM-Z", log10(flow_solver->GetRes_Max(3)));
458461
SetHistoryOutputValue("MAX_ENERGY", log10(flow_solver->GetRes_Max(4)));
459462
}
463+
LoadHistoryData_TurbMAX_RES(config, solver);
460464

461465
if (multiZone){
462466
SetHistoryOutputValue("BGS_DENSITY", log10(flow_solver->GetRes_BGS(0)));
@@ -468,6 +472,7 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol
468472
SetHistoryOutputValue("BGS_MOMENTUM-Z", log10(flow_solver->GetRes_BGS(3)));
469473
SetHistoryOutputValue("BGS_ENERGY", log10(flow_solver->GetRes_BGS(4)));
470474
}
475+
LoadHistoryData_TurbBGS_RES(config, solver);
471476
}
472477

473478
SetHistoryOutputValue("TOTAL_HEATFLUX", flow_solver->GetTotal_HeatFlux());
@@ -482,6 +487,7 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol
482487

483488
SetHistoryOutputValue("LINSOL_ITER", flow_solver->GetIterLinSolver());
484489
SetHistoryOutputValue("LINSOL_RESIDUAL", log10(flow_solver->GetResLinSolver()));
490+
LoadHistoryData_TurbLinsol(config, solver);
485491

486492
if (config->GetDeform_Mesh()){
487493
SetHistoryOutputValue("DEFORM_MIN_VOLUME", mesh_solver->GetMinimum_Volume());
@@ -498,8 +504,6 @@ void CFlowCompOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSol
498504

499505
}
500506

501-
LoadHistoryData_Turb(config, solver);
502-
503507
/*--- Set the analyse surface history values --- */
504508

505509
SetAnalyzeSurface(flow_solver, geometry, config, false);

SU2_CFD/src/output/CFlowIncOutput.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,12 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){
112112
if (nDim == 3) AddHistoryOutput("RMS_VELOCITY-Z", "rms[W]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the velocity z-component.", HistoryFieldType::RESIDUAL);
113113
/// DESCRIPTION: Maximum residual of the temperature.
114114
if (heat || weakly_coupled_heat) AddHistoryOutput("RMS_TEMPERATURE", "rms[T]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the temperature.", HistoryFieldType::RESIDUAL);
115+
AddHistoryOutputFields_TurbRMS_RES(config);
115116
/// DESCRIPTION: Root-mean square residual of the radiative energy (P1 model).
116117
if (config->AddRadiation()) AddHistoryOutput("RMS_RAD_ENERGY", "rms[E_Rad]", ScreenOutputFormat::FIXED, "RMS_RES", "Root-mean square residual of the radiative energy.", HistoryFieldType::RESIDUAL);
117118
/// END_GROUP
118119

120+
119121
/// BEGIN_GROUP: MAX_RES, DESCRIPTION: The maximum residuals of the SOLUTION variables.
120122
/// DESCRIPTION: Maximum residual of the pressure.
121123
AddHistoryOutput("MAX_PRESSURE", "max[P]", ScreenOutputFormat::FIXED, "MAX_RES", "Maximum residual of the pressure.", HistoryFieldType::RESIDUAL);
@@ -129,6 +131,7 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){
129131
/// DESCRIPTION: Maximum residual of the temperature.
130132
if (heat || weakly_coupled_heat)
131133
AddHistoryOutput("MAX_TEMPERATURE", "max[T]", ScreenOutputFormat::FIXED, "MAX_RES", "Root-mean square residual of the temperature.", HistoryFieldType::RESIDUAL);
134+
AddHistoryOutputFields_TurbMAX_RES(config);
132135
/// END_GROUP
133136

134137
/// BEGIN_GROUP: BGS_RES, DESCRIPTION: The block-gauss seidel residuals of the SOLUTION variables.
@@ -144,6 +147,7 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){
144147
/// DESCRIPTION: Maximum residual of the temperature.
145148
if (heat || weakly_coupled_heat)
146149
AddHistoryOutput("BGS_TEMPERATURE", "bgs[T]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the temperature.", HistoryFieldType::RESIDUAL);
150+
AddHistoryOutputFields_TurbBGS_RES(config);
147151
/// DESCRIPTION: Multizone residual of the radiative energy (P1 model).
148152
if (config->AddRadiation()) AddHistoryOutput("BGS_RAD_ENERGY", "bgs[E_Rad]", ScreenOutputFormat::FIXED, "BGS_RES", "BGS residual of the radiative energy.", HistoryFieldType::RESIDUAL);
149153
/// END_GROUP
@@ -172,6 +176,7 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){
172176
/// DESCRIPTION: Linear solver iterations
173177
AddHistoryOutput("LINSOL_ITER", "LinSolIter", ScreenOutputFormat::INTEGER, "LINSOL", "Number of iterations of the linear solver.");
174178
AddHistoryOutput("LINSOL_RESIDUAL", "LinSolRes", ScreenOutputFormat::FIXED, "LINSOL", "Residual of the linear solver.");
179+
AddHistoryOutputFields_TurbLinsol(config);
175180

176181
AddHistoryOutput("MIN_DELTA_TIME", "Min DT", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current minimum local time step");
177182
AddHistoryOutput("MAX_DELTA_TIME", "Max DT", ScreenOutputFormat::SCIENTIFIC, "CFL_NUMBER", "Current maximum local time step");
@@ -193,8 +198,6 @@ void CFlowIncOutput::SetHistoryOutputFields(CConfig *config){
193198
AddHistoryOutput("STREAMWISE_HEAT", "SWHeat", ScreenOutputFormat::FIXED, "STREAMWISE_PERIODIC", "Integrated heat for streamwise periodic flow");
194199
}
195200

196-
AddHistoryOutputFields_Turb(config);
197-
198201
/*--- Add analyze surface history fields --- */
199202

200203
AddAnalyzeSurfaceOutput(config);
@@ -216,7 +219,7 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv
216219
SetHistoryOutputValue("RMS_VELOCITY-X", log10(flow_solver->GetRes_RMS(1)));
217220
SetHistoryOutputValue("RMS_VELOCITY-Y", log10(flow_solver->GetRes_RMS(2)));
218221
if (nDim == 3) SetHistoryOutputValue("RMS_VELOCITY-Z", log10(flow_solver->GetRes_RMS(3)));
219-
222+
LoadHistoryData_TurbRMS_RES(config, solver);
220223
if (config->AddRadiation())
221224
SetHistoryOutputValue("RMS_RAD_ENERGY", log10(rad_solver->GetRes_RMS(0)));
222225

@@ -225,13 +228,14 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv
225228
SetHistoryOutputValue("MAX_VELOCITY-X", log10(flow_solver->GetRes_Max(1)));
226229
SetHistoryOutputValue("MAX_VELOCITY-Y", log10(flow_solver->GetRes_Max(2)));
227230
if (nDim == 3) SetHistoryOutputValue("RMS_VELOCITY-Z", log10(flow_solver->GetRes_Max(3)));
231+
LoadHistoryData_TurbMAX_RES(config, solver);
228232

229233
if (multiZone){
230234
SetHistoryOutputValue("BGS_PRESSURE", log10(flow_solver->GetRes_BGS(0)));
231235
SetHistoryOutputValue("BGS_VELOCITY-X", log10(flow_solver->GetRes_BGS(1)));
232236
SetHistoryOutputValue("BGS_VELOCITY-Y", log10(flow_solver->GetRes_BGS(2)));
233237
if (nDim == 3) SetHistoryOutputValue("BGS_VELOCITY-Z", log10(flow_solver->GetRes_BGS(3)));
234-
238+
LoadHistoryData_TurbBGS_RES(config, solver);
235239
if (config->AddRadiation())
236240
SetHistoryOutputValue("BGS_RAD_ENERGY", log10(rad_solver->GetRes_BGS(0)));
237241
}
@@ -257,11 +261,12 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv
257261
if (nDim == 3) SetHistoryOutputValue("BGS_TEMPERATURE", log10(flow_solver->GetRes_BGS(4)));
258262
else SetHistoryOutputValue("BGS_TEMPERATURE", log10(flow_solver->GetRes_BGS(3)));
259263
}
260-
261264
}
262265

263266
SetHistoryOutputValue("LINSOL_ITER", flow_solver->GetIterLinSolver());
264267
SetHistoryOutputValue("LINSOL_RESIDUAL", log10(flow_solver->GetResLinSolver()));
268+
LoadHistoryData_TurbLinsol(config, solver);
269+
265270

266271
if (config->GetDeform_Mesh()){
267272
SetHistoryOutputValue("DEFORM_MIN_VOLUME", mesh_solver->GetMinimum_Volume());
@@ -283,8 +288,6 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv
283288
SetHistoryOutputValue("STREAMWISE_HEAT", flow_solver->GetStreamwisePeriodicValues().Streamwise_Periodic_IntegratedHeatFlow);
284289
}
285290

286-
LoadHistoryData_Turb(config, solver);
287-
288291
/*--- Set the analyse surface history values --- */
289292

290293
SetAnalyzeSurface(flow_solver, geometry, config, false);
@@ -299,7 +302,6 @@ void CFlowIncOutput::LoadHistoryData(CConfig *config, CGeometry *geometry, CSolv
299302

300303
}
301304

302-
303305
void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){
304306

305307
// Grid coordinates

0 commit comments

Comments
 (0)