diff --git a/SU2_CFD/src/output/CFlowOutput.cpp b/SU2_CFD/src/output/CFlowOutput.cpp index 696a4c59547..03cf27e2476 100644 --- a/SU2_CFD/src/output/CFlowOutput.cpp +++ b/SU2_CFD/src/output/CFlowOutput.cpp @@ -1719,7 +1719,9 @@ void CFlowOutput::AddAerodynamicCoefficients(const CConfig* config) { /// DESCRIPTION: Angle of attack AddHistoryOutput("AOA", "AoA", ScreenOutputFormat::FIXED, "AOA", "Angle of attack"); - + + // CUSTOM_OBJFUNC is added here so historyMap.py knows how to get its value, the actual output is COMBO. + if (false) AddHistoryOutput("CUSTOM_OBJFUNC", "ComboObj", ScreenOutputFormat::SCIENTIFIC, "COMBO", "Custom obj. function value.", HistoryFieldType::COEFFICIENT); AddHistoryOutput("COMBO", "ComboObj", ScreenOutputFormat::SCIENTIFIC, "COMBO", "Combined obj. function value.", HistoryFieldType::COEFFICIENT); } diff --git a/SU2_PY/SU2/io/tools.py b/SU2_PY/SU2/io/tools.py index ba470ae36e8..3ac039c9409 100755 --- a/SU2_PY/SU2/io/tools.py +++ b/SU2_PY/SU2/io/tools.py @@ -395,6 +395,13 @@ def read_aerodynamics( ) Func_Values[key] = value[-1] + # If only COMBO is present in the history (which is the case when using + # CUSTOM_OBJFUNC as objective), expose it also under the logical + # name CUSTOM_OBJFUNC so that SU2.eval.functions(function_name="CUSTOM_OBJFUNC") + # can retrieve the value without needing a separate history column. + if "COMBO" in Func_Values and "CUSTOM_OBJFUNC" not in Func_Values: + Func_Values["CUSTOM_OBJFUNC"] = Func_Values["COMBO"] + return Func_Values