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.
As mentioned in #865, there are some cases where users may want to set only the control setpoints. Currently, the method for doing this,
FlorisModel._set_operation()
, is private. This PR makes that method public so that it may be used.We intend that only power users will use this functionality---most will simply use the
set
method to alter the control setpoints.In making this change I found that there was no check that the
yaw_angles
orpower_setpoints
second dimension matched the number of turbines, and in fact it was possible to set and runyaw_angles
with more than the number of turbines. This is now checked for.I spoke to @rafmudaf about a possible issue created by the following workflow:
This would be bad, because the
power
would have the wake caused bysome_yaw_angles
but the power behavior caused bysome_other_yaw_angles
.To make sure this does not happen, I have set the
core
'sstate
back toUNINITIALIZED
ifset_operation()
is called. This then throws aRuntimeError
ifget_turbine_powers()
is called before callingrun()
again. I test for this in the tests.