SU2 icon indicating copy to clipboard operation
SU2 copied to clipboard

Python adjoint scripts use wrong file suffixes for TOTAL_PRESSURE_LOSS and KINETIC_ENERGY_LOSS

Open ManasBagul23 opened this issue 2 months ago • 0 comments

Describe the bug

CConfig::GetObjFunc_Extension names the adjoint restart and solution files of TOTAL_PRESSURE_LOSS and KINETIC_ENERGY_LOSS with the suffixes _tot_press_loss and _kin_en_loss (added in #2446), but get_adjointSuffix in SU2_PY/SU2/io/tools.py returns pl and ke. The Python scripts therefore look for adjoint files that SU2 does not write when one of these objectives is used.

To Reproduce

import SU2
print(SU2.io.add_suffix("restart_adj.dat", SU2.io.get_adjointSuffix("TOTAL_PRESSURE_LOSS")))

prints restart_adj_pl.dat, while SU2_CFD writes restart_adj_tot_press_loss.dat.

Expected behavior

get_adjointSuffix returns the same suffix as CConfig.

A fix is proposed in #2907.

Bug report checklist

  • [x] Consulting the build instructions (https://su2code.github.io/docs_v7/Build-SU2-Linux-MacOS/).
  • [x] Looking for similar problems on GitHub or CFD-Online (https://www.cfd-online.com/Forums/su2/).
  • [x] Updating to the newest version of SU2 (either develop, master, or the pre-built executables https://su2code.github.io/download.html).

Desktop (please complete the following information):

  • OS: Windows 11
  • C++ compiler and version: MSVC 19.44 (Visual Studio 2022 Build Tools)
  • MPI implementation and version: Microsoft MPI 10.1
  • SU2 Version: develop

ManasBagul23 avatar Sep 17 '26 16:09 ManasBagul23