Skip to content

Commit 321dac7

Browse files
committed
fix surface pressure drop
1 parent fa7f165 commit 321dac7

1 file changed

Lines changed: 10 additions & 13 deletions

File tree

SU2_CFD/src/output/CFlowOutput.cpp

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ void CFlowOutput::AddAnalyzeSurfaceOutput(const CConfig *config){
6464
/// DESCRIPTION: Average total pressure
6565
AddHistoryOutput("SURFACE_TOTAL_PRESSURE", "Avg_TotalPress", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total average total pressure on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT);
6666
/// DESCRIPTION: Pressure drop
67-
AddHistoryOutput("SURFACE_PRESSURE_DROP", "Pressure_Drop", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total pressure drop on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT);
67+
if (config->GetnMarker_Analyze() == 2) {
68+
AddHistoryOutput("SURFACE_PRESSURE_DROP", "Pressure_Drop", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF", "Total pressure drop on all markers set in MARKER_ANALYZE", HistoryFieldType::COEFFICIENT);
69+
} else if (rank == MASTER_NODE) {
70+
cout << "\nWARNING: SURFACE_PRESSURE_DROP can only be computed for 2 surfaces (outlet, inlet)\n" << endl;
71+
}
6872
/// END_GROUP
6973

7074

@@ -100,8 +104,6 @@ void CFlowOutput::AddAnalyzeSurfaceOutput(const CConfig *config){
100104
AddHistoryOutputPerSurface("SURFACE_TOTAL_TEMPERATURE","Avg_TotalTemp", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT);
101105
/// DESCRIPTION: Average total pressure
102106
AddHistoryOutputPerSurface("SURFACE_TOTAL_PRESSURE", "Avg_TotalPress", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT);
103-
/// DESCRIPTION: Pressure drop
104-
AddHistoryOutputPerSurface("SURFACE_PRESSURE_DROP", "Pressure_Drop", ScreenOutputFormat::SCIENTIFIC, "FLOW_COEFF_SURF", Marker_Analyze, HistoryFieldType::COEFFICIENT);
105107
/// END_GROUP
106108

107109
}
@@ -156,7 +158,6 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi
156158
su2double Tot_Surface_TotalPressure = 0.0;
157159
su2double Tot_Momentum_Distortion = 0.0;
158160
su2double Tot_SecondOverUniformity = 0.0;
159-
su2double Tot_Surface_PressureDrop = 0.0;
160161

161162
/*--- Compute the numerical fan face Mach number, and the total area of the inflow ---*/
162163

@@ -475,16 +476,13 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi
475476
which require the outlet to be listed first. This is a simple first version
476477
that could be generalized to a different orders/lists/etc. ---*/
477478

478-
for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) {
479-
su2double Pressure_Drop = 0.0;
480-
if (nMarker_Analyze == 2) {
481-
Pressure_Drop = (Surface_Pressure_Total[1]-Surface_Pressure_Total[0]) * config->GetPressure_Ref();
482-
config->SetSurface_PressureDrop(iMarker_Analyze, Pressure_Drop);
479+
if (nMarker_Analyze == 2) {
480+
su2double PressureDrop = (Surface_Pressure_Total[1] - Surface_Pressure_Total[0]) * config->GetPressure_Ref();
481+
for (iMarker_Analyze = 0; iMarker_Analyze < nMarker_Analyze; iMarker_Analyze++) {
482+
config->SetSurface_PressureDrop(iMarker_Analyze, PressureDrop);
483483
}
484-
SetHistoryOutputPerSurfaceValue("SURFACE_PRESSURE_DROP", Pressure_Drop, iMarker_Analyze);
485-
Tot_Surface_PressureDrop += Pressure_Drop;
484+
SetHistoryOutputValue("SURFACE_PRESSURE_DROP", PressureDrop);
486485
}
487-
488486
SetHistoryOutputValue("SURFACE_MASSFLOW", Tot_Surface_MassFlow);
489487
SetHistoryOutputValue("SURFACE_MACH", Tot_Surface_Mach);
490488
SetHistoryOutputValue("SURFACE_STATIC_TEMPERATURE", Tot_Surface_Temperature);
@@ -498,7 +496,6 @@ void CFlowOutput::SetAnalyzeSurface(CSolver *solver, CGeometry *geometry, CConfi
498496
SetHistoryOutputValue("SURFACE_SECOND_OVER_UNIFORM", Tot_SecondOverUniformity);
499497
SetHistoryOutputValue("SURFACE_TOTAL_TEMPERATURE", Tot_Surface_TotalTemperature);
500498
SetHistoryOutputValue("SURFACE_TOTAL_PRESSURE", Tot_Surface_TotalPressure);
501-
SetHistoryOutputValue("SURFACE_PRESSURE_DROP", Tot_Surface_PressureDrop);
502499

503500
if ((rank == MASTER_NODE) && !config->GetDiscrete_Adjoint() && output) {
504501

0 commit comments

Comments
 (0)