-
Notifications
You must be signed in to change notification settings - Fork 54
Bug-fix: WindPlant update for checking inputs #469
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
Conversation
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 think we need to have some discussions about what changes we are ok with happening without the user intentionally specifying that they should happen.
|
||
if self.config.adjust_air_density_for_elevation and self.site.elev is not None: | ||
air_dens_losses = calculate_air_density_losses(self.site.elev) | ||
self._system_model.Losses.assign({"turb_specific_loss":air_dens_losses}) | ||
|
||
if self.config.rotor_diameter is not None and self.config.turbine_rating_kw is not None: |
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 uncomfortable with having a power curve modification happening because I did set a rotor diameter and rating but not a turbine name. Is this necessary? I have spent many hours trying to track down hidden changes like this.
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.
if you update the rotor diameter without updating the power-curve, the only thing that changes is the layout. If you input a turbine rating and don't recalculate the power-curve, hopp just does scales the power-curve so the max value is equal to the turbine rating input.
I just updated this workflow and added a logger statement if this is used. I also added an input variable that can be used to specify whether or not to recalculate the turbine power-curve and it defaults to False (aka - don't recalculate it)
Bug-fix: WindPlant update for checking inputs
Added flexibility for user to model a wind turbine that isn't part of the turbine-models library with PySAM.
PR Checklist
RELEASE.md
has been updated to describe the changes made in this PRdocs/
files are up-to-date, or added when necessaryRelated issues
Impacted areas of the software
hopp/simulation/technologies/wind/wind_plant.py
:WindConfig
added inputsstore_floris_config_dict
: boolean input for whether to save floris_config dictionary if running FLORIS.override_wind_resource_height
: boolean input for whether to ignore a possible discrepancy between wind resource height and wind turbine hub-height. If set toTrue
, this means don't redownload wind resource data for the turbine hub-height if wind resource data is for a different height.recalculate_pysam_powercurve:
: boolean input for whether to recalculate the power-curve based on rotor diameter and rated power or not. When set toFalse
- just scales the power-curve so its maximum value is equal to the input turbine rating (this was the old workflow). When set toTrue
- recalculates the turbine power-curve using thecalculate_powercurve()
function from PySAM (see the documentation here). Only used ifmodel_name = 'pysam'
hopp/simulation/technologies/wind/wind_plant.py
:WindPlant
initalize_pysam_turbine_from_turbine_library()
: new function that initializes a wind turbine for PySAM from the turbine-models library, this functionality used to exist ininitialize_pysam_wind_turbine()
but was moved to make code easier to follow.initialize_pysam_wind_turbine()
: updated workflow if not using a turbine from the turbine models library and user-specified turbine specs like hub-height, rotor diameter and turbine-rating.hopp/simulation/technologies/wind/floris.py
initialize_from_floris
: updated to check for new inputconfig.override_wind_resource_height
before downloading wind resource data for the turbine hub-height if there's a discrepancy in wind resource height and wind turbine hub-height.hopp/tools/design/wind/turbine_library_interface_tools.py
check_hub_height()
: updated so thatwind_plant
input can be None so this function can be used outside ofWindPlant
.Additional supporting information
Test results, if applicable