-
Notifications
You must be signed in to change notification settings - Fork 157
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
Save WindData onto FlorisModel and simplify post-run()
calls
#849
Conversation
@rafmudaf , before you review fully, are you on board with the main idea of this PR? Also, @ejsimley , see the |
Thanks @misi9170. I think this is a good way to simplify getting farm power, expected power, AEP and saving/accessing the wind rose information in the floris model. |
hi @misi9170 , one thought is you might discard the changes to the examples because they will only make the eventual merge to refactor_examples harder, if you leave the core changes in place I can update all the relavent examples in refactor_examples |
That's true... but the checks will fail and the examples on the v4 branch won't run in the meantime. Is that a problem? |
Maybe just delete those examples then? I think the merge will be easier, I have everything I need in the refactor branch,
Paul
From: misi9170 ***@***.***>
Reply-To: NREL/floris ***@***.***>
Date: Wednesday, March 20, 2024 at 1:00 PM
To: NREL/floris ***@***.***>
Cc: Paul Fleming ***@***.***>, Mention ***@***.***>
Subject: Re: [NREL/floris] Save WindData onto FlorisModel and simplify post-`run()` calls (PR #849)
CAUTION: This email originated from outside of NREL. Do not click links or open attachments unless you recognize the sender and know the content is safe.
hi @misi9170<https://github.com/misi9170> , one thought is you might discard the changes to the examples because they will only make the eventual merge to refactor_examples harder, if you leave the core changes in place I can update all the relavent examples in refactor_examples
That's true... but the checks will fail and the examples on the v4 branch won't run in the meantime. Is that a problem?
—
Reply to this email directly, view it on GitHub<#849 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABOVSRX6MWJF4YA5QY5OIUDYZHMD7AVCNFSM6AAAAABE6ZRCMOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMJQGM3TQMZZGQ>.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Hi @paulf81, to be honest, I'd rather keep them in to keep a record of the changes necessary for the examples to run that will be tied to this PR's merge commit. Assuming this PR gets merged, when you go to merge v4 back into the refactor_examples branch at some point, you could just keep all "current" changes (i.e. the versions on the refactor_example branch) to the example files (and then make updates to the examples as necessary). I don't think that should be too much of a headache, but I'm certainly happy to help deal with the merge conflict if it's messier than I'm imagining! |
Ok, yeah, I get that. Let's do it that way then, thanks! |
For future reference, note a small new capability that tests if a warning is logged (e.g on this file) |
@aclerc, just wanted to tag you here so that you see this, since this change is partly in response to your feedback :) |
This pull request simplifies calls to methods that extract the power after a
FlorisModel
has beenrun()
. To do so, anyWindData
object that is passed in toFlorisModel.set()
is saved onto theFlorisModel
. Setting of theFlorisModel._wind_data
attribute can only be achieved usingset()
, and a getter method is added to expose the hiddenFlorisModel._wind_data
.These changes enable the following calls to be simplified considerably, and allow the output to match the "shape" of the
WindData
object, if one was used:get_turbine_powers()
get_farm_power()
get_farm_AEP()
A few important changes are also implemented:
get_farm_AEP()
is now simply a wrapper around a new method,get_expected_farm_power()
. Theget_expected_farm_power()
is then clearer. We have also discussed raising an error ifget_farm_AEP()
is called without aWindRose
data type onFlorisModel._wind_data
---@paulf81, what do you think, shouldget_farm_AEP()
raise an error if called without aWindRose
?get_...power
methods callrun()
. To use these methods, the user must callrun()
first. This clarifies the paradigm, which used to differ between different methods (get_farm_AEP()
would callrun()
, whereasget_turbine_powers()
andget_farm_power()
would not).no_wake
flag can be removed form the theget_farm_AEP()
method---if the user would like a version without wakes, they will now executerun_no_wake()
instead ofrun()
prior to calling theget_...power
methods.Other notes
WindData
object onto theFlorisModel
essentially supersedes Drive layout optimizations using WindData objects #822cut_in_wind_speed
andcut_out_wind_speed
arguments toget_farm_AEP()
have been removed. These were inconsistent with the paradigm that all findices on theFlorisModel
will be run. This also mirrors the removal of these terms on theParallelComputingInterface
(Rename floris.simulation, floris.tools to floris.core, floris #830, although that removal is not complete). If users would like to remove certain wind conditions from AEP calculations, they will need toset()
the conditions they intend to include.get_farm_AEP()
now allows users to specify how many hours there are in a year (defaults to 365 * 24=8760, but some users may like to use 8766 to account for leap years)To do
UncertainFlorisModel
to track these changes.WindData
object availableget_farm_AEP()
is called without aWindData
object available