Skip to content

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

Merged
merged 5 commits into from
Apr 7, 2025

Conversation

elenya-grant
Copy link
Collaborator

@elenya-grant elenya-grant commented Apr 1, 2025

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 PR
  • Documentation
    • Docstrings are up-to-date
    • [-] Related docs/ files are up-to-date, or added when necessary
    • [-] Documentation has been rebuilt successfully
    • [-] Examples have been updated
  • Tests pass (If not, and this is expected, please elaborate in the tests section)
  • PR description thoroughly describes the new feature, bug fix, etc.

Related issues

Impacted areas of the software

  • hopp/simulation/technologies/wind/wind_plant.py: WindConfig added inputs
    • store_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 to True, 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 to False - just scales the power-curve so its maximum value is equal to the input turbine rating (this was the old workflow). When set to True - recalculates the turbine power-curve using the calculate_powercurve() function from PySAM (see the documentation here). Only used if model_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 in initialize_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 input config.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 that wind_plant input can be None so this function can be used outside of WindPlant.

Additional supporting information

Test results, if applicable

Copy link
Collaborator

@jaredthomas68 jaredthomas68 left a 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:
Copy link
Collaborator

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.

Copy link
Collaborator Author

@elenya-grant elenya-grant Apr 1, 2025

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)

@jaredthomas68 jaredthomas68 merged commit 5981e14 into NREL:develop Apr 7, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants