-
Notifications
You must be signed in to change notification settings - Fork 170
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
Update uncertainty interface to 4d, new API #821
Conversation
… FlorisInterface.
often does not perfectly know the true wind direction, and that a | ||
turbine often does not perfectly achieve its desired yaw angle offset. | ||
Defaults to fix_yaw_in_relative_frame=False. | ||
wd_resolution (float, optional): The resolution of wind direction, in degrees. |
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.
Maybe not here, but in general we should pick either "wind_direction" or "wd" for wind direction named arguments.
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.
And same for the other related input arguments
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.
Yeah, I would be happy either way, with maybe a slight preference toward wd_ for succinctness in this case
Thanks for addressing my comments @paulf81. Overall, this is looking pretty good to me. |
…assed (currently failing)
@rafmudaf and @misi9170 , just to close a loop here, @misi9170 added some tests of applying yaw angles to the uncertainty interface that threw some unexpected errors. I tracked down two seperate issues:
|
Hi @rafmudaf and @misi9170 , we talked today about possibly removing the un-expanded FLORIS interface, I started making the changes tonight (storing the dict instead) but there did seem to be some trade-offs, mainly I think in the set function the operation would be to declare a new FLORIS object, and again only store the dict. I think it clearly could be done, but if you wouldn't mind having a quick look and concurring it should be done (versus the current version's memory usage but clearer syntax), let me know what you think and I'll make the change |
I guess an option would be to create a dict direction rather than instantiating a new FLORIS object and then exporting it to a dict. The code for that (building a |
Ok @misi9170 , I made the change, now the unexpanded FI is only created as needed and only the dictionary version is saved. One place we might just want to double check ourselves, does the dictionary save the values of yaw_angles/power_setpoints? If not repeated calls to uncertainity_interface.set() might work a little differently in this version than the previous where we hold the entire fi in some cases, but I'm not sure, |
@paulf81 no, the dictionary doesn't hold the |
8ff10ca
to
5269bc6
Compare
ok @rafmudaf and @misi9170 , tonight it:
Think it's now ready, |
@rafmudaf good to merge this one? |
Update uncertainty interface to 4d, new API
This pull request updates UncertaintyInterface to the v4 4d structure and the new set/run api currently in the fi_api branch. In doing so it resolves Issue #516 since uncertainty will now work equivalently to time series or wrapped wind rose.
The UncertaintyInterface, unlike previous implementatons, inherits the FlorisInterface and overloads certain functions to implement wind direction uncertainty (in practice this was the only type used). As before it uses gaussian averages of perturbations, but makes greater use of rounding and numpy reshaping and summing methods to achieve this result. It reimplements set (leaving run as is), as well as get_turbine_powers, get_farm_power, get_farm_aep to return this uncertain result. Parameters of uncertainty are passed in at initialization.
Pull request includes unit tests of some of the underlying functions, and an update of example 20_ to show the new usage.
Related issue
#516
Impacted areas of the software
uncertainty_interface.py