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

Adding the TurbOPark wake velocity deficit model #396

Merged
merged 10 commits into from
Mar 31, 2022
9 changes: 5 additions & 4 deletions examples/16_streamlit_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@

# Parameters
D = 126. # Assume for convenience
floris_model_list = ['jensen','gch','cc']
floris_model_list = ['jensen','gch','cc','turbopark']
color_dict = {
'jensen':'k',
'gch':'b',
'cc':'r'
'cc':'r',
'turbopark':'c'
}

# Streamlit inputs
Expand All @@ -61,7 +62,7 @@
floris_models = st.sidebar.multiselect("FLORIS Models", floris_model_list, floris_model_list)
# floris_models_viz = st.sidebar.multiselect("FLORIS Models for Visualization", floris_model_list, floris_model_list)
desc_yaw = st.sidebar.checkbox("Descending yaw pattern?",value=False)
front_turbine_yaw = st.sidebar.slider("Upstream yaw angle", -30., 30., 20., step=0.5)
front_turbine_yaw = st.sidebar.slider("Upstream yaw angle", -30., 30., 0., step=0.5)

# Define the layout
X = []
Expand Down Expand Up @@ -92,6 +93,7 @@

# Determine which models to plot given cant plot cc right now
floris_models_viz = [m for m in floris_models if not 'cc' in m]
floris_models_viz = [m for m in floris_models_viz if not 'turbo' in m]
num_models_to_viz = len(floris_models_viz)

# Set up the visualization plot
Expand All @@ -113,7 +115,6 @@
# Set the layout, wind direction and wind speed
fi.reinitialize( layout=( X, Y ), wind_speeds=[wind_speed], wind_directions=[wind_direction], turbulence_intensity=turbulence_intensity )


fi.calculate_wake(yaw_angles=yaw_angles_base)
turbine_powers = fi.get_turbine_powers() / 1000.
ax_turb_pow.plot(turbine_labels,turbine_powers.flatten(),color=color_dict[fm],ls='-',marker='s',label='%s - baseline' % fm)
Expand Down
92 changes: 92 additions & 0 deletions examples/inputs/turbopark.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@

name: TurbOPark
description: Three turbines using TurbOPark model
floris_version: v3.0.0

logging:
console:
enable: false
level: WARNING
file:
enable: false
level: WARNING

solver:
type: turbine_grid
turbine_grid_points: 1

farm:
layout_x:
- 0.0
- 630.0
- 1260.0
layout_y:
- 0.0
- 0.0
- 0.0
turbine_type:
- nrel_5MW

flow_field:
air_density: 1.225
reference_wind_height: 90.0
turbulence_intensity: 0.06
wind_directions:
- 270.0
wind_shear: 0.12
wind_speeds:
- 8.0
wind_veer: 0.0

wake:
model_strings:
combination_model: fls
deflection_model: gauss
turbulence_model: crespo_hernandez
velocity_model: turbopark

enable_secondary_steering: false
enable_yaw_added_recovery: false
enable_transverse_velocities: false

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

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
turbopark:
A: 0.04
sigma_max_rel: 4.0

wake_turbulence_parameters:
crespo_hernandez:
initial: 0.1
constant: 0.5
ai: 0.8
downstream: -0.32
2 changes: 1 addition & 1 deletion floris/simulation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
from .grid import Grid, TurbineGrid, FlowFieldGrid, FlowFieldPlanarGrid
from .flow_field import FlowField
from .wake import WakeModelManager
from .solver import sequential_solver, full_flow_sequential_solver, cc_solver, full_flow_cc_solver
from .solver import sequential_solver, full_flow_sequential_solver, cc_solver, full_flow_cc_solver, turbopark_solver, full_flow_turbopark_solver
from .floris import Floris


Expand Down
13 changes: 12 additions & 1 deletion floris/simulation/floris.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@
FlowFieldPlanarGrid,
sequential_solver,
cc_solver,
turbopark_solver,
full_flow_sequential_solver,
full_flow_cc_solver
full_flow_cc_solver,
full_flow_turbopark_solver,
)
from attrs import define, field

Expand Down Expand Up @@ -151,6 +153,13 @@ def steady_state_atmospheric_condition(self):
self.grid,
self.wake
)
elif vel_model=="turbopark":
elapsed_time = turbopark_solver(
self.farm,
self.flow_field,
self.grid,
self.wake
)
else:
elapsed_time = sequential_solver(
self.farm,
Expand Down Expand Up @@ -179,6 +188,8 @@ def solve_for_viz(self):

if vel_model=="cc":
full_flow_cc_solver(self.farm, self.flow_field, self.grid, self.wake)
elif vel_model=="turbopark":
full_flow_turbopark_solver(self.farm, self.flow_field, self.grid, self.wake)
else:
full_flow_sequential_solver(self.farm, self.flow_field, self.grid, self.wake)

Expand Down
22 changes: 14 additions & 8 deletions floris/simulation/grid.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,14 +199,20 @@ def set_grid(self) -> None:
),
dtype=floris_float_type
)
# Calculate the radial distance from the center of the turbine rotor
disc_grid = np.linspace(
-1 * disc_area_radius,
disc_area_radius,
self.grid_resolution,
dtype=floris_float_type,
axis=1
)
# Calculate the radial distance from the center of the turbine rotor.
# If a grid resolution of 1 is selected, create a disc_grid of zeros, as
# np.linspace would just return the starting value of -1 * disc_area_radius
# which would place the point below the center of the rotor.
if self.grid_resolution == 1:
rafmudaf marked this conversation as resolved.
Show resolved Hide resolved
disc_grid = np.zeros((np.shape(disc_area_radius)[0], 1 ))
else:
disc_grid = np.linspace(
-1 * disc_area_radius,
disc_area_radius,
self.grid_resolution,
dtype=floris_float_type,
axis=1
)
# Construct the turbine grids
# Here, they are already rotated to the correct orientation for each wind direction
_x = x[:, :, :, None, None] * template_grid
Expand Down
Loading