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 v4 #870

Merged
merged 84 commits into from
Apr 9, 2024
Merged

FLORIS v4 #870

merged 84 commits into from
Apr 9, 2024

Conversation

misi9170
Copy link
Collaborator

@misi9170 misi9170 commented Apr 5, 2024

FLORIS v4.0

FLORIS v4 brings significant additional flexibility to FLORIS while streamlining the underlying solving code.

Major updates, along with associated pull requests, are listed below.

API rework

Main user class

In an acknowledgement that for most users, the FlorisInterface is, for all intents and purposes,
FLORIS itself, we have renamed this class FlorisModel, and nominally instantiate it as fmodel.
The uncertainty interface and parallel interface have been renamed for consistency.

set() run() paradigm

Switches from steps reinitialize(), calculate_wake() to the simpler set(), run() pair.
Control setpoints are now also entered through set(), and remembered on the fmodel object, and
run() takes no arguments but must be called prior to querying for any power outputs.

Wind data objects

set() is now strict about requiring equal lengths for all arguments. To facilitate simpler provision of wind data
to the FlorisModel, we have built "wind data" objects (TimeSeries, WindRose, WindTIRose) to handle broadcasting, storing frequencies of occurrence, etc.

Market value

As well as computing annual energy production, FLORIS now facilitates the use of computing the annual value of
energy when value is stored on the wind data objects. This may also be used for layout optimization.

Turbines

Turbine modeling

The underlying code for modeling turbine operation has been significantly updated, and turbines are now specified
in terms of their thrust coefficient and absolute power (specified in kW).

Turbine operation

Additionally, the operation of turbine has been made more flexible to allow various types of operation (e.g. wake steering, derating, active wake mixing).

Active wake mixing with Helix

Utilizing new turbine operation models, the Helix wake mixing strategy has a preliminary implementation that models both effects on turbine power and thrust coefficient and effects on wake recovery.

Derating and shut off

The ability to derate turbines by providing a derating limit, as well as the ability to shut off turbine entirely,
has been added using new turbine operation models.

Multidimensional turbines

Support for multidimensional turbine power/thrust curves has been broadened and is now available in all wake models.

Code base and structural changes

4-dimensional underlying arrays

To streamline operation of the underlying solving code, data structures have been reduced to 2 or 4
dimensions: n_findex x n_turbines x (n_grid_1 x n_grid_2).
The "findex" dimension now holds all "conditions" for FLORIS to solve, and collapses the separated
n_wind_directions x n_wind_speeds found in FLORIS v3 into a single dimension.

Rework of package structures

To clear up confusing naming, much of the user interface tools have been moved up to the base floris package,
while the solve code is now in the floris.core package.

Miscellaneous improvements

Various improvements of note have been made across the repository, including improvements to documentation and reorganizing the examples.


Full Changelog: v3.6...v4.0


Developer checklist

Release checklist:

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

rafmudaf and others added 30 commits December 7, 2023 13:44
* Make changes such that test_ct passes in 4d

* Set axial_induction() and test to 4d

* fix test_rotor_velocity_yaw_correction to 4d

* test_rotor_velocity_tilt_correction to 4d

* test_compute_tilt_angles_for_floating_turbines 4d

* Add simple cubature test which passes in 5d

* Add test of cubit cubuture which passes in 4d

* Convert cubature functions to 4d

* Change sample to findex, n_findex

* add N_FINDEX to conftest

* convert farm and unit_tests to 4D

* Delete non-input from docstring

* Add test for 5d reverse rotation and ruff format

* convert utilties and tests to 4d

* Reset formatting

* rem N_WIND_D/S in favor of N_FINDEX in conftest.py

* Clean up some commented code

* Clean up commented code

* fix turbine_type_map in unit test

* fix turbine_type_map size

* revert wind speed and direction tests

* fix doubled code block

* Clean up comments

* Clean up typos

* A few more typos

---------

Co-authored-by: Rafael M Mudafort <[email protected]>
* update reg_tandem to mimic Jensen.

* Partway through solve; commiting to realign with 4d.

* Tandem reg test passing.

* Updated reg tests; all pass.

* Adding reg test for yaw_added_mixing; final values not yet in.

* Removing 5th dim

* Update print_test_values for 4d; add optional max findex to print.

* yaw_added_recovery test updated to include default 0 gain and nonzero gain.
# Conflicts:
#	floris/simulation/flow_field.py
#	tests/turbine_unit_test.py
* initial commit

* first pass edit of 01 example

* ruff formatting

* bugfix

* bugfix

* Convert to 4d

* correct docstrings

* fix docstring

* convert tests to 4d

* back to gch

* Update conditions to evaluate block to 4d

* fix floris_interface test and add power tests

* Add shape test

* Update example 04

* Convert 05

* Update 06 to 4d

* Update 09 to 4D

* Update 18 to 4d

* Update 21 to 4d

* Update 22 to 4d

* convert 24 to 4d

* remove wind speed from call to PointsGrid

* change PointsGrid to 4d

* change call to set_tilt to pass n_findex

* Update comment

* start fixing

* Remove todo

* Remove todo

* Clean up some comments

* More comment clean up

---------

Co-authored-by: Rafael M Mudafort <[email protected]>
* update turbopark solver for 4D

* update turbopark model for 4D

* update turbopark regression test for 4D

* Update regression test API

---------

Co-authored-by: Rafael M Mudafort <[email protected]>
* Fix API in an example

* Fix index in rotor visualization method

* Fix inconsistent wind condition arrays

* Describe 4D arrays in Getting Started docs

* Clarify description of setting atmospheric conditions
* Update wind condition broadcast for turbine tests

The inputs changed in conftest but this wasn’t updated

* Update multidimensional turbine module for 4D arrays

* Update multidimensional example API’s

* Unit test bug fix

* Remove a few missed extra dimensions
Convert core data structures and tools to use 4D arrays
* add power to 5MW model, matches https://github.com/NREL/floris/blob/main/floris/turbine_library/nrel_5MW.yaml with extension for before cut in and after cut out. Rename thrust field.

* Removing Cp interp and replacing with direct power interp; updating thrust_coefficient key name.

* Convert to W for power_interp; remove ref air density from power calc (tests need updating yet).

* Minor updates for plot axes---contains temporary limitation to NREL 5MW turbine only, will remove prior to merge into v4 branch.

* Updating 15mw based on https://github.com/IEAWindTask37/IEA-15-240-RWT/blob/master/Documentation/IEA-15-240-RWT_tabular.xlsx

* 10mw updated.

* Updating turbine curve conversion utility and example.

* Utility for converting from v3 turbine models to v4.

* Ruff and isort.

* Changing names to check out v3 versions.

* Renaming again...

* Converting old models over.

* So that tests run, using v4 5MW.

* Updates to test_build_turbine_dict.

* Updating conftest, test_power() to reflect absolute power in turbine yaml.

* air density removed from power() calls in reg tests.

* Reinstating accidentally overwritten file.

* Convert from `ref_density_cp_ct` to `ref_air_density`.

* `ref_tilt` replaces `ref_tilt_cp_ct`

* Ruff, isort; remove AIR_DENSITY from turbine_unit_test.test_power().

* Clearing empty lines.

* Check for smoothness; not yet passing `smooth enough` test.

* Tests passing for smoothness.

* Converter prints warning if nonsmooth; added handling for no R4.

* Update build_turbine_dict test for clarity and simplicity. Ruff, isort.

* Bugfixes in example after semantic changes to build_turbine_dict.

* clean up example, remove deprecated inputs check in favor of generic key errors.
* add power to 5MW model, matches https://github.com/NREL/floris/blob/main/floris/turbine_library/nrel_5MW.yaml with extension for before cut in and after cut out. Rename thrust field.

* Removing Cp interp and replacing with direct power interp; updating thrust_coefficient key name.

* Convert to W for power_interp; remove ref air density from power calc (tests need updating yet).

* Minor updates for plot axes---contains temporary limitation to NREL 5MW turbine only, will remove prior to merge into v4 branch.

* Updating 15mw based on https://github.com/IEAWindTask37/IEA-15-240-RWT/blob/master/Documentation/IEA-15-240-RWT_tabular.xlsx

* 10mw updated.

* Updating turbine curve conversion utility and example.

* Utility for converting from v3 turbine models to v4.

* Ruff and isort.

* Changing names to check out v3 versions.

* Renaming again...

* Converting old models over.

* So that tests run, using v4 5MW.

* Updates to test_build_turbine_dict.

* Updating conftest, test_power() to reflect absolute power in turbine yaml.

* air density removed from power() calls in reg tests.

* Reinstating accidentally overwritten file.

* Convert from `ref_density_cp_ct` to `ref_air_density`.

* `ref_tilt` replaces `ref_tilt_cp_ct`

* Ruff, isort; remove AIR_DENSITY from turbine_unit_test.test_power().

* Clearing empty lines.

* Check for smoothness; not yet passing `smooth enough` test.

* Tests passing for smoothness.

* Converter prints warning if nonsmooth; added handling for no R4.

* Update build_turbine_dict test for clarity and simplicity. Ruff, isort.

* Bugfixes in example after semantic changes to build_turbine_dict.

* Moving turbine into its own simulation directory; updating names of interp functions.

* SimpleTurbine power module.

* Turbine submodule pieces.

* Added thrust coefficient to SimpleTurbine.

* Adding extra arguments to Ct(), power(), and axial_induction().

* Updating turbine_unit_test for new layout.

* Add handling for different model types.

* cosine loss model option, but currently matches simple.

* Moving velocities to own file (may need renaming).

* Temp; runs, still todo items for power().

* Now passing all the way through the power calculation.

* Updating thrust model to match power.

* Update imports in tests.

* Passing arguments as kwargs.

* cosine loss model; move various turbine parameters inside power_thrust_table; call power() and thrust_coefficient() with kwargs.

* Update tests calling power; turbine model structure.

* emg reg tests failing.'

* Jensen reg passes.

* TB reg tests pass.

* CC, gauss reg tests good.

* Fix bug in how tilt_angles are passed through.

* Turbine building utilities updated.

* removing unnecessary attributes from Farm class.'

* Updated axial_induction() keywords for consistency.

* Note to return to axial_induction() model.

* rename rotor_effective_velocity.py

* Move rotor velocity tests to individual module.

* tests for air density correction.

* add base class for turbine models; add tests.

* init test passes.

* test_power, test_Ct now passing.

* axial_induction passes.

* Remove ref_tilt argument from Ct()

* isort, ruff.

* Remove multidim utilities and their imports.

* working through example 30 to go through full multidim example.

* example 30 now runs. Can likely remove commented out code, but will leave for the time being and clean up later.

* 31 now runs.

* isort.

* End of file.

* Moving multidim functionality onto turbine.py

* Remove turbine_multi_dim.py

* Missed a reference...

* ruff, isort.

* removing unneeded TODOs.

* moving turbine utilities.

* Move multidim selector to utilities, model map to top of turbine.py

* Rename power_interp power_function throughout.

* comments for turbine.py

* Adding descriptions for the turbine submodels.

* fix end of file.

* Disclaimers and copyrights.

* removing sorting of uneeded properties from full_flow solvers.

* Inherit from correct base class.

* Turbine library updates for examples 17 and 18.

* Example 24.

* ex. 33.

* ruff.

* Return nrel_5MW.yaml to converted (rather than updated) version.

* Remove unused code

* Remove extra lines at end of file

* Move rotor velocity module up to floris.simulation

* Consolidate turbine models into one module

* Move turbine preprocessing to floris.turbine_library

* Fix line length linting and isort errors

* Update API for turbine previewer

* Prevent test file from being exported

* Bug fix in example

* Remove duplicate code

* Rename Farm setup function to reflect the data

* Move axial_induction functionality to submodels; propagate changes.

* add axial induction model tests.

* Rename Ct functions throughout.

* Update fi method call.

* Line length.

* Missed the constructors.

* Rename to .

* Remove unused library in dependencies

This was previously used for the multidimension turbine, but it has since been consolidated and flatten_dict isn't used

* Remove unused import

* Fix incorrect type hints

---------

Co-authored-by: Rafael M Mudafort <[email protected]>
ejsimley and others added 4 commits April 4, 2024 11:40
* adding value functions to wind_data

* adding functions to get expected and annual value in floris_model

* including value objective in layout optimization

* updating floris model integration tests for AVP

* reg test for scipy layout opt with value

* Fix docstring and a few spelling errors

* Update docstring

* updating scipy layout opt reg test results

* typo fix

* updating pyOptSparse layout optimization docstring

---------

Co-authored-by: Paul <[email protected]>
* Handling for order of set_operation model and setting layout.

* ruff.

* One more test added.
* Make set_operation public.

* Add checks for valid setpoint lengths, tests.
@misi9170 misi9170 marked this pull request as ready for review April 5, 2024 19:06
@misi9170 misi9170 marked this pull request as draft April 5, 2024 19:07
@misi9170 misi9170 changed the title Merge v4 to develop in preparation for v4 release Merge v4 branch into develop in preparation for FLORIS v4 release Apr 5, 2024
@misi9170 misi9170 changed the base branch from develop to main April 5, 2024 20:10
@misi9170 misi9170 changed the title Merge v4 branch into develop in preparation for FLORIS v4 release FLORIS v4 Apr 5, 2024
rafmudaf and others added 7 commits April 5, 2024 15:56
* remove unneeded TODOs

* Move rotor_velocity_air_density_correction to rotor_velocity.py'

* explicit about cosine term in velocity corrections for yaw and tilt.

* self.yaw_opt is being used.
* Placeholder for Helix turbine operation model with test.

* Ruff.

* Placeholder for wake effect of Helix.

* Added helix wake mixing and created two examples.

* Added examples

* Latest file updates

* Updated v4 to work with helix

* Make helix parameters tunable

* Enabling helix tuning parameters

* Conform with ruff formatting reqs.

* Isort, end of file fixes.

* helix_amplitudes into tests.

* Take out actual tests of Helix to allow testing to pass; still to do to test Helix model."

* Update example input files with enable_helix_added_recovery flag.

* Added helix turbine tests

* Added helix flow regression test

* Minor reorganize and cleanup of Helix tests.

* Added helix mixing to visualization tools

* Added example showcasing helix functionality

* Updated helix example

* Deleted old helix examples

* Added default helix tuning parameters for 5, 10 and 15MW turbine

* Update floris_model.py

Solve merge conflict between v4 and helix branch

* Formatting.

* Final tweaks to helix example

* Fix merge error.

* Remove carry-over from old package structure.

* Name change from `helix` to `awc`, addition of `awc_modes`.

* bug fix

* Sort imports.

* Remove extra mixing from awc in downstream turbines' wakes.

* test build docs from branch.

* test again.

* Typo

* test.

* operation models user reference.

* save

* Placeholder for WindData documentation.

* Ruff.

* Updates to helix example, tests, and input files based on feedback

* set_operation_model name switch

* Started v3 to v4 conversion; described set run.

* Start of explanation on conversion.

* Minor changes to helix example

* input files info.

* Wind data, op models.

* Trailing white space.

* Minor improvements.

* Typos

* Added documentation on helix turbine model

* Added documentation on helix added wake mixing

* Finalize text on active wake mixing

* Remove trailing whitespace.

* Minor updates to Helix docs

* save

* remove comma after math

* Add wind data notebook

* Bug fix

* Minor changes

* Ignore examples within docs

* Add jobs to automatically build out examples

* Add script to convert examples to notebooks

* Resolving final comments

* trigger

* Try to fix copy

* Deleted commented code

* Update example to use new set_operation_model method.

* Minor improvements.

* Fix headings

* Helix example moved to examples_control_types

* Force doc rebuild

* More version updates

* Fixed to autobuild

* Don't test example converting script

* Increase jupyter book timeout

* Remove filedir lines

* force book

* Give more time

* Added warnings when models other than EmGauss are used

* Improve formatting

* bugfix

* more value discussion in wind_data docs notebook

* Bugfix in check of awc and vel_model.

* Handling for case when operation_model not specified; move tilt deflection examples to floating examples folder.

* Fix whitespace issue

* resave wind_data

* Update _config.yml/g-tag

* force build

* fix turbine previewer

* update landing page and installation.

* Comments formatted in gch and nrel_5mw for docs printing.

* Remove examples index in favor of automatic building.

* floris.tools -> floris, floris.simulation -> floris.core

* Point trigger back to develop.

---------

Co-authored-by: Joeri Frederik <[email protected]>
Co-authored-by: Frederik <[email protected]>
Co-authored-by: jfrederik-nrel <[email protected]>
Co-authored-by: Paul <[email protected]>
Co-authored-by: Eric Simley <[email protected]>
misi9170 and others added 8 commits April 8, 2024 13:49
… methods (#868)

* remove yaw angles argument; switch to deepcopies.

* No longer allowed to pass wd, ws, ti---instead, specify a findex (or set a single ws, wd, ti).

* Remove erroneous type hints.

* update tests.

* Ruff formatting.

* Update examples. Note that previous calculate_XX_planes altered the rotor_diameters field on fmodel.

* Update Helix viz.

* calculate_horizontal_plane_with_turbines now consistent with calculate_horizontal_plane.

* remove now-redundant check_wind_condition_for_viz

* Clean up TODOs and docstrings.
* deflection_rate = 22.

* Update reg tests.

* Update Helix reg test for new default deflection_rate.
* Resampling inplace (default true).

* Change default for inplace to False; clean up slightly.

* Wind rose plot defaults to bins specified.

* Simplify plot() and resample() methods.

* Missed a couple of places in renaming.

* Change "resample" to aggregate and add a resample_by_interpolation

* Better warnings

* value error

* typo

* updating some wind_data docstrings

* Add aggregation and interpolation functions

* bugfix

* Fix spelling

* Update example 003

* But fix in plot

* Fix plotting and nomenclature

* Add to 03 example

* Start fixing wind data

* Re-add value functions to time series

* Update wind data notebook

* Add interpolated resampling to windTIrose

* bugfix

---------

Co-authored-by: Paul <[email protected]>
Co-authored-by: Eric Simley <[email protected]>
@misi9170 misi9170 marked this pull request as ready for review April 9, 2024 20:11
@misi9170 misi9170 merged commit cc8135c into main Apr 9, 2024
16 checks passed
@rafmudaf rafmudaf deleted the v4 branch April 12, 2024 15:26
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.

5 participants