SU2 icon indicating copy to clipboard operation
SU2 copied to clipboard

OptimalPropeller.py fails with NameError when the hub is smaller than the first radial station

Open ManasBagul23 opened this issue 2 months ago • 0 comments

Describe the bug

SU2_PY/OptimalPropeller.py stops with a NameError when the hub radius is smaller than the first radial station (R/stations), for example for a propeller without hub (r_hub = 0). i_hub is only assigned inside the loop over the stations when a station lies inside the hub.

To Reproduce

python SU2_PY/OptimalPropeller.py

with the inputs 50 stations, CT 0.1, R 1.0, r_hub 0.0, J 0.5, Vinf 10, no Prandtl correction:

    Ct_0 = sum(h * dCt_0[i_hub:])
NameError: name 'i_hub' is not defined. Did you mean: 'rhub'?

With r_hub 0.1 the script runs.

Expected behavior

The load distribution is computed from the first station when there is no station inside the hub.

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 18 '26 16:09 ManasBagul23