Skip to content

Commit c6083c7

Browse files
authored
Merge branch 'develop' into nan_checks_better_defaults
2 parents 4783e40 + 3da85dd commit c6083c7

5 files changed

Lines changed: 61 additions & 3 deletions

File tree

Common/src/CConfig.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2043,8 +2043,6 @@ void CConfig::SetConfig_Options() {
20432043
addBoolOption("WRT_PERFORMANCE", Wrt_Performance, false);
20442044
/* DESCRIPTION: Output the tape statistics (discrete adjoint) \ingroup Config*/
20452045
addBoolOption("WRT_AD_STATISTICS", Wrt_AD_Statistics, false);
2046-
/* DESCRIPTION: Write the mesh quality metrics to the visualization files. \ingroup Config*/
2047-
addBoolOption("WRT_MESH_QUALITY", Wrt_MeshQuality, false);
20482046
/* DESCRIPTION: Output a 1D slice of a 2D cartesian solution \ingroup Config*/
20492047
addBoolOption("WRT_SLICE", Wrt_Slice, false);
20502048
/*!\brief MARKER_ANALYZE_AVERAGE
@@ -2900,9 +2898,12 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){
29002898
newString.append("\n");
29012899
if (!option_name.compare("RELAXATION_FACTOR_ADJFLOW"))
29022900
newString.append("Option RELAXATION_FACTOR_ADJFLOW is now RELAXATION_FACTOR_ADJOINT, "
2903-
"and it also applies to discrete adjoint problems\n.");
2901+
"and it also applies to discrete adjoint problems.\n\n");
2902+
if (!option_name.compare("WRT_MESH_QUALITY"))
2903+
newString.append("WRT_MESH_QUALITY is deprecated. Use VOLUME_OUTPUT= (MESH_QUALITY, ...) instead.\n\n");
29042904
errorString.append(newString);
29052905
err_count++;
2906+
line_count++;
29062907
continue;
29072908
}
29082909

@@ -2915,6 +2916,7 @@ void CConfig::SetConfig_Parsing(istream& config_buffer){
29152916
newString.append("\n");
29162917
errorString.append(newString);
29172918
err_count++;
2919+
line_count++;
29182920
continue;
29192921
}
29202922

@@ -3220,6 +3222,13 @@ void CConfig::SetPostprocessing(unsigned short val_software, unsigned short val_
32203222
}
32213223
}
32223224

3225+
/*--- Check if MESH_QUALITY is requested in VOLUME_OUTPUT and set the config boolean accordingly. ---*/
3226+
Wrt_MeshQuality = false;
3227+
for (unsigned short iField = 0; iField < nVolumeOutput; iField++) {
3228+
if(VolumeOutput[iField].find("MESH_QUALITY") != string::npos) {
3229+
Wrt_MeshQuality = true;
3230+
}
3231+
}
32233232

32243233
if (Kind_Solver == NAVIER_STOKES && Kind_Turb_Model != NONE){
32253234
SU2_MPI::Error("KIND_TURB_MODEL must be NONE if SOLVER= NAVIER_STOKES", CURRENT_FUNCTION);

SU2_CFD/src/output/CFlowCompOutput.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,11 @@ void CFlowCompOutput::SetVolumeOutputFields(CConfig *config){
414414
AddVolumeOutput("Q_CRITERION", "Q_Criterion", "VORTEX_IDENTIFICATION", "Value of the Q-Criterion");
415415
}
416416

417+
// Mesh quality metrics, computed in CPhysicalGeometry::ComputeMeshQualityStatistics.
418+
AddVolumeOutput("ORTHOGONALITY", "Orthogonality", "MESH_QUALITY", "Orthogonality Angle (deg.)");
419+
AddVolumeOutput("ASPECT_RATIO", "Aspect_Ratio", "MESH_QUALITY", "CV Face Area Aspect Ratio");
420+
AddVolumeOutput("VOLUME_RATIO", "Volume_Ratio", "MESH_QUALITY", "CV Sub-Volume Ratio");
421+
417422
if (config->GetTime_Domain()){
418423
SetTimeAveragedFields();
419424
}
@@ -554,6 +559,13 @@ void CFlowCompOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolv
554559
SetVolumeOutputValue("Q_CRITERION", iPoint, GetQ_Criterion(&(Node_Flow->GetGradient_Primitive(iPoint)[1])));
555560
}
556561

562+
// Mesh quality metrics
563+
if (config->GetWrt_MeshQuality()) {
564+
SetVolumeOutputValue("ORTHOGONALITY", iPoint, geometry->Orthogonality[iPoint]);
565+
SetVolumeOutputValue("ASPECT_RATIO", iPoint, geometry->Aspect_Ratio[iPoint]);
566+
SetVolumeOutputValue("VOLUME_RATIO", iPoint, geometry->Volume_Ratio[iPoint]);
567+
}
568+
557569
if (config->GetTime_Domain()){
558570
LoadTimeAveragedData(iPoint, Node_Flow);
559571
}

SU2_CFD/src/output/CFlowIncOutput.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,12 @@ void CFlowIncOutput::SetVolumeOutputFields(CConfig *config){
478478
}
479479
AddVolumeOutput("Q_CRITERION", "Q_Criterion", "VORTEX_IDENTIFICATION", "Value of the Q-Criterion");
480480
}
481+
482+
// Mesh quality metrics, computed in CPhysicalGeometry::ComputeMeshQualityStatistics.
483+
AddVolumeOutput("ORTHOGONALITY", "Orthogonality", "MESH_QUALITY", "Orthogonality Angle (deg.)");
484+
AddVolumeOutput("ASPECT_RATIO", "Aspect_Ratio", "MESH_QUALITY", "CV Face Area Aspect Ratio");
485+
AddVolumeOutput("VOLUME_RATIO", "Volume_Ratio", "MESH_QUALITY", "CV Sub-Volume Ratio");
486+
481487
}
482488

483489
void CFlowIncOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint){
@@ -641,6 +647,14 @@ void CFlowIncOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolv
641647
}
642648
SetVolumeOutputValue("Y_PLUS", iPoint, solver[FLOW_SOL]->GetYPlus(iMarker, iVertex));
643649
}
650+
651+
// Mesh quality metrics
652+
if (config->GetWrt_MeshQuality()) {
653+
SetVolumeOutputValue("ORTHOGONALITY", iPoint, geometry->Orthogonality[iPoint]);
654+
SetVolumeOutputValue("ASPECT_RATIO", iPoint, geometry->Aspect_Ratio[iPoint]);
655+
SetVolumeOutputValue("VOLUME_RATIO", iPoint, geometry->Volume_Ratio[iPoint]);
656+
}
657+
644658
}
645659

646660
bool CFlowIncOutput::SetInit_Residuals(CConfig *config){

SU2_CFD/src/output/CHeatOutput.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ void CHeatOutput::SetVolumeOutputFields(CConfig *config){
131131
// Residuals
132132
AddVolumeOutput("RES_TEMPERATURE", "Residual_Temperature", "RESIDUAL", "Residual of the temperature");
133133

134+
// Mesh quality metrics, computed in CPhysicalGeometry::ComputeMeshQualityStatistics.
135+
AddVolumeOutput("ORTHOGONALITY", "Orthogonality", "MESH_QUALITY", "Orthogonality Angle (deg.)");
136+
AddVolumeOutput("ASPECT_RATIO", "Aspect_Ratio", "MESH_QUALITY", "CV Face Area Aspect Ratio");
137+
AddVolumeOutput("VOLUME_RATIO", "Volume_Ratio", "MESH_QUALITY", "CV Sub-Volume Ratio");
138+
134139
}
135140

136141

@@ -151,6 +156,13 @@ void CHeatOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver *
151156
// Residuals
152157
SetVolumeOutputValue("RES_TEMPERATURE", iPoint, solver[HEAT_SOL]->LinSysRes(iPoint, 0));
153158

159+
// Mesh quality metrics
160+
if (config->GetWrt_MeshQuality()) {
161+
SetVolumeOutputValue("ORTHOGONALITY", iPoint, geometry->Orthogonality[iPoint]);
162+
SetVolumeOutputValue("ASPECT_RATIO", iPoint, geometry->Aspect_Ratio[iPoint]);
163+
SetVolumeOutputValue("VOLUME_RATIO", iPoint, geometry->Volume_Ratio[iPoint]);
164+
}
165+
154166
}
155167

156168
void CHeatOutput::LoadSurfaceData(CConfig *config, CGeometry *geometry, CSolver **solver, unsigned long iPoint, unsigned short iMarker, unsigned long iVertex){

SU2_CFD/src/output/CMeshOutput.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ void CMeshOutput::SetVolumeOutputFields(CConfig *config){
5656
if (nDim == 3)
5757
AddVolumeOutput("COORD-Z", "z", "COORDINATES", "z-component of the coordinate vector");
5858

59+
// Mesh quality metrics, computed in CPhysicalGeometry::ComputeMeshQualityStatistics.
60+
AddVolumeOutput("ORTHOGONALITY", "Orthogonality", "MESH_QUALITY", "Orthogonality Angle (deg.)");
61+
AddVolumeOutput("ASPECT_RATIO", "Aspect_Ratio", "MESH_QUALITY", "CV Face Area Aspect Ratio");
62+
AddVolumeOutput("VOLUME_RATIO", "Volume_Ratio", "MESH_QUALITY", "CV Sub-Volume Ratio");
5963

6064
}
6165

@@ -68,4 +72,11 @@ void CMeshOutput::LoadVolumeData(CConfig *config, CGeometry *geometry, CSolver *
6872
if (nDim == 3)
6973
SetVolumeOutputValue("COORD-Z", iPoint, Node_Geo->GetCoord(iPoint, 2));
7074

75+
// Mesh quality metrics
76+
if (config->GetWrt_MeshQuality()) {
77+
SetVolumeOutputValue("ORTHOGONALITY", iPoint, geometry->Orthogonality[iPoint]);
78+
SetVolumeOutputValue("ASPECT_RATIO", iPoint, geometry->Aspect_Ratio[iPoint]);
79+
SetVolumeOutputValue("VOLUME_RATIO", iPoint, geometry->Volume_Ratio[iPoint]);
80+
}
81+
7182
}

0 commit comments

Comments
 (0)