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

Standardize shapes of hub_heights, rotor_diameters, etc. on Farm object. #847

Open
misi9170 opened this issue Mar 18, 2024 · 1 comment
Open

Comments

@misi9170
Copy link
Collaborator

misi9170 commented Mar 18, 2024

And issue (#833) was raised which was caused by a change in the dimensions of Farm.hub_heights during the Farm.finalize() call. Essentially, some attributes which might be expected to have a single dimension of length n_turbines are "finalized" with dimensions (n_findex x n_turbines). The following code demonstrates this change:

import numpy as np
from floris import FlorisModel

fmodel = FlorisModel("inputs/gch.yaml")

# Before run(), hub_heights has the same dimensions as the layout
fmodel.set(layout_x=[0, 500.0], layout_y=[0.0, 0.0])
fmodel.set(wind_directions=np.array([270.0, 270.0, 270.0, 270.0]),
        wind_speeds=[8.0, 8.0, 10.0, 10.0],
        turbulence_intensities=np.array([0.06, 0.06, 0.06, 0.06]))
print("Prior to run():", fmodel.core.farm.hub_heights.shape)

# After run(), the dimensions of hub_heights have been expanded
fmodel.run()
print("After run():", fmodel.core.farm.hub_heights.shape)

Under the hood, FLORIS is using a _sorted version of hub_heights that does need to have shape (n_findex, n_turbines). However, as far as I can tell, there is no need for the "unsorted" hub_heights to also take that shape.

For simplicity, I suggest we keep any ("unsorted") attribute that is not obviously related to the number of conditions being evaluated to length n_turbines. This affects:

  • rotor_diameters
  • possibly turbine_type_map (as long as the _sorted version is used suitably).
  • any others?
@misi9170
Copy link
Collaborator Author

Note that the high-level bug in #833 has been addressed in #846 , but the underlying inconsistency on the dimensions of hub_height remains.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant