Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug report: cubature interpolation does not work with CC model #709

Open
Bartdoekemeijer opened this issue Sep 8, 2023 · 0 comments
Open
Assignees
Labels
bug Something isn't working floris.simulation
Milestone

Comments

@Bartdoekemeijer
Copy link
Collaborator

Bartdoekemeijer commented Sep 8, 2023

Cubature interpolation throws error for CC wake velocity deficit model

How to reproduce

Here is a minimal code that reproduces the error:

# Instantiate FLORIS using either the GCH or CC model
from floris.tools import FlorisInterface
fi = FlorisInterface("inputs/cc.yaml")

# Use turbine cubature grid for rotor interpolation
fi_dict = fi.floris.as_dict()
fi_dict["solver"] = {
    "type": "turbine_cubature_grid",
    "turbine_grid_points": 3
}
fi = FlorisInterface(fi_dict)

# Calculate wakes and retrieve turbine powers
fi.calculate_wake()
turbine_powers = fi.get_turbine_powers()
print(turbine_powers.flatten())

Relevant output

The example code above results in the following error first:

Exception has occurred: AttributeError
'TurbineCubatureGrid' object has no attribute 'x'
  File "/mnt/c/Users/Bart/python_scripts/floris/floris/simulation/grid.py", line 381, in set_grid
    self.x = np.take_along_axis(self.x_sorted, self.unsorted_indices, axis=2)

If we then remove those lines from the code (is that correct?), the example script runs fine when you replace cc.yaml with gch.yaml. With cc.yaml, we have a second error come up:

Exception has occurred: ValueError
non-broadcastable output operand with shape (1,1,1,1,1) doesn't match the broadcast shape (1,1,1,1,1,9,3)
  File "/mnt/c/Users/Bart/python_scripts/floris/floris/simulation/solver.py", line 564, in cc_solver
    effective_yaw_i += added_yaw
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^

What I also found is that the velocities variable being passed into the Ct(...) function in turbine.py seems to not be the right dimensions when using the CC model.

  • With CC, the shape of velocities is (1, 1, 3),
  • With GCH, the shape of velocities is (1, 1, 1, 9, 1).

Floris version

Using the current develop branch with latest commit 8ece0f.

System Information

  • OS: Ubuntu 22.04
  • Python version: Python 3.11
  • Library versions:
    • numpy==1.24.3
    • numexpr==2.8.4
    • scipy==1.10.1
@rafmudaf rafmudaf added bug Something isn't working floris.simulation labels Nov 8, 2023
@rafmudaf rafmudaf self-assigned this Nov 8, 2023
@rafmudaf rafmudaf added this to the v3.6 milestone Nov 8, 2023
@rafmudaf rafmudaf modified the milestones: v3.6, v4.1 Nov 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working floris.simulation
Projects
None yet
Development

No branches or pull requests

2 participants