Multi Turbine using Coordinates and Modifying rotor diameter #718
-
I'm planning to conduct a Wake Steering experiment by modeling 13 wind turbines using actual coordinates, and I'm looking for a way to apply these coordinates to an existing optimization code. Additionally, I'd like to know how to adjust the rotor diameter in the gch.yml file. When I did this in MATLAB, I used coordinate sampling for the model_type, rotor diameter, and layout_x, y variables. However, I'm unsure how to do this in Python. Please help!" import matplotlib.pyplot as plt
import numpy as np
from floris.tools import FlorisInterface
from floris.tools.layout_functions import visualize_layout
from floris.tools.optimization.yaw_optimization.yaw_optimizer_sr import YawOptimizationSR
import floris.tools.visualization as wakeviz
# Declare a FLORIS interface
fi = FlorisInterface("examples\inputs\gch.yaml")
# d = 40.0
#rotor_diameter = 1.0
fi.reinitialize(layout_x=[882.51,883.71,884.82,886.34,888.48,888.07,886.76,885.32,887.92,889.53,890.96,892.56,890.73],
layout_y=[1758.3,1755.87,1753.26,1751.23,1752.14,1755.57,1758.35,1760.55,1761.95,1759.4,1757.21,1754.7,1753.35],
wind_directions=[270.0],
wind_speeds=[7.4])
fi.calculate_wake()
# Give turbines specific names
turbine_names = ['T01', 'T02','T03','T04','T05', 'T06','T07', 'T08','T09','T10','T11', 'T12','T13']
# Plot the flow
fig, ax = plt.subplots(figsize=(8,8))
horizontal_plane = fi.calculate_horizontal_plane(
x_resolution=1750,
y_resolution=890,
height=90.0
)
wakeviz.visualize_cut_plane(horizontal_plane, ax=ax, title="Horizontal")
# Plot the turnine names
visualize_layout(
fi,
ax=ax,
show_wake_lines=False,
turbine_names=turbine_names
)
plt.show()
yaw_opt = YawOptimizationSR(fi, verify_convergence=True)
df_opt = yaw_opt.optimize()
print("Optimization results:")
print(df_opt)
for t in range(13):
df_opt['t%d' % t] = df_opt.yaw_angles_opt.apply(lambda x: x[t])
fig, axarr = plt.subplots(
nrows=4,
ncols=4,
sharex=True,
sharey=True,
figsize=(10, 8)
)
jj = 0
for ii, ws in enumerate(fi.floris.flow_field.wind_speeds):
xi = np.remainder(ii,13)
if ((ii > 0) & (xi == 0)):
jj += 1
ax = axarr[np.remainder(ii, 13)][jj]
ids = (df_opt.wind_speed == ws)
wd = df_opt.loc[ids, "wind_direction"]
for t in range(13):
yaw_opt = df_opt.loc[ids, "t{:d}".format(t)]
ax.plot(wd, yaw_opt, label='Turbine {:d}'.format(t))
ax.set_title("Wind speed = {:.1f} m/s".format(ws), size=10)
if ((ii == 0) & (jj == 0)):
ax.legend()
ax.grid(True)
if jj == 0:
ax.set_ylabel('Yaw angle (deg)', size=10)
if xi == 3:
axarr[xi][jj].set_xlabel('Wind Direction (deg)', size=10)
plt.tight_layout()
fig, axarr = plt.subplots(
nrows=5,
ncols=4,
sharex=True,
sharey=True,
figsize=(10, 8)
)
jj = 0
for ii, ws in enumerate(fi.floris.flow_field.wind_speeds):
xi = np.remainder(ii, 5)
if ((ii > 0) & (xi == 0)):
jj += 1
ax = axarr[np.remainder(ii, 5)][jj]
ids = (df_opt.wind_speed == ws)
wd = df_opt.loc[ids, "wind_direction"]
power_baseline = df_opt.loc[ids, "farm_power_baseline"]
power_opt = df_opt.loc[ids, "farm_power_opt"]
ax.plot(wd, power_baseline / 1e6, color='k', label='Baseline')
ax.plot(wd, power_opt / 1e6, color='r', label='Optimized')
ax.set_title("Wind speed = {:.1f} m/s".format(ws), size=10)
ax.set_ylim([0.0, 16.0])
if ((ii == 0) & (jj == 0)):
ax.legend()
ax.grid(True)
if jj == 0:
ax.set_ylabel('Farm Power (MW)', size=10)
if xi == 3:
axarr[xi][jj].set_xlabel('Wind Direction (deg)', size=10)
plt.tight_layout()
plt.show() At the point is.. Modeling 13 turbines using coordinates and optimization using for wake steering and check the power efficiency... |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
hi @donghyeoncheon , thank you for your question! To your question on, the rotor diameter is specified in the turbine model file. Since you are using the gch.yaml input file you can see it specifies the nrel_5mw turbine model, which is located: On your next question I was wondering if adapting on of the existing optimization examples would work for you, say examples/14_compare_yaw_optimizers.py? Paul |
Beta Was this translation helpful? Give feedback.
-
@donghyeoncheon Can you describe how you expect the layout of your farm to look? You could plot your coordinates ( |
Beta Was this translation helpful? Give feedback.
@donghyeoncheon You can scale the inputs in FLORIS similar to what you did in Matlab:
However, I'm wondering how you got these coordinates. Did you manually convert from lat / long to another form? If not, please describe how you got the x and y values.