-
Notifications
You must be signed in to change notification settings - Fork 156
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add example of optimizing with disabled turbines.
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
examples/examples_control_optimization/008_optimize_yaw_with_disabled_turbines.py
This file contains 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,33 @@ | ||
"""Example: Optimizing yaw angles with disabled turbines | ||
This example demonstrates how to optimize yaw angles in FLORIS, when some turbines are disabled. | ||
The example optimization is run using both YawOptimizerSR and YawOptimizerGeometric, the two | ||
yaw optimizers that support disabling turbines. | ||
""" | ||
|
||
import numpy as np | ||
|
||
from floris import FlorisModel | ||
from floris.optimization.yaw_optimization.yaw_optimizer_geometric import YawOptimizationGeometric | ||
from floris.optimization.yaw_optimization.yaw_optimizer_sr import YawOptimizationSR | ||
|
||
# Load a 3-turbine model | ||
fmodel = FlorisModel("../inputs/gch.yaml") | ||
|
||
# Set wind conditions to be the same for two cases | ||
fmodel.set(wind_directions=[270.]*2, wind_speeds=[8.]*2, turbulence_intensities=[.06]*2) | ||
|
||
# Disable turbines (different pattern for each of the two cases) | ||
# First case: disable the middle turbine | ||
# Second case: disable the front turbine | ||
fmodel.set_operation_model('mixed') | ||
fmodel.set(disable_turbines=np.array([[False, True, False], [True, False, False]])) | ||
|
||
# Run optimizations and print results | ||
yaw_opt = YawOptimizationSR(fmodel) | ||
df_opt = yaw_opt.optimize() | ||
print("Serial Refine optimized yaw angles [deg]:\n", df_opt.yaw_angles_opt) | ||
|
||
yaw_opt = YawOptimizationGeometric(fmodel) | ||
df_opt = yaw_opt.optimize() | ||
print("\nGeometric optimized yaw angles [deg]:\n", df_opt.yaw_angles_opt) |