Skip to content
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

FLORIS v3.4 #656

Merged
merged 23 commits into from
May 16, 2023
Merged

FLORIS v3.4 #656

merged 23 commits into from
May 16, 2023

Conversation

rafmudaf
Copy link
Collaborator

@rafmudaf rafmudaf commented May 16, 2023

Release FLORIS V3.4

This release includes a number of major improvements and fixes. A summary is included here, but see the GitHub Release page for a full listing.

Major Improvements in FLORIS v3.4

The full list of changes along with their corresponding pull request is available at the v3.4 GitHub Release and the primary changes are listed below.

  • Modeling wake effects of floating offshore wind turbines
    Feature: Floating turbine Cp/Ct/Tilt support #518
    A key new feature is the support for changing tilt angle as a function of wind speed. Also included is the ability for the turbine Cp/Ct tables to be specified with or without platform tilt.

  • Empirical Gaussian Wake Model
    Add Empirical Gauss wake model for fitting SCADA data #628
    This new model emphasizes the simplification of tuning while maintaining similar mathematical structures to the Gauss-Curl-Hybrid (GCH) model. This model reduces the number of available free parameters and seeks to avoid cross-coupling by linking one parameter to one model effect. In internal testing, the model performed well against existing models in SCADA data comparisons. It also includes features not available in former models, such as vertical wake deflection due to rotor tilt and ground effects on wake recovery. Finally, the model is 2–3 times faster than the GCH model. Although the Empirical Gaussian Wake Model is still in active development, the FLORIS team is very excited to share it and collaborate with interested parties. The new model will be presented at the May 2023 Wind Energy Science Conference.

  • Sampling of arbitrary flow points
    Add support for probing velocities at arbitrary flow field points #650
    Probing the flow field to extract velocities at user-defined points is now supported. This could be used, for example, to compare FLORIS predictions to wind velocity measurements taken by a meteorological mast or compare to large eddy simulation predictions at specific points in the flow.

  • Heterogenous Inflow Definition and Visualization
    Add coordinates from inertial frame to grid class #578
    The heteroneous wind speeds and their placement in the farm can now be included directly in the YAML input file. Additionally, the visualization of the flow field includes a map of the heterogeneous inputs to provide a clear validation and understanding of the model configuration. The orientation and layout of the wind farm is now fixed in the user-specified orientation and the wind direction rotates around the farm.

  • Improvements to rotor velocity approximation
    Add cubature integration method for rotor velocities #649
    A new method for integrating the velocities across the rotor plane is included resulting in a more accurate approximation of the average rotor velocity for approximately the same computational cost.

  • Turbine library preprocessing
    Feature: New library to inspect and interact with turbine models #639
    New tools to analyze turbine model definitions and compare turbines have been added as well as a new module floris.turbine_library. The modules includes a class TurbineInterface for single turbines and TurbineLibrary for the full library. This functionality can be used with the turbine modules included within FLORIS and any user-supplied turbine input file. See the Turbine Library Interface page of the documentation for a reference and more information.

  • Bug fixes

Release checklist

  • Update the version in
    • README.md
    • floris/VERSION
  • Verify docs builds correctly
  • Create a tag in the NREL/FLORIS repository

paulf81 and others added 23 commits March 17, 2023 10:54
* Change argmax to nanargmax

* Add test example

* Add nan warning

* Updating warning message handling, removing temporary example.

* Cleaning up trailing whitespace as suggested by pre-commit.

* Remove unused import

---------

Co-authored-by: misha <msinner@nrel.gov>
Co-authored-by: Rafael M Mudafort <rafael.mudafort@nrel.gov>
* fix wrongly duplicated error message

* change error message to FileNotFoundError

* add a test for the check

* Add clarity to unit test

Makes it more obvious that the turbine-type used in this unit test is meant to be nonexisted. "nrel_15mw" is very close to "nrel_5mw".

* Use Farm's internal method to get number of turbines

This is a more explicit and clear pattern

* Use conftest number of turbines

Just a bug fix for the previous commit

---------

Co-authored-by: Rafael M Mudafort <rafael.mudafort@nrel.gov>
* implement reference tilt value; add tilt-wind_speed interpolation functionality; apply tilt correction to poewr calculation;

* complete reference tilt implementation in floris.simulation

* rescope power calc in turbine.py; finish tilt implementation

* add tilt support to floris_interface

* add and update unit tests to accomodate floating tilt

* update regression tests to accomodate floating tilt

* updating turbine definitions to have reference tilt angle

* adding missing inputs to set_tilt_to_ref_tilt

* additional fixes to enable completion of all the examples

* add flag for cp/ct tilt correction

* update tests for cp/ct tilt correction flag

* add warning for non-tilt enable models

* updating tests

* adding missing import

* updating formatting

* Add floating example

* updating .gitignore

* removing comments from input files

* updating Tilt and PowerThrustTable assignments

* removing print statements

* updates to floating example

* adding example to examples.md

* Add location for floating model documentation

* updating floating documentation

* making turbine tilt method public

* added variables to class definition

* remove unnecessary comment

* updating docstrings

* adding turbine_effective_velocities to floris_interface

* removing call to property

* update floris_interface_regression_test for chnages due to tilt development

* Expanded documentation

---------

Co-authored-by: Paul <paul.fleming@nrel.gov>
Co-authored-by: Rafael M Mudafort <rafmudaf@gmail.com>
* Add info about GitHub form comments

* git-ignore Ruff cache files

* Fix and improve a few docstrings

* Remove redundant math in wind direction delta

* Use dict over array for turbine property map

See #594

* Remove unused turbine fCps array

This is ultimately used to construct the `power_interp` array, so it is redundant here.

* Simplify time-series selection in FlorisInterface

* Disable GCH components for Jensen example input

* Remove redundant array slice operations

* Add all releases to quality metric plots

* Replace hard-coded rotor diameter with model value

See e7fe3fd#r99212494

* removing space at end of line in docs

---------

Co-authored-by: bayc <christopher.j.bay@gmail.com>
Instead of requirements.txt
* Pin jupyter-book version to v0.13.3

Later versions have a conflict with the _templates that we currently use to enable recursive autodocs. See these issues:
- executablebooks/sphinx-book-theme#719
- sphinx-doc/sphinx#11315

* Build the docs
* Add high level architecture diagram

* Mark type_dec internal functions private

* Clarify design drivers
* Remove option to use layout tuple

* Remove reference to set_rotor_diameter

* Require reference density for turbine performance

* Remove test checking for an error message

The error message is removed in a previous commit so the test is no longer relevant

* Add missing input to 20MW turbine model
* Split turbine definition loading

* Remove support for JSON input files

* Add test for exporting non-initialized attributes

* Avoid overwriting farm.turbine_type

This should always retain its data as input so that it can be propertly exported

* Spelling fixes

* Let file loading error if given an invalid type

Supporting passing a dict to a function that expects a filepath makes the calling code difficult to read. We should handle the types correctly instead.

* Consolidate floating and land-based test turbines

* Add type-validation to farm attributes

This prevents errors when building up a dictionary to create Farm from code

* Add unit tests for new turbine loading

* Deep copy turbine dicts

* Fix formatting

* Fix validator types

I guess I don’t know how to use Union…

* Fix case sensitivity

* Fix type in docstring

* Disable sorting keys on YAML dump
* update jupyter-book versioning to ensure successful builds

* add first pass of wake comparison page

* add bibtex reference for myst

* add in docstring content for each model

* add ipython notebook checkpoints

* update comment

* add some in-line comments and put Jensen in the right place

* remove placeholder

* Add additional wake model descriptions

* Update wake_comparison.md

* add AEP comparison to the results section

* add wake losses

* fix formatting error

* Formatting clean up

* Bib clean up

* Expand into

* Convert md to Jupyter Notebook

* Add Jensen plot

* Add info for Jensen and GCH velocty models

* Add descriptions of the wake deflection and combination models

* Hide code cells

* Add a bibliography page

---------

Co-authored-by: paulf81 <paul.fleming@nrel.gov>
Co-authored-by: Rafael M Mudafort <rafmudaf@gmail.com>
* update jupyter-book versioning to ensure successful builds

* add first pass of wake comparison page

* add bibtex reference for myst

* add in docstring content for each model

* add ipython notebook checkpoints

* update comment

* add some in-line comments and put Jensen in the right place

* remove placeholder

* Add additional wake model descriptions

* Update wake_comparison.md

* add AEP comparison to the results section

* add wake losses

* fix formatting error

* add first pass at turbine library interface

* add missing leading f in an f-string

* add thrust curve functionality

* add rotor diameter plots

* add hub height plot

* add individual turbine plotting for power/thrust curves

* add example for how to use new library interface

* add subplot comparison method and fix fig_kwargs bug

* Formatting clean up

* Bib clean up

* fix bug in thrust coefficient

* add Cp curve and change thrust to Ct

* add Cp and convert thrust to Ct

* Expand into

* update the formatting

* update example for ct/cp usage

* add new example to index

* turbine library interactions to the docs

* add internal library loading

* add a comment to explain the example

* add an example for accessing the turbines

* Convert md to Jupyter Notebook

* Add Jensen plot

* Add info for Jensen and GCH velocty models

* Fix spelling

* Reflect that wind speed inputs are arrays

* Fix line length violations

* Rearrange docs TOC

* remove 18b from examples

* convert markdown demo to interactive notebook example

* add missing kwarg passing and fix typo

* move general methods to utilities

* convert numpy docstrings and use defaults w/o checking

* remove unnecessary which and exclude arguments

* Order API docs alphabetically

* Revert changes to wake model notebook

* Use a smaller default figure size

* Bug fix: update API for computing performance curves

* Dont automatically set reference density

FLORIS has removed this feature and it now requires this to be set in the turbine input files

* Update notebook language and small bug fixes

---------

Co-authored-by: paulf81 <paul.fleming@nrel.gov>
Co-authored-by: Rafael M Mudafort <rafmudaf@gmail.com>
* Add informative error about new input requirements

* remove error from construct turbine map

* Add error checking to floris.py

* remove un-needed spaces

* Add documentation for turbine input file

* Check for keys in a dict instead of catching an error

* Add back the input I commented

* Trim whitespace

---------

Co-authored-by: Rafael M Mudafort <rafmudaf@gmail.com>
* Fix Ruff 0.0.265 formatting

* Use Python 3.10 in CI, add 3.8 for unit tests

Maintains a test with 3.9 for the unit tests
* Add info about GitHub form comments

* git-ignore Ruff cache files

* Fix and improve a few docstrings

* Remove redundant math in wind direction delta

* Use dict over array for turbine property map

* Remove unused turbine fCps array

This is ultimately used to construct the `power_interp` array, so it is redundant here.

* Simplify time-series selection in FlorisInterface

* Disable GCH components for Jensen example input

* Remove redundant array slice operations

* Add PointGrid for individual calculation points

* Connect PointGrid through Floris init routine

* Connect PointGrid in solver module

* Import annotations module

* add small example

* Working version that does not modify full_flow_sequential_solver

* Check and example added, still TBD where to finally place.

* Updating unit test for utilities to reflect extra possible outputs.;

* Linting cleanup.

* Reworking swith case for python 3.9 compatibility.

* remove unneeded import.

* Extra outputs from rotate_coordinates_rel_west accounted for.

* Trailing whitespace... gone.

* Improving example documentation; removing need for calculate_wake call before sampling.

* Error raised if used with invalid model.

* Updating docstring at user end.

* Ruff edits.

* Correct docstring

* Simplify point-sampling API

* Add PointsGrid docstring

* Providing more explicit and consistent naming for center of rotation attributes.

* Add point-probe example

* Update docstring

* Delete extra example

---------

Co-authored-by: Rafael M Mudafort <rafmudaf@gmail.com>
Co-authored-by: Paul <paul.fleming@nrel.gov>
Co-authored-by: misha <msinner@nrel.gov>
* Groundwork laid for geometric approach in velocity deficit.

* Smooth step width in; wake added recovery needed.

* implement reference tilt value; add tilt-wind_speed interpolation functionality; apply tilt correction to poewr calculation;

* complete reference tilt implementation in floris.simulation

* rescope power calc in turbine.py; finish tilt implementation

* add tilt support to floris_interface

* add and update unit tests to accomodate floating tilt

* update regression tests to accomodate floating tilt

* updating turbine definitions to have reference tilt angle

* adding missing inputs to set_tilt_to_ref_tilt

* additional fixes to enable completion of all the examples

* Temp so I can pop.

* Recovered stashed code.

* Creating separate solver for goemetric.

* Workaround to allow tilt angles to work.

* Removing unnecessary components from solve.

* Removing references to TI from geomodel defecit.

* full flow solver added for visualization.

* Still need to carefully check full_flow solver.

* WIP; checkpoint commit.

* Indicate that secondary effects are not yet modeled.

* Infrastructure for the geometric deflection model.

* Renaming wim_gain parameter to be able to specify for velocity and deflection more clearly.

* First pass at a deflection model. Similar tilt model included, but not passed out to anywhere else in the code.

* Back implemented tilts; need to check with Chris code.

* add flag for cp/ct tilt correction

* update tests for cp/ct tilt correction flag

* Removing initialization of tilt_angles_sorted; not as CB intended.

* Updated wake deflection model to be of similar form to that presented in B&PA.

* Removing comments, deficits work as expected.

* Undoing wrongly introduced code.

* Linking up calculated tilt angles with tilt in models.

* Computing mirror wake; uses sum of squares to combine real and mirror wake.

* Clearing up comments somewhat.

* Renaming TI wake_induced_mixing for deflection model.

* Also removing TI from full flow solver.

* Remove references to TI from full flow solver.

* Added offset term to geometric defelction model.

* renaming misalignment in Bastankhah_skew calculation to generalize to tilt as well as yaw.

* Removing debugging point accidentally left in code.

* add warning for non-tilt enable models

* updating tests

* adding missing import

* Modification to log argument (and extra tuning parameter) so that deflection is bounded above.

* Tilt propagates through deficit model.

* Reworked when the wake induced mixing factor sum is taken to simplify code.

* Yaw added recovery model added.

* Store all parts of wake induced mixing so that full_flow solve can use them in visualization. Updaate full_flow solveNotImplemented errors.

* Removing seperate y, z deflection gains as likely not needed.

* Adding theory documentation for the geometric model.

* Updated normalizing term. Produces negative values very near turbine, which may require a near-wake correction eventually.

* Defaults for velocity model, at very low TI/mixing.

* Defaults for defleciton; updated main deflection constant to address change with CT.

* Refacting mixing model to allow for base mixing.

* Renaming the mixing gains.

* Renaming skew model.

* Cleaning up formulation of change in deflection with ai.

* Norm 2 used in creating mixing factor.

* Bug fix on mixing factor dimensions.

* Bug fix in YAR.

* Change argmax to nanargmax

* Add test example

* Add nan warning

* Bugfix in sigma_z calculation.

* Adding comments/suggestions.

* Bug fix for case with multiple turbine types.

* Separating deflection gains again.

* Allows users to turn off use_memory printouts along with progress updates.

* Updated to simpler defelction model form

* Updating docs, default calibration.

* Moving deflection model to its own file.

* Velocity model split out.

* Clean up velocity model a little.

* Adding _ in front of geometric names to come back and change.

* Workaround, but a little unsatisfying. Consider smooth-step alternative.

* Swapping logistic function for (polynomial) smooth step.

* Works, but quite slow.

* ALternative smoothing method.

* Improved speed; likely still more to be gained.

* Handles multiple turbine diameters.

* Renamed _geo to empirical_gauss; running.

* Cleaning up a couple of other references to geometric model.

* Renaming ti_gain to atmospheric to be explicit.

* Cleaning up diverged branches.

* Adding example input file.

* Removing carry over error from gauss model.

* Updating default to reasonably match gauss and gch for turbine row.

* Adding docstrings.

* Updating initial wake width parameter name.

* Removing some citation hooks.

* Docs update.

* Fixing a couple of imports/nonexistent functions after merge.

* Removing temporary SR example.

* Examples for key parameters of velocity and deflection models.

* Cleaning up ruff issues.

* fixes isort issues.

* removing white space in documentation.

* Newline

* fixing merge issue.

* Regression tests, full solve tests created.

* Spell check

* Conslidate model sections

* Link to EmGauss description

* Return WIM field from EmGauss solver

For use in the visualization solver

* Disable debug output in reg test

* Fix isort

* Avoid codecov upload if token is not configured

* Remove duplicates from merge conflict

* Spell check

* Match code style to Ruff rules

* Remove unused model inputs

* Use gaussian equation from Gauss in EmGauss

* Use consistent list syntax in YAML

* Bugfix in solver to use rotor average velocities.

* Adding example for vertical wake deflection.

* Update example numbering and list them in the docs

* Reset example settings

* Points sampling compatibility with EmG model.

* Slightly more explicit handling of available models.

* Updating examples to allow users to chose model.

---------

Co-authored-by: bayc <christopher.j.bay@gmail.com>
Co-authored-by: Paul <paul.fleming@nrel.gov>
Co-authored-by: misha <msinner@nrel.gov>
Co-authored-by: Rafael M Mudafort <rafmudaf@gmail.com>
* Add example for rotor interpolation points

* Add variable weights to Ct and power interpolant

* Add a weights variable to rotor point interpolation

* Make changes to rotor interpolation scheme

* Revert unneeded changes

* Split velocity averaging to distinct functions

This makes the `average_velocity` function easier to read and the implementation of the various averages are now easier to test

* Always use cubature for TurbineGrid

* Remove velocity averaging from turbine functions

The average velocity should now instead be passed into the turbine functions from the calling code

* Update API in tests

* Add a new grid-type for the cubature

* Deepcopy dictionaries for safety

These may not be required here, but it’s questionable enough that I think its worth doing anyway.

* Add grid dependence study script

* Temporarily disable area overlap calculation

* Add turbine grid points as an input to the cubature grid

* Fix cubature integration scheme and expand for N=2 to N=10

* Expand cubature rules for N=2 to N=10

* Fix the cubic mean method for cubic curbature

* Expand grid dependency study notebook to cross-compare grid and cubature rules

* Move cubature_coefficients to the class to allow logger warnings/errors

* Ignore Ruff line length for cubature coefficients

* Remove comments and enable area overlap equation

Remove hard coded TI

* Update turbine unit test API

* Reenable filter for Turbine.average_velocity

* Code clean up

* Use a class-method for retrieving cubature coefs

This allows to get them without creating an instance of the class. It’s useful in testing.

* Add center of rotation to CubatureGrid

For use with the PointsGrid and visualization

* Update regression test API’s

* Raise error for invalid velocity average method

* Correct velocity average in CC and TurbOPark solve

* Fix linting

* Save cubature weights on Grids

Rather than the full cubature coefficient data

* Remove extra examples

* Rename new grid type to TurbineCubatureGrid

This is more consistent with the naming of the other grids where the points on the turbine explicitly state that they’re on the turbine and the others don’t

* Use defaults for averaging method and weights

* Fix API in EmGauss solver

* Add docstring to new grid

* Minor/cosmetic changes.

* Adding keywords so that args are passed correctly.

* Updating other locations of cubature_weights arg.

* Fix comparison to None

---------

Co-authored-by: Bart Doekemeijer <bart.doekemeijer@shell.com>
Co-authored-by: misha <msinner@nrel.gov>
* Add coordinates from inertial frame to grid and add visualization capabilities

* Update unit test for utilities, bug fix

* Remove unused variables

* Tiny bug fixes in visualization with inertial grid rotation functionality

* remove unnecessary calculations

* remove hardcoded flag

* reconfigure heterogeneous map input and usage

* update heterogeneous calculation to use rotated intertial_frame coordinates

* adding specific plotting method for heterogeneous flows

* adding wd input to plot_turbines_with_fi to properly plot turbine yaw setting relative to wd

* making rotating the wind turbines in plots relative to the wind direction the default behavior

* removing unnecessary parameters from grid class definition

* refactored het map generation and added docstrings

* removing out_region calculation for het_map as a freestream fill value is now used

* updating uncertainty_interface to accept het_config

* updating heterogeneous examples to use new het_config

* formatting upates

* updating parallel_computing_interface to use het_config

* updating documentation

* add separate levels parameter for contour plot for heteregeneous flows

* fixing typo in het_config parameter

* store the center of rotation in the grid classes

* add warning for users if interpolated points are calculated outside user-defined heterogeneous bounds

* moving het_config from FlorisInterface to FlowField

* moving some input checking to validators

* removing attempt at allowing for broadcasting of a single speed up array across multiple wind directions

* removing old het_config definitions

* updating the heterogeneous examples

* removing one more outdated het_map reference

* updating doctrings and comments

* fixing naming of x and y center of rotations

* Resolve merge conflicts and revert extra changes

Reducing the number of lines that were changed here to make reviewing the PR easier

* Add docstring

* Reset example settings

* Early return in error checking

* Rename heterogeneous config dictionary

New name and key/value’s are more explicit

---------

Co-authored-by: Rafael M Mudafort <rafmudaf@gmail.com>
Co-authored-by: bayc <christopher.j.bay@gmail.com>
@rafmudaf rafmudaf added this to the v3.4 milestone May 16, 2023
@rafmudaf rafmudaf self-assigned this May 16, 2023
@rafmudaf rafmudaf merged commit 2aa9f2a into main May 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation enhancement An improvement of an existing feature floris.tools
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants