-
Hi, I am investigating the wake losses on an offshore wind farm. I am not seeing a significant effect of reduction in wind speeds (8m/s and 14m/s) through the farm due to wakes so I think something must be wrong with my code. Files Results Any help with my university project would be most appreciated. Scriptimport matplotlib.pyplot as plt
import numpy as np
import floris.tools.visualization as wakeviz
from floris.tools import FlorisInterface
# Load FLORIS with the given input file
fi = FlorisInterface("inputs/gchNH.yaml")
# Define the range of the plot based on the furthest turbines
x_min, x_max = 0, max(fi.floris.farm.layout_x) + 1500 # 500 for some padding
y_min, y_max = min(fi.floris.farm.layout_y) - 500, max(fi.floris.farm.layout_y) + 500 # 500 and 500 for padding
# # # # # # # # # # # # # # # # # # # # # # NW (Northwest) = 315°# # # # # # # # # # # # # # # # # # # # # # # # # #
# Define the wind direction
wind_directions = 285 # This variable should hold the current wind direction
# Reinitialize FLORIS with specified wind speeds and directions
fi.reinitialize(wind_speeds=[14.0], wind_directions=[wind_directions])
# Run the wake calculation to get the turbine-turbine interfactions
# on the turbine grids
fi.calculate_wake()
horizontal_plane = fi.calculate_horizontal_plane(height=67.0)
# Plot horizontal slice
mappable = wakeviz.visualize_cut_plane(
horizontal_plane,
title= f"Wind direction at {wind_directions}°",
colormap_label="Velocity [m/s]" # This labels the color bar
)
# Create figure for visualization
fig, ax = plt.subplots(figsize=(12, 8))
# Plot turbine locations and label them
for idx, (x, y) in enumerate(zip(fi.floris.farm.layout_x, fi.floris.farm.layout_y)):
ax.plot(x, y, 'ro') # Mark turbine location with a red circle
average_velocity = fi.turbine_average_velocities[0][0][idx] # Accessing the first wd and ws, modify indices as needed
label = f"T{idx+1}: {average_velocity:.2f} m/s" # Creating label string with turbine index and average velocity
ax.text(x, y, label, fontsize=9, verticalalignment='bottom') # Display label
# Collect the wind speed at all the turbine points
u_points = fi.floris.flow_field.u
print('U points is 1 wd x 1 ws x 30 turbines x 3 x 3 points (turbine_grid_points=3)')
print(u_points.shape)
print('turbine_average_velocities is 1 wd x 1 ws x 4 turbines')
print(fi.turbine_average_velocities)
# Show the plot
plt.show() V80 turbine file###
# An ID for this type of turbine definition.
# This is not currently used, but it will be enabled in the future. This should typically
# match the root name of the file.
turbine_type: 'v80'
###
# Setting for generator losses to power.
generator_efficiency: 1.0
###
# Hub height.
hub_height: 67.0
###
# Cosine exponent for power loss due to yaw misalignment.
pP: 1.88
###
# Cosine exponent for power loss due to tilt.
pT: 1.88
###
# Rotor diameter.
rotor_diameter: 80.0
###
# Tip speed ratio defined as linear blade tip speed normalized by the incoming wind speed.
TSR: 8.0
###
# The air density at which the Cp and Ct curves are defined.
ref_density_cp_ct: 1.225
###
# The tilt angle at which the Cp and Ct curves are defined. This is used to capture
# the effects of a floating platform on a turbine's power and wake.
ref_tilt_cp_ct: 5.0
###
# Cp and Ct as a function of wind speed for the turbine's full range of operating conditions.
power_thrust_table:
power:
- 91.31763333333333
- 198.86743333333334
- 349.4666666666667
- 559.8000000000001
- 840.3666666666667
- 1201.2333333333333
- 1603.3666666666668
- 1971.3333333333333
- 2000.0
- 2000.0
- 2000.0
- 2000.0
- 2000.0
- 2000.0
- 2000.0
- 2000.0
- 2000.0
- 2000.0
- 2000.0
- 2000.0
- 2000.0
- 2000.0
thrust:
- 0.9067
- 0.7802
- 0.7608
- 0.7628
- 0.7644
- 0.7656
- 0.7083
- 0.615
- 0.4555
- 0.3469
- 0.2736
- 0.221
- 0.1817
- 0.1516
- 0.128
- 0.1093
- 0.0941
- 0.0818
- 0.0715
- 0.063
- 0.0558
- 0.0497
wind_speed:
- 4.0
- 5.0
- 6.0
- 7.0
- 8.0
- 9.0
- 10.0
- 11.0
- 12.0
- 13.0
- 14.0
- 15.0
- 16.0
- 17.0
- 18.0
- 19.0
- 20.0
- 21.0
- 22.0
- 23.0
- 24.0
- 25.0 Main input file###
# A name for this input file.
# This is not currently only for the user's reference.
name: GCH
###
# A description of the contents of this input file.
# This is not currently only for the user's reference.
description: Turbines using Gauss Curl Hybrid model
###
# The earliest verion of FLORIS this input file supports.
# This is not currently only for the user's reference.
floris_version: v3.0.0
###
# Configure the logging level and where to show the logs.
logging:
###
# Settings for logging to the console (i.e. terminal).
console:
###
# Can be "true" or "false".
enable: true
###
# Set the severity to show output. Messages at this level or higher will be shown.
# Can be one of "CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG".
level: WARNING
###
# Settings for logging to a file.
file:
###
# Can be "true" or "false".
enable: false
###
# Set the severity to show output. Messages at this level or higher will be shown.
# Can be one of "CRITICAL", "ERROR", "WARNING", "INFO", "DEBUG".
level: WARNING
###
# Configure the solver for the type of simulation.
solver:
###
# Select the solver type.
# Can be one of: "turbine_grid", "flow_field_grid", "flow_field_planar_grid".
type: turbine_grid
###
# Options for the turbine type selected above. See the solver documentation for available parameters.
turbine_grid_points: 3
###
# Configure the turbine types and their placement within the wind farm.
farm:
###
# Coordinates for the turbine locations in the x-direction which is typically considered
# to be the streamwise direction (left, right) when the wind is out of the west.
# The order of the coordinates here corresponds to the index of the turbine in the primary
# data structures.
layout_x:
- 317.7824265929521
- 1103.18667607737
- 1888.5520026574377
- 2674.962747190031
- 3460.2260713068536
- 252.4598952542874
- 1037.8215392508428
- 1823.1204505661153
- 2609.4878939732444
- 3394.6854138592607
- 186.03945938538527
- 972.4663229507278
- 1758.8181030088454
- 2544.0116254184977
- 3329.165641456784
- 120.74902512412518
- 907.0970845915144
- 1692.2869405192323
- 2478.5452197626
- 3264.7412305365433
- 54.336290973762516
- 840.6420815644669
- 1626.8966758031165
- 2411.9811716304393
- 3198.078289743513
- 9.826735490991268
- 776.4121015861165
- 1560.3971510016127
- 2346.5459862120333
- 3132.6324965347303
###
# Coordinates for the turbine locations in the y-direction which is typically considered
# to be the spanwise direction (up, down) when the wind is out of the west.
# The order of the coordinates here corresponds to the index of the turbine in the primary
# data structures.
layout_y:
- 468.8706691758707
- 617.6689337501302
- 768.4512334009632
- 917.5025421343744
- 1068.5447984272614
- 812.3315154341981
- 962.9729835977778
- 1111.8902017148212
- 1262.7846934497356
- 1411.9618580080569
- 1155.8007923811674
- 1308.2781469989568
- 1457.1774730635807
- 1606.2138152634725
- 1757.234177481383
- 1501.1180176585913
- 1649.87613809295
- 1798.771475858055
- 1949.6440502665937
- 2098.7927176989615
- 1842.7354216733947
- 1993.3365501929075
- 2144.0679265167564
- 2293.082198979333
- 2434.8031302578747
- 2188.047519170679
- 2336.7837388152257
- 2487.5183449340984
- 2638.3688228111714
- 2787.4953842796385
###
# Listing of turbine types for placement at the x and y coordinates given above.
# The list length must be 1 or the same as ``layout_x`` and ``layout_y``. If it is a
# single value, all turbines are of the same type. Otherwise, the turbine type
# is mapped to the location at the same index in ``layout_x`` and ``layout_y``.
# The types can be either a name included in the turbine_library or
# a full definition of a wind turbine directly.
turbine_type:
- v80
turbine_library_path: "inputs/"
###
# Configure the atmospheric conditions.
flow_field:
###
# Air density.
air_density: 1.225
###
# The height to consider the "center" of the vertical wind speed profile
# due to shear. With a shear exponent not 1, the wind speed at this height
# will be the value given in ``wind_speeds``. Above and below this height,
# the wind speed will change according to the shear profile; see
# :py:meth:`.FlowField.initialize_velocity_field`.
# For farms consisting of one wind turbine type, use ``reference_wind_height: -1``
# to use the hub height of the wind turbine definition. For multiple wind turbine
# types, the reference wind height must be given explicitly.
reference_wind_height: -1
###
# The level of turbulence intensity level in the wind.
turbulence_intensity: 0.06
###
# The wind directions to include in the simulation.
# 0 is north and 270 is west.
wind_directions:
- 0
###
# The exponent used to model the wind shear profile; see
# :py:meth:`.FlowField.initialize_velocity_field`.
wind_shear: 0.12
###
# The wind speeds to include in the simulation.
wind_speeds:
- 6
###
# The wind veer as a constant value for all points in the grid.
wind_veer: 0.0
###
# The conditions that are specified for use with the multi-dimensional Cp/Ct capbility.
# These conditions are external to FLORIS and specified by the user. They are used internally
# through a nearest-neighbor selection process to choose the correct Cp/Ct interpolants
# to use. These conditions are only used with the ``multidim_cp_ct`` velocity deficit model.
# multidim_conditions:(I REMOVED)
# Tp: 2.5
# Hs: 3.01
###
# Configure the wake model.
wake:
###
# Select the models to use for the simulation.
# See :py:mod:`~.wake` for a list
# of available models and their descriptions.
model_strings:
###
# Select the wake combination model.
combination_model: sosfs
###
# Select the wake deflection model.
deflection_model: gauss
###
# Select the wake turbulence model.
turbulence_model: crespo_hernandez
###
# Select the wake velocity deficit model.
velocity_model: gauss
###
# Can be "true" or "false".
enable_secondary_steering: true
###
# Can be "true" or "false".
enable_yaw_added_recovery: true
###
# Can be "true" or "false".
enable_transverse_velocities: true
###
# Configure the parameters for the wake deflection model
# selected above.
# Additional blocks can be provided for
# models that are not enabled, but the enabled model
# must have a corresponding parameter block.
wake_deflection_parameters:
gauss:
ad: 0.0
alpha: 0.58
bd: 0.0
beta: 0.077
dm: 1.0
ka: 0.38
kb: 0.004
jimenez:
ad: 0.0
bd: 0.0
kd: 0.05
###
# Configure the parameters for the wake velocity deficit model
# selected above.
# Additional blocks can be provided for
# models that are not enabled, but the enabled model
# must have a corresponding parameter block.
wake_velocity_parameters:
cc:
a_s: 0.179367259
b_s: 0.0118889215
c_s1: 0.0563691592
c_s2: 0.13290157
a_f: 3.11
b_f: -0.68
c_f: 2.41
alpha_mod: 1.0
gauss:
alpha: 0.58
beta: 0.077
ka: 0.38
kb: 0.004
jensen:
we: 0.05
###
# Configure the parameters for the wake turbulence model
# selected above.
# Additional blocks can be provided for
# models that are not enabled, but the enabled model
# must have a corresponding parameter block.
wake_turbulence_parameters:
crespo_hernandez:
initial: 0.1
constant: 0.5
ai: 0.8
downstream: -0.32 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 8 replies
-
Hi @Nellytado I'll try to help, but I need the input files to run your script. Please attach it to your original post. |
Beta Was this translation helpful? Give feedback.
-
@Nellytado I've spent some time looking at your configuration and I have follow up questions:
I made the following script to inspect your inputs. This plots a 1d profile of the velocity through the hub height of a two-turbine array at wind speeds varying from 5 to 25 m/s. Additionally, it plots the power and Ct curves that you've configured in the v80 input file. import matplotlib.pyplot as plt
import numpy as np
from floris.tools import FlorisInterface
from floris.turbine_library import TurbineInterface
fi = FlorisInterface("inputs/gch.yaml")
D = 80.0
layout_x = np.array([0, D*6])
layout_y = np.array([0, 0])
wind_speeds = np.arange(5, 25, 2.0)
fi.reinitialize(layout_x=layout_x, layout_y=layout_y, wind_directions=[270.0], wind_speeds=wind_speeds)
sample_points_x = np.arange(0, 20*D, 50)
sample_points_y = np.zeros_like(sample_points_x)
sample_points_z = 67 * np.ones_like(sample_points_x)
u_at_points = fi.sample_flow_at_points(sample_points_x, sample_points_y, sample_points_z)
fig, ax = plt.subplots(1,2)
fig.set_size_inches(10,4)
ax[0].plot(np.resize(layout_x, (2,2)), np.array([[-D/2.0, D/2.0], [-D/2.0, D/2.0]]).T, color="black", label="Turbine")
ax[0].scatter(sample_points_x, sample_points_y, color="red", marker=".", label="Sample Points")
ax[0].set_xlabel("x [m]")
ax[0].set_ylabel("y [m]")
ax[0].grid()
ax[0].legend()
# Plot the velocities
for i, wind_speed in enumerate(wind_speeds):
ax[1].plot(sample_points_x, u_at_points[0, i].flatten(), label=f'{wind_speed} m/s')
ax[1].set_xlabel('x [m]')
ax[1].set_ylabel('Wind Speed (m/s)')
ax[1].grid()
ax[1].legend()
fig.tight_layout()
ti = TurbineInterface.from_library("inputs/", "v80.yaml")
ti.plot_power_curve()
ti.plot_Ct_curve()
plt.show() |
Beta Was this translation helpful? Give feedback.
Hi @Nellytado , how are you defining "fewer wakes"? If you mean that the normalized wake deficit (e.g., the velocity reduction in the wake divided by the free stream velocity) is smaller at 14m/s than at 8m/s, and even smaller at 17m/s, that is expected---at 14m/s and 17m/s, the NREL 5MW (along with most other wind turbines) are above their rated wind speed, so they are pitching their blades and reducing the thrust force on the flow, leading to shallower wakes.
Here is a plot of the thrust coefficients for each of the wind turbines provided in FLORIS. As you can see, the thrust coefficient (Ct) is much lower at 14m/s and 17m/s than at 8m/s.
Is it possible that the reduction in thrust coe…