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

Update to more flexible turbine operation model definitions #770

Merged
merged 111 commits into from
Jan 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
111 commits
Select commit Hold shift + click to select a range
251ad71
add power to 5MW model, matches https://github.com/NREL/floris/blob/m…
misi9170 Dec 13, 2023
f664408
Merge branch '4d' into v4/power-replaces-cp
misi9170 Dec 13, 2023
7689b6f
Removing Cp interp and replacing with direct power interp; updating t…
misi9170 Dec 13, 2023
950602a
Convert to W for power_interp; remove ref air density from power calc…
misi9170 Dec 13, 2023
c120467
Minor updates for plot axes---contains temporary limitation to NREL 5…
misi9170 Dec 13, 2023
8590d22
Updating 15mw based on https://github.com/IEAWindTask37/IEA-15-240-RW…
misi9170 Dec 14, 2023
f32e349
10mw updated.
misi9170 Dec 14, 2023
45d6ed6
Merge branch '4d' into v4/power-replaces-cp
misi9170 Dec 14, 2023
6ab6de7
Updating turbine curve conversion utility and example.
misi9170 Dec 14, 2023
52dd8a0
Utility for converting from v3 turbine models to v4.
misi9170 Dec 14, 2023
c667a2e
Ruff and isort.
misi9170 Dec 14, 2023
2efc693
Changing names to check out v3 versions.
misi9170 Dec 14, 2023
118b833
Renaming again...
misi9170 Dec 14, 2023
830bafe
Converting old models over.
misi9170 Dec 14, 2023
95a2064
So that tests run, using v4 5MW.
misi9170 Dec 14, 2023
398498f
Updates to test_build_turbine_dict.
misi9170 Dec 15, 2023
42972ca
Updating conftest, test_power() to reflect absolute power in turbine …
misi9170 Dec 15, 2023
b23fe11
air density removed from power() calls in reg tests.
misi9170 Dec 15, 2023
01529cb
Reinstating accidentally overwritten file.
misi9170 Dec 15, 2023
dec0dc9
Convert from `ref_density_cp_ct` to `ref_air_density`.
misi9170 Dec 15, 2023
94633d1
`ref_tilt` replaces `ref_tilt_cp_ct`
misi9170 Dec 15, 2023
b0adc13
Ruff, isort; remove AIR_DENSITY from turbine_unit_test.test_power().
misi9170 Dec 15, 2023
ce91f1b
Clearing empty lines.
misi9170 Dec 15, 2023
2a6be52
Check for smoothness; not yet passing `smooth enough` test.
misi9170 Dec 17, 2023
84e9f12
Tests passing for smoothness.
misi9170 Dec 18, 2023
a5310bd
Converter prints warning if nonsmooth; added handling for no R4.
misi9170 Dec 18, 2023
c9aff6e
Update build_turbine_dict test for clarity and simplicity. Ruff, isort.
misi9170 Dec 18, 2023
e1aa6ec
Merge v4 (w/ 4d) back in.
misi9170 Dec 18, 2023
0cf4b57
Bugfixes in example after semantic changes to build_turbine_dict.
misi9170 Dec 18, 2023
fd9bc68
Moving turbine into its own simulation directory; updating names of i…
misi9170 Dec 26, 2023
d55e133
SimpleTurbine power module.
misi9170 Dec 26, 2023
5ab006f
Turbine submodule pieces.
misi9170 Dec 26, 2023
ff9dfbf
Added thrust coefficient to SimpleTurbine.
misi9170 Dec 26, 2023
7e86094
Adding extra arguments to Ct(), power(), and axial_induction().
misi9170 Dec 26, 2023
6df2c21
Updating turbine_unit_test for new layout.
misi9170 Dec 26, 2023
f0a8bc8
Add handling for different model types.
misi9170 Dec 26, 2023
feeb96d
cosine loss model option, but currently matches simple.
misi9170 Dec 26, 2023
b26696f
Moving velocities to own file (may need renaming).
misi9170 Dec 26, 2023
a039236
Temp; runs, still todo items for power().
misi9170 Dec 27, 2023
4a6bd7f
Now passing all the way through the power calculation.
misi9170 Dec 27, 2023
b538315
Updating thrust model to match power.
misi9170 Dec 27, 2023
203cf37
Update imports in tests.
misi9170 Dec 27, 2023
37ca328
Passing arguments as kwargs.
misi9170 Dec 27, 2023
92aeb68
cosine loss model; move various turbine parameters inside power_thrus…
misi9170 Dec 27, 2023
3b7d54e
Update tests calling power; turbine model structure.
misi9170 Dec 27, 2023
06a9967
emg reg tests failing.'
misi9170 Dec 27, 2023
229da4d
Jensen reg passes.
misi9170 Dec 27, 2023
ca86d07
TB reg tests pass.
misi9170 Dec 27, 2023
fcae9e9
CC, gauss reg tests good.
misi9170 Dec 27, 2023
66fa072
Fix bug in how tilt_angles are passed through.
misi9170 Dec 27, 2023
54d4b40
Turbine building utilities updated.
misi9170 Dec 27, 2023
a3fbb9a
removing unnecessary attributes from Farm class.'
misi9170 Dec 27, 2023
c45839b
Updated axial_induction() keywords for consistency.
misi9170 Dec 28, 2023
6c70af6
Note to return to axial_induction() model.
misi9170 Dec 28, 2023
bda01fc
rename rotor_effective_velocity.py
misi9170 Dec 28, 2023
e09bfb5
Move rotor velocity tests to individual module.
misi9170 Dec 28, 2023
567976c
tests for air density correction.
misi9170 Dec 28, 2023
1167995
add base class for turbine models; add tests.
misi9170 Dec 28, 2023
e2bc249
init test passes.
misi9170 Dec 28, 2023
198fb79
test_power, test_Ct now passing.
misi9170 Dec 29, 2023
776fecc
axial_induction passes.
misi9170 Dec 29, 2023
4e26d56
Remove ref_tilt argument from Ct()
misi9170 Dec 29, 2023
21bf3b1
isort, ruff.
misi9170 Dec 29, 2023
43d9187
Remove multidim utilities and their imports.
misi9170 Dec 29, 2023
fe310a6
working through example 30 to go through full multidim example.
misi9170 Dec 29, 2023
040224b
example 30 now runs. Can likely remove commented out code, but will l…
misi9170 Dec 29, 2023
ca739d9
31 now runs.
misi9170 Dec 29, 2023
9a5a1c6
isort.
misi9170 Dec 29, 2023
299c0f5
End of file.
misi9170 Dec 29, 2023
7304bdc
Moving multidim functionality onto turbine.py
misi9170 Dec 29, 2023
ff44c8f
Remove turbine_multi_dim.py
misi9170 Dec 29, 2023
12d47d8
Missed a reference...
misi9170 Dec 29, 2023
e58d8fc
ruff, isort.
misi9170 Dec 29, 2023
2516b9d
removing unneeded TODOs.
misi9170 Dec 29, 2023
83d0e3e
moving turbine utilities.
misi9170 Dec 29, 2023
d52377f
Move multidim selector to utilities, model map to top of turbine.py
misi9170 Dec 29, 2023
61abb5a
Rename power_interp power_function throughout.
misi9170 Dec 29, 2023
08d0fca
comments for turbine.py
misi9170 Dec 29, 2023
2e00b34
Adding descriptions for the turbine submodels.
misi9170 Dec 29, 2023
a1f9960
fix end of file.
misi9170 Dec 29, 2023
afc042e
Disclaimers and copyrights.
misi9170 Dec 29, 2023
1a1e662
removing sorting of uneeded properties from full_flow solvers.
misi9170 Dec 29, 2023
d8d35c1
Inherit from correct base class.
misi9170 Dec 29, 2023
30afea7
Merging v4 back.
misi9170 Dec 29, 2023
8b7a006
Turbine library updates for examples 17 and 18.
misi9170 Dec 29, 2023
ac8e352
Example 24.
misi9170 Dec 29, 2023
acebe8d
ex. 33.
misi9170 Dec 29, 2023
9c6c59f
ruff.
misi9170 Dec 29, 2023
a3a07e4
Return nrel_5MW.yaml to converted (rather than updated) version.
misi9170 Dec 29, 2023
b41eeaa
Remove unused code
rafmudaf Jan 4, 2024
ae5787b
Remove extra lines at end of file
rafmudaf Jan 4, 2024
05e509d
Move rotor velocity module up to floris.simulation
rafmudaf Jan 5, 2024
a586089
Consolidate turbine models into one module
rafmudaf Jan 5, 2024
f3cbf9a
Move turbine preprocessing to floris.turbine_library
rafmudaf Jan 5, 2024
bb0ae43
Merge branch 'v4' into pr/misi9170/770
rafmudaf Jan 5, 2024
d3f0084
Fix line length linting and isort errors
rafmudaf Jan 8, 2024
366f61a
Update API for turbine previewer
rafmudaf Jan 8, 2024
b0f9c71
Prevent test file from being exported
rafmudaf Jan 8, 2024
359cc9f
Bug fix in example
rafmudaf Jan 8, 2024
cf886bd
Remove duplicate code
rafmudaf Jan 8, 2024
762ed43
Rename Farm setup function to reflect the data
rafmudaf Jan 8, 2024
142ce33
Move axial_induction functionality to submodels; propagate changes.
misi9170 Jan 9, 2024
71c739d
add axial induction model tests.
misi9170 Jan 9, 2024
3ac53e9
Rename Ct functions throughout.
misi9170 Jan 9, 2024
4be32bb
Update fi method call.
misi9170 Jan 9, 2024
eeb99f5
Line length.
misi9170 Jan 9, 2024
e372f03
Missed the constructors.
misi9170 Jan 9, 2024
1e0b58c
Rename to .
misi9170 Jan 10, 2024
8604ff7
Remove unused library in dependencies
rafmudaf Jan 10, 2024
04443cf
Remove unused import
rafmudaf Jan 10, 2024
2f15c13
Fix incorrect type hints
rafmudaf Jan 10, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 38 additions & 34 deletions docs/turbine_interaction.ipynb

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion examples/18_check_turbine.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,14 @@

# TEMPORARY
print(turbines)
turbines = turbines[1:]
turbines = [
t for t in turbines
if "converted" not in t
if "updated" not in t
if "legacy" not in t
if t != "x_20MW"
]
print(turbines)
# END TEMPORARY

# Declare a set of figures for comparing cp and ct across models
Expand Down
8 changes: 5 additions & 3 deletions examples/24_floating_turbine_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,11 @@
power_floating_defined_floating = fi_floating_defined_floating.get_turbine_powers().flatten()/1000.

# Grab Ct
ct_fixed = fi_fixed.get_turbine_Cts().flatten()
ct_floating = fi_floating.get_turbine_Cts().flatten()
ct_floating_defined_floating = fi_floating_defined_floating.get_turbine_Cts().flatten()
ct_fixed = fi_fixed.get_turbine_thrust_coefficients().flatten()
ct_floating = fi_floating.get_turbine_thrust_coefficients().flatten()
ct_floating_defined_floating = (
fi_floating_defined_floating.get_turbine_thrust_coefficients().flatten()
)

# Grab turbine tilt angles
eff_vels = fi_fixed.turbine_average_velocities
Expand Down
6 changes: 3 additions & 3 deletions examples/30_multi_dimensional_cp_ct.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
fi.calculate_wake(yaw_angles=yaw_angles)

# Get the turbine powers
turbine_powers = fi.get_turbine_powers_multidim() / 1000.0
turbine_powers = fi.get_turbine_powers() / 1000.0
print("The turbine power matrix should be of dimensions 1 findex X 2 Turbines")
print(turbine_powers)
print("Shape: ",turbine_powers.shape)
Expand All @@ -86,7 +86,7 @@
fi.reinitialize(wind_speeds=wind_speeds, wind_directions=wind_directions)
yaw_angles = np.zeros([3, 2]) # 3 wind directions/ speeds, 2 turbines
fi.calculate_wake(yaw_angles=yaw_angles)
turbine_powers = fi.get_turbine_powers_multidim() / 1000.0
turbine_powers = fi.get_turbine_powers() / 1000.0
print("The turbine power matrix should be of dimensions 3 findex X 2 Turbines")
print(turbine_powers)
print("Shape: ",turbine_powers.shape)
Expand All @@ -100,7 +100,7 @@
fi.reinitialize(wind_directions=wind_directions, wind_speeds=wind_speeds)
yaw_angles = np.zeros([9, 2]) # 9 wind directions/ speeds, 2 turbines
fi.calculate_wake(yaw_angles=yaw_angles)
turbine_powers = fi.get_turbine_powers_multidim()/1000.
turbine_powers = fi.get_turbine_powers()/1000.
print("The turbine power matrix should be of dimensions 9 WD/WS X 2 Turbines")
print(turbine_powers)
print("Shape: ",turbine_powers.shape)
4 changes: 2 additions & 2 deletions examples/31_multi_dimensional_cp_ct_2Hs.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
fi_hs_1.calculate_wake()

# Collect the turbine powers in kW
turbine_powers = fi.get_turbine_powers_multidim()/1000.
turbine_powers_hs_1 = fi_hs_1.get_turbine_powers_multidim()/1000.
turbine_powers = fi.get_turbine_powers()/1000.
turbine_powers_hs_1 = fi_hs_1.get_turbine_powers()/1000.

# Plot the power in each case and the difference in power
fig, axarr = plt.subplots(1,3,sharex=True,figsize=(12,4))
Expand Down
8 changes: 4 additions & 4 deletions examples/33_specify_turbine_power_curve.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import matplotlib.pyplot as plt
import numpy as np

from floris.simulation import turbine
from floris.tools import build_turbine_dict, FlorisInterface
from floris.tools import FlorisInterface
from floris.turbine_library import build_cosine_loss_turbine_dict


"""
Expand All @@ -39,7 +39,7 @@
"thrust_coefficient":[0, 0.9, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.25, 0.2]
}

turbine_dict = build_turbine_dict(
turbine_dict = build_cosine_loss_turbine_dict(
turbine_data_dict,
"example_turbine",
file_name=None,
Expand Down Expand Up @@ -70,7 +70,7 @@

specified_powers = (
np.array(turbine_data_dict["power_coefficient"])
*0.5*turbine_dict["ref_air_density"]
*0.5*turbine_dict["power_thrust_table"]["ref_air_density"]
*turbine_dict["rotor_diameter"]**2*np.pi/4
*np.array(turbine_data_dict["wind_speed"])**3
)/1000
Expand Down
106 changes: 53 additions & 53 deletions examples/inputs_floating/turbine_files/nrel_5MW_fixed.yaml
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
turbine_type: 'nrel_5MW_floating'
generator_efficiency: 1.0
hub_height: 90.0
pP: 1.88
pT: 1.88
rotor_diameter: 126.0
TSR: 8.0
ref_density_cp_ct: 1.225
ref_tilt_cp_ct: 5.0
correct_cp_ct_for_tilt: True # Apply tilt correction to cp/ct
power_thrust_table:
ref_air_density: 1.225
ref_tilt: 5.0
pP: 1.88
pT: 1.88
power:
- 0.0
- 0.000000
- 0.000000
- 0.178085
- 0.289075
- 0.349022
- 0.384728
- 0.406059
- 0.420228
- 0.428823
- 0.433873
- 0.436223
- 0.436845
- 0.436575
- 0.436511
- 0.436561
- 0.436517
- 0.435903
- 0.434673
- 0.433230
- 0.430466
- 0.378869
- 0.335199
- 0.297991
- 0.266092
- 0.238588
- 0.214748
- 0.193981
- 0.175808
- 0.159835
- 0.145741
- 0.133256
- 0.122157
- 0.112257
- 0.103399
- 0.095449
- 0.088294
- 0.081836
- 0.075993
- 0.070692
- 0.065875
- 0.061484
- 0.057476
- 0.053809
- 0.050447
- 0.047358
- 0.044518
- 0.041900
- 0.039483
- 0.0
- 0.0
thrust:
- 36.722155848902254
- 94.65678115354163
- 170.596391826316
- 267.74933496419163
- 387.64681352354114
- 533.9617151673435
- 707.4062402827329
- 909.9965782677073
- 1142.7197798534328
- 1407.4994184495558
- 1707.1272243371227
- 2047.3355806543098
- 2430.5778091805637
- 2858.3081150622215
- 3329.100627354195
- 3842.9755943182267
- 4403.86140594055
- 4999.993508066915
- 4999.99850473839
- 4999.997854617397
- 5000.00304890274
- 5000.002113339491
- 4999.997282778227
- 5000.002243172759
- 5000.000360590384
- 5000.009074693787
- 4999.987262704901
- 5000.007345811091
- 5000.006875165497
- 4999.994990648268
- 4999.97705933755
- 4999.983698972648
- 4999.991318085188
- 5000.024022703328
- 5000.016589748782
- 5000.025709581146
- 4999.944891236294
- 5000.035324880168
- 4999.967955734346
- 5000.013248451465
- 5000.063199891701
- 5000.068982245371
- 4999.9325188896555
- 5000.011035557985
- 5000.012771123277
- 4717.243379938609
- 0.0
- 0.0
thrust_coefficient:
- 0.0
- 0.0
- 0.0
Expand Down
106 changes: 53 additions & 53 deletions examples/inputs_floating/turbine_files/nrel_5MW_floating.yaml
Original file line number Diff line number Diff line change
@@ -1,67 +1,67 @@
turbine_type: 'nrel_5MW_floating'
generator_efficiency: 1.0
hub_height: 90.0
pP: 1.88
pT: 1.88
rotor_diameter: 126.0
TSR: 8.0
ref_density_cp_ct: 1.225
ref_tilt_cp_ct: 5.0
correct_cp_ct_for_tilt: True # Apply tilt correction to cp/ct
power_thrust_table:
ref_air_density: 1.225
ref_tilt: 5.0
pP: 1.88
pT: 1.88
power:
- 0.0
- 0.000000
- 0.000000
- 0.178085
- 0.289075
- 0.349022
- 0.384728
- 0.406059
- 0.420228
- 0.428823
- 0.433873
- 0.436223
- 0.436845
- 0.436575
- 0.436511
- 0.436561
- 0.436517
- 0.435903
- 0.434673
- 0.433230
- 0.430466
- 0.378869
- 0.335199
- 0.297991
- 0.266092
- 0.238588
- 0.214748
- 0.193981
- 0.175808
- 0.159835
- 0.145741
- 0.133256
- 0.122157
- 0.112257
- 0.103399
- 0.095449
- 0.088294
- 0.081836
- 0.075993
- 0.070692
- 0.065875
- 0.061484
- 0.057476
- 0.053809
- 0.050447
- 0.047358
- 0.044518
- 0.041900
- 0.039483
- 0.0
- 0.0
thrust:
- 36.722155848902254
- 94.65678115354163
- 170.596391826316
- 267.74933496419163
- 387.64681352354114
- 533.9617151673435
- 707.4062402827329
- 909.9965782677073
- 1142.7197798534328
- 1407.4994184495558
- 1707.1272243371227
- 2047.3355806543098
- 2430.5778091805637
- 2858.3081150622215
- 3329.100627354195
- 3842.9755943182267
- 4403.86140594055
- 4999.993508066915
- 4999.99850473839
- 4999.997854617397
- 5000.00304890274
- 5000.002113339491
- 4999.997282778227
- 5000.002243172759
- 5000.000360590384
- 5000.009074693787
- 4999.987262704901
- 5000.007345811091
- 5000.006875165497
- 4999.994990648268
- 4999.97705933755
- 4999.983698972648
- 4999.991318085188
- 5000.024022703328
- 5000.016589748782
- 5000.025709581146
- 4999.944891236294
- 5000.035324880168
- 4999.967955734346
- 5000.013248451465
- 5000.063199891701
- 5000.068982245371
- 4999.9325188896555
- 5000.011035557985
- 5000.012771123277
- 4717.243379938609
- 0.0
- 0.0
thrust_coefficient:
- 0.0
- 0.0
- 0.0
Expand Down
Loading