NREL / floris

A controls-oriented engineering wake model.
http://nrel.github.io/floris
BSD 3-Clause "New" or "Revised" License
217 stars 156 forks source link

Bug report: Cumulative Curl does not work with the turbine_cubature_grid solver #970

Open Bartdoekemeijer opened 3 months ago

Bartdoekemeijer commented 3 months ago

The CC model does not support turbine_cubature_grid solver

An error is raised when trying to run the cc model with the turbine_cubature_grid solver.

How to reproduce

Here's a minimal reproducible example:

from floris import FlorisModel

fmodel = FlorisModel("inputs/cc.yaml")
fmodel.set(solver_settings={"type": "turbine_cubature_grid", "turbine_grid_points": 3})
fmodel.run()
fmodel.get_turbine_powers()

Relevant output

This is the output of the example code, raising an error in turbine.py at line 301 (definition of thrust_coefficient):

Exception has occurred: ValueError
non-broadcastable output operand with shape (1,3) doesn't match the broadcast shape (1,1,9,3)
  File "/mnt/c/Users/Bart.Doekemeijer/OneDrive - Shell/Documents/python_scripts/floris_v4/floris/core/turbine/turbine.py", line 301, in thrust_coefficient
    thrust_coefficient += (
  File "/mnt/c/Users/Bart.Doekemeijer/OneDrive - Shell/Documents/python_scripts/floris_v4/floris/core/solver.py", line 511, in cc_solver
    turb_Cts = thrust_coefficient(
               ^^^^^^^^^^^^^^^^^^^
  File "/mnt/c/Users/Bart.Doekemeijer/OneDrive - Shell/Documents/python_scripts/floris_v4/floris/core/core.py", line 177, in steady_state_atmospheric_condition
    cc_solver(
  File "/mnt/c/Users/Bart.Doekemeijer/OneDrive - Shell/Documents/python_scripts/floris_v4/floris/floris_model.py", line 483, in run
    self.core.steady_state_atmospheric_condition()
  File "/mnt/c/Users/Bart.Doekemeijer/OneDrive - Shell/Documents/python_scripts/floris_v4/examples/test_cc_with_cubature_grid.py", line 5, in <module>
    fmodel.run()
ValueError: non-broadcastable output operand with shape (1,3) doesn't match the broadcast shape (1,1,9,3)

Floris version

FLORIS v4.1.1, on commit 044ab0ff31.

System Information