-
Notifications
You must be signed in to change notification settings - Fork 156
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
Enabling vectorized time series calculation of wind conditions #400
Conversation
@@ -34,7 +34,8 @@ class FlowField(FromDictMixin): | |||
wind_shear: float = field(converter=float) | |||
air_density: float = field(converter=float) | |||
turbulence_intensity: float = field(converter=float) | |||
reference_wind_height: float = field(converter=float) | |||
reference_wind_height: int = field(converter=int) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm guessing this is by mistake. I think we want to keep reference_wind_height
a float
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes good catch @Bartdoekemeijer
Hi @bayc . This looks great! I also compared the default gridded calculation method vs. when I calculate the grid of wind directions/speeds myself and then simulate it using the timeseries method. I find very similar performance and identical solutions between the two!
I find
And here's with a 50-turbine farm and a single wind speed in the grid, where
I actually prefer the timeseries method over the current gridded method in terms of functionality. I'd love to be able to add an array of turbulence intensities, but maybe also arrays of the wind shear and wind veer. The entire gridded calculation method is completely replaceable with:
Other advantages are that users can easily leave out conditions they are not interested in (more freedom over wind directions/speeds evaluated), easier parallelization, reduced complexity because we can eliminate one dimension of the arrays. @bayc , do you think there is room for improvement in terms of computation time with |
@Bartdoekemeijer Thanks for trying this out! It is an interesting idea to move to this form of input, and something we have been discussing around collapsing the matrix dimensions. @rafmudaf and @paulf81 , what thoughts do you all have? |
I was looking for this kind of functionality to compute time series and am glad to see it has already been developed. I just want to add that I agree with @Bartdoekemeijer that the functionality to have turbulence intensity as vector (with an individual value for each time stamp) in addition to wind speed and direction would be very useful. |
Feature or improvement description
This PR enables the vectorized calculation of time series data. Instead of having the wind direction and wind speed input arrays expanded on one another, the arrays are assumed to be equal length where each index is a wind condition to be evaluated.
Related issue, if one exists
Closes #299
Impacted areas of the software
Parts of the simulation code and aflag to pass to
floris_interface
.Additional supporting information
This is a first implementation. I am unsure if this should be enable this way, or if a separate time series solver should be created. Because only the modification of the initial matrix sizes is needed, I went with this implementation first. Could use this underlying code with a separate
floris_interface
wrapper function dedicated to time series calls, hopefully moving thetime_series
flag from reinitialize, but still would need to be established before the grids are setup..Test results, if applicable
The below code results in: