Allow users to pass in their own turbine operation models #1176
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
FLORIS v4 introduced the notion of turbine "operation models", which model how a turbine responds to different control setpoints and atmospheric conditions. See the documentation for details.
Until now, users specify which operation model they'd like to use by either setting the
operation_modelkey on the turbine input yaml, or passing one of the predefined strings (e.g."cosine-loss","simple-derating", etc) toFlorisModel.set_operation_model().This PR enables users to pass in a compatible operation model class of their own making. Currently included are the functional changes (which are minimal, and limited to turbine.py and floris_model.py), detailed documentation showing how this feature can be used, and tests. I also plan to make a small example showing how this can be done. Note also that the existing, prepackaged operation models can also be passed in this way, if desired.
Finally, this also adds tests to show that the operation model class passed can be a dynamic class (all prepackaged operation models are static classes at this time).
I am leaving this PR as a draft while we work with partners to ensure that everything works as expected.
As part of this PR, I'm also renaming
FlorisModel.get_turbine_ais()to the more explicitFlorisModel.get_turbine_axial_induction_factors(), which is more consistent with other methods used to extract quantities from FLORIS (e.g.FlorisModel.get_turbine_thrust_coeficients()). For backwards compatibility,FlorisModel.get_turbine_ais()will still work but will throw a deprecation warning.To do: