-
Notifications
You must be signed in to change notification settings - Fork 183
[BUGFIX] Improve handling of multidimensional turbine conditions #996
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
Changes from 16 commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
c7b3d75
Updates to allow single condition; allow multidim_condition to go to …
misi9170 bca6624
Forgot to add floris input yaml.
misi9170 27f2e9d
Clean up
misi9170 3a10805
Require dictionaries to ensure ordering does not affect results
misi9170 2f29e27
Improve testing and docs so that multidim_condition is always passed …
misi9170 3df1d4e
Merge branch 'develop' into bugfix/md-dims
misi9170 99b9f10
One condition per solve currently
misi9170 731bfe3
Update turbine documentation and add deprecation warning to turbine_p…
misi9170 5a89f27
Foratting
misi9170 418d80d
Documentation updates, in particular for the input files
misi9170 fbad91c
Fix bad description of columns on multdim csv
misi9170 e6c9607
Formatting
misi9170 c46c005
Add notes indicating that the multidim tables are fictional
misi9170 255a5f0
Add description of turbines in turbine_library
misi9170 cea9ea1
Update doc strings to remove Cp/Ct in favor of power/thrust_coefficient
misi9170 e986225
Fix line length
misi9170 dd05de1
Added comments/typo fixes
misi9170 ac8a0ea
Enable mutlidim tables in turbine_library_path location
misi9170 99a4a20
Fix test by simlinking multidim input file from examples
misi9170 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| { | ||
| "cells": [ | ||
| { | ||
| "cell_type": "markdown", | ||
| "id": "ab10767e", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "# Multidimensional Wind Turbine\n", | ||
| "\n", | ||
| "Many external factors can affect the power and thrust curves of wind turbines. FLORIS supports the\n", | ||
| "ability to define \"multidimensional\" wind turbines, where the power and thrust curves are defined\n", | ||
| "as a function of external parameters. To enable this functionality, rather than defining `power`\n", | ||
| "and `thrust_coefficient` as a function of `wind_speed` on the `power_thrust_table`, users should\n", | ||
| "instead provide a path to a data file (described below) as `power_thrust_data_file`. Additionally,\n", | ||
| "users must set the `multi_dimensional_cp_ct` option on the turbine definition to `True`.\n", | ||
| "\n", | ||
| "The power thrust data file should be a CSV file with the following columns:\n", | ||
| "(`<external_parameter_1>`, `<external_parameter_2>`, ..., `ws`, `power`,\n", | ||
| "`thrust_coefficient`). The external parameters can be any relevant factors that affect the turbine\n", | ||
| "performance, and the values to be used will be specified at run time or in the FLORIS input file.\n", | ||
| "For example, the external parameters could be air density, wave height, etc. The `ws` column should\n", | ||
| "contain the wind speed values for specification of the power and thrust coefficient (stored in the\n", | ||
| "`power` and `thrust_coefficient` columns, respectively). The wind speed, power, and thrust\n", | ||
| "coefficient values should be defined for each combination of the external parameters.\n", | ||
| "\n", | ||
| "The following code snippet shows an example of a multidimensional wind turbine definition and its\n", | ||
| "corresponding power thrust data file." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", | ||
| "execution_count": null, | ||
| "id": "cc97a774", | ||
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "import numpy as np\n", | ||
| "import matplotlib.pyplot as plt\n", | ||
| "\n", | ||
| "from floris import FlorisModel, TimeSeries\n", | ||
| "\n", | ||
| "n_wind_speeds = 100\n", | ||
| "wind_speeds = np.linspace(0.1, 30, n_wind_speeds)\n", | ||
| "\n", | ||
| "fmodel = FlorisModel(\"defaults\") # Defaults to NREL 5MW turbine\n", | ||
| "fmodel.set(\n", | ||
| " wind_data=TimeSeries(\n", | ||
| " wind_directions=np.zeros(n_wind_speeds),\n", | ||
| " wind_speeds=wind_speeds,\n", | ||
| " turbulence_intensities=0.06\n", | ||
| " ),\n", | ||
| " layout_x=[0],\n", | ||
| " layout_y=[0],\n", | ||
| " wind_shear=0.0,\n", | ||
| " turbine_type=[\"iea_15MW_floating_multi_dim_cp_ct\"],\n", | ||
| " reference_wind_height=-1,\n", | ||
| ")\n", | ||
| "\n", | ||
| "# Now, we need to specify what external parameters to run the model for\n", | ||
| "fmodel.set(multidim_conditions={\"Tp\": 2, \"Hs\": 1})\n", | ||
| "fmodel.run()\n", | ||
| "\n", | ||
| "powers = fmodel.get_turbine_powers()\n", | ||
| "thrust_coefficients = fmodel.get_turbine_thrust_coefficients()\n", | ||
| "\n", | ||
| "fig, ax = plt.subplots(2, 1, sharex=True)\n", | ||
| "ax[0].plot(wind_speeds, powers, label=\"First condition\")\n", | ||
| "ax[0].grid()\n", | ||
| "ax[0].set_ylabel(\"Power [kW]\")\n", | ||
| "ax[1].plot(wind_speeds, thrust_coefficients)\n", | ||
| "ax[1].grid()\n", | ||
| "ax[1].set_ylabel(\"Thrust coefficient [-]\")\n", | ||
| "ax[1].set_xlabel(\"Wind speed [m/s]\")\n", | ||
| "ax[1].set_xlim([0, 30])\n", | ||
| "\n", | ||
| "# Set a second multidimensional condition and rerun\n", | ||
| "fmodel.set(multidim_conditions={\"Tp\": 4, \"Hs\": 5})\n", | ||
| "fmodel.run()\n", | ||
| "\n", | ||
| "powers = fmodel.get_turbine_powers()\n", | ||
| "thrust_coefficients = fmodel.get_turbine_thrust_coefficients()\n", | ||
| "ax[0].plot(wind_speeds, powers, label=\"Second condition\")\n", | ||
| "ax[0].legend(loc=\"upper left\")\n", | ||
| "ax[1].plot(wind_speeds, thrust_coefficients)" | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "id": "98fd51f6", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "Note that this example is not meant to be represntative of a real turbine, but rather to illustrate\n", | ||
| "the functionality. At this time, FLORIS only support a single external condition combination at a\n", | ||
| "time, but multiple combinations can be run sequentially as is shown above." | ||
| ] | ||
| }, | ||
| { | ||
| "cell_type": "markdown", | ||
| "id": "8c21f432", | ||
| "metadata": {}, | ||
| "source": [] | ||
| } | ||
| ], | ||
| "metadata": { | ||
| "kernelspec": { | ||
| "display_name": "floris", | ||
| "language": "python", | ||
| "name": "python3" | ||
| }, | ||
| "language_info": { | ||
| "codemirror_mode": { | ||
| "name": "ipython", | ||
| "version": 3 | ||
| }, | ||
| "file_extension": ".py", | ||
| "mimetype": "text/x-python", | ||
| "name": "python", | ||
| "nbconvert_exporter": "python", | ||
| "pygments_lexer": "ipython3", | ||
| "version": "3.13.2" | ||
| } | ||
| }, | ||
| "nbformat": 4, | ||
| "nbformat_minor": 5 | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,68 @@ | ||
|
|
||
| # Turbine Library | ||
|
|
||
| FLORIS includes a library of predefined wind turbine models that can be used to quickly set up | ||
| simulations without needing to define the turbine characteristics manually. These include standard | ||
| reference wind turbines as well as fictional wind turbine models for the purpose of demonstrating | ||
| various features of FLORIS. These turbines are stored in the `floris.turbine_library` module. | ||
|
|
||
| ## NREL 5MW reference wind turbine | ||
|
|
||
| FLORIS representation of the NREL 5MW reference wind turbine {cite:t}`jonkman_NREL5MW_2009`. Data | ||
| based on https://github.com/NREL/turbine-models/blob/master/Offshore/NREL_5MW_126_RWT_corrected.csv. | ||
| Specified as `"nrel_5MW"` in the `turbine_type` field of the FLORIS input dictionary. | ||
|
|
||
| The NREL 5MW turbine is the default turbine model used in most FLORIS examples and tutorials. It is | ||
| also the model used if FLORIS is instantiated in the defaults configuration using | ||
| `FlorisModel("defaults")`. | ||
|
|
||
|
|
||
| ## IEA 15MW reference wind turbine | ||
|
|
||
| FLORIS representation of the IEA 15MW reference wind turbine {cite:t}`gaertner_IEA15MW_2020`. Data | ||
| based on https://github.com/IEAWindTask37/IEA-15-240-RWT/blob/master/Documentation/IEA-15-240-RWT_tabular.xlsx. | ||
| Specified as `"iea_15MW"` in the `turbine_type` field of the FLORIS input dictionary. | ||
|
|
||
| The IEA 15MW turbine is used in the following examples: | ||
| - examples/examples_control_types/004_helix_active_wake_mixing.py | ||
|
|
||
| ## IEA 10MW reference wind turbine | ||
|
|
||
| FLORIS representation of the IEA 10MW reference wind turbine {cite:t}`kainz_IEA10MW_2024`. Data | ||
| based on https://github.com/NREL/turbine-models/blob/master/Offshore/IEA_10MW_198_RWT.csv. | ||
| Specified as `"iea_10MW"` in the `turbine_type` field of the FLORIS input dictionary. | ||
|
|
||
| The IEA 10MW turbine is used in the following examples: | ||
| - examples/examples_turbine/002_multiple_turbine_types.py | ||
|
|
||
| ## IEA 15MW multidimensional | ||
|
|
||
| Fictional IEA 15MW turbine model used to demonstrate the use of multidimensional power and thrust | ||
| coefficient data. Reads in fictional multidimensional data describing the power and thrust coefficient | ||
| relationships on wave period `Tp` and wave height `Hs` from `iea_15MW_multi_dim_Tp_Hs.csv` in the | ||
| `turbine_library` folder. Specified as `"iea_15MW_multi_dim"` in the `turbine_type` field of the FLORIS | ||
| input dictionary. This data should be treated as fictional and for demonstrative purposes only. | ||
|
|
||
| This fictional turbine model is not currently used in examples. | ||
|
|
||
| ## IEA 15MW floating, multidimensional | ||
|
|
||
| The same as the multidimensional IEA 15MW turbine model above, but with an additional fictional | ||
| floating platform tilt table. This model is used to demonstrate the floating wind turbine capabilities | ||
| in FLORIS. Specified as `"iea_15MW_floating_multi_dim"` in the `turbine_type` field of the FLORIS input | ||
| dictionary. This data should be treated as fictional and for demonstrative purposes only. | ||
|
|
||
| This fictional turbine model is used in the following examples: | ||
| - examples/examples_multidim/001_multi_dimensional_cp_ct.py | ||
| - examples/examples_multidim/002_multi_dimensional_cp_ct_2Hs.py | ||
|
|
||
| ## IEA 15MW with turbulence intensity dependency | ||
|
|
||
| FLORIS representation of the IEA 15MW reference wind turbine with multidimensional power and thrust | ||
| coefficient data that depends on turbulence intensity. Reads in fictional multidimensional data | ||
| from `iea_15MW_multi_dim_TI.csv` in the `turbine_library` folder. Specified as | ||
| `"iea_15MW_multi_dim_TI"` in the `turbine_type` field of the FLORIS input dictionary. This data should | ||
| be treated as fictional and for demonstrative purposes only. | ||
|
|
||
| This fictional turbine model is used in the following examples: | ||
| - examples/examples_multidim/003_multidimensional_cp_ct_TI.py |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.