Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
59f3a60
Add coordinates from inertial frame to grid and add visualization cap…
Bartdoekemeijer Feb 15, 2023
996680e
Update unit test for utilities, bug fix
Bartdoekemeijer Feb 16, 2023
c101233
Merge branch 'develop' into feature/grid_in_inertial_frame
rafmudaf Mar 8, 2023
01ce5c2
Remove unused variables
rafmudaf Mar 15, 2023
a9b0c2c
Merge remote-tracking branch 'origin/develop' into HEAD
Bartdoekemeijer May 2, 2023
abf8030
Tiny bug fixes in visualization with inertial grid rotation functiona…
Bartdoekemeijer May 2, 2023
624ca2e
remove unnecessary calculations
bayc May 4, 2023
9ac6e21
remove hardcoded flag
bayc May 4, 2023
1a92904
reconfigure heterogeneous map input and usage
bayc May 4, 2023
e48237b
update heterogeneous calculation to use rotated intertial_frame coord…
bayc May 4, 2023
5760721
adding specific plotting method for heterogeneous flows
bayc May 4, 2023
702b42b
adding wd input to plot_turbines_with_fi to properly plot turbine yaw…
bayc May 4, 2023
fd34ee1
making rotating the wind turbines in plots relative to the wind direc…
bayc May 4, 2023
c746201
removing unnecessary parameters from grid class definition
bayc May 4, 2023
26312a8
refactored het map generation and added docstrings
bayc May 4, 2023
307d4e4
removing out_region calculation for het_map as a freestream fill valu…
bayc May 4, 2023
f257f42
updating uncertainty_interface to accept het_config
bayc May 4, 2023
63e8f30
updating heterogeneous examples to use new het_config
bayc May 4, 2023
ab9dbc0
formatting upates
bayc May 4, 2023
09b4aa1
updating parallel_computing_interface to use het_config
bayc May 4, 2023
0b461ff
updating documentation
bayc May 4, 2023
929838f
add separate levels parameter for contour plot for heteregeneous flows
bayc May 4, 2023
ec83fc5
fixing typo in het_config parameter
bayc May 4, 2023
cb36a34
store the center of rotation in the grid classes
bayc May 4, 2023
2d12896
add warning for users if interpolated points are calculated outside u…
bayc May 4, 2023
9dc8244
Merge remote-tracking branch 'origin/develop' into feature/grid_in_in…
bayc May 4, 2023
148f3db
moving het_config from FlorisInterface to FlowField
bayc May 5, 2023
b864678
moving some input checking to validators
bayc May 5, 2023
afb5b23
removing attempt at allowing for broadcasting of a single speed up ar…
bayc May 5, 2023
2323469
removing old het_config definitions
bayc May 5, 2023
8cfde45
updating the heterogeneous examples
bayc May 5, 2023
cbd1de5
removing one more outdated het_map reference
bayc May 5, 2023
c5e736e
updating doctrings and comments
bayc May 5, 2023
488a238
Merge remote-tracking branch 'origin/develop' into feature/grid_in_in…
bayc May 12, 2023
331853f
fixing naming of x and y center of rotations
bayc May 12, 2023
c406585
Merge branch 'develop' into pr/Bartdoekemeijer/578
rafmudaf May 12, 2023
ac54f09
Resolve merge conflicts and revert extra changes
rafmudaf May 12, 2023
fc47c2f
Add docstring
rafmudaf May 12, 2023
2f9ee1a
Reset example settings
rafmudaf May 16, 2023
cca4e62
Early return in error checking
rafmudaf May 16, 2023
e620bd6
Rename heterogeneous config dictionary
rafmudaf May 16, 2023
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
2 changes: 1 addition & 1 deletion examples/02_visualizations.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
y_plane = fi.calculate_y_plane(
x_resolution=200,
z_resolution=100,
crossstream_dist=630.0,
crossstream_dist=0.0,
yaw_angles=np.array([[[25.,0.,0.]]]),
)
cross_plane = fi.calculate_cross_plane(
Expand Down
2 changes: 1 addition & 1 deletion examples/03_making_adjustments.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
5.0 * fi.floris.farm.rotor_diameters[0][0][0] * np.arange(0, N, 1),
5.0 * fi.floris.farm.rotor_diameters[0][0][0] * np.arange(0, N, 1),
)
fi.reinitialize(layout_x=X.flatten(), layout_y=Y.flatten(), wind_directions=[360.0])
fi.reinitialize(layout_x=X.flatten(), layout_y=Y.flatten(), wind_directions=[270.0])
horizontal_plane = fi.calculate_horizontal_plane(height=90.0)
wakeviz.visualize_cut_plane(
horizontal_plane,
Expand Down
40 changes: 23 additions & 17 deletions examples/16_heterogeneous_inflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import matplotlib.pyplot as plt

from floris.tools import FlorisInterface
from floris.tools.floris_interface import generate_heterogeneous_wind_map
from floris.tools.visualization import visualize_cut_plane


Expand All @@ -37,19 +36,19 @@
"""


# Define the speed ups of the heterogeneous inflow, and their locations.
# For the 2-dimensional case, this requires x and y locations.
# The speed ups are multipliers of the ambient wind speed.
speed_ups = [[2.0, 2.0, 1.0, 1.0]]
x_locs = [-300.0, -300.0, 2600.0, 2600.0]
y_locs = [ -300.0, 300.0, -300.0, 300.0]
# Initialize FLORIS with the given input file via FlorisInterface.
# Note that the heterogeneous flow is defined in the input file. The heterogenous_inflow_config
# dictionary is defined as below. The speed ups are multipliers of the ambient wind speed,
# and the x and y are the locations of the speed ups.
#
# heterogenous_inflow_config = {
# 'speed_multipliers': [[2.0, 1.0, 2.0, 1.0]],
# 'x': [-300.0, -300.0, 2600.0, 2600.0],
# 'y': [ -300.0, 300.0, -300.0, 300.0],
# }

# Generate the linear interpolation to be used for the heterogeneous inflow.
het_map_2d = generate_heterogeneous_wind_map(speed_ups, x_locs, y_locs)

# Initialize FLORIS with the given input file via FlorisInterface.
# Also, pass the heterogeneous map into the FlorisInterface.
fi_2d = FlorisInterface("inputs/gch.yaml", het_map=het_map_2d)
fi_2d = FlorisInterface("inputs/gch_heterogeneous_inflow.yaml")

# Set shear to 0.0 to highlight the heterogeneous inflow
fi_2d.reinitialize(wind_shear=0.0)
Expand Down Expand Up @@ -90,17 +89,24 @@
# Define the speed ups of the heterogeneous inflow, and their locations.
# For the 3-dimensional case, this requires x, y, and z locations.
# The speed ups are multipliers of the ambient wind speed.
speed_ups = [[1.0, 1.0, 2.0, 2.0, 1.0, 1.0, 2.0, 2.0]]
speed_multipliers = [[1.0, 1.0, 2.0, 2.0, 1.0, 1.0, 2.0, 2.0]]
x_locs = [-300.0, -300.0, -300.0, -300.0, 2600.0, 2600.0, 2600.0, 2600.0]
y_locs = [-300.0, 300.0, -300.0, 300.0, -300.0, 300.0, -300.0, 300.0]
z_locs = [540.0, 540.0, 0.0, 0.0, 540.0, 540.0, 0.0, 0.0]

# Generate the linear interpolation to be used for the heterogeneous inflow.
het_map_3d = generate_heterogeneous_wind_map(speed_ups, x_locs, y_locs, z_locs)
# Create the configuration dictionary to be used for the heterogeneous inflow.
heterogenous_inflow_config = {
'speed_multipliers': speed_multipliers,
'x': x_locs,
'y': y_locs,
'z': z_locs,
}

# Initialize FLORIS with the given input file via FlorisInterface.
# Also, pass the heterogeneous map into the FlorisInterface.
fi_3d = FlorisInterface("inputs/gch.yaml", het_map=het_map_3d)
# Note that we initialize FLORIS with a homogenous flow input file, but
# then configure the heterogeneous inflow via the reinitialize method.
fi_3d = FlorisInterface("inputs/gch.yaml")
fi_3d.reinitialize(heterogenous_inflow_config=heterogenous_inflow_config)

# Set shear to 0.0 to highlight the heterogeneous inflow
fi_3d.reinitialize(wind_shear=0.0)
Expand Down
28 changes: 16 additions & 12 deletions examples/16b_heterogenaity_multiple_ws_wd.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
import numpy as np

from floris.tools import FlorisInterface
from floris.tools.floris_interface import generate_heterogeneous_wind_map
from floris.tools.visualization import visualize_cut_plane


Expand All @@ -34,27 +33,24 @@
x_locs = [-300.0, -300.0, 2600.0, 2600.0]
y_locs = [ -300.0, 300.0, -300.0, 300.0]

# Generate the linear interpolation to be used for the heterogeneous inflow.
het_map_2d = generate_heterogeneous_wind_map(speed_ups, x_locs, y_locs)

# Initialize FLORIS with the given input file via FlorisInterface.
# Also, pass the heterogeneous map into the FlorisInterface.
fi = FlorisInterface("inputs/gch.yaml", het_map=het_map_2d)
# Note the heterogeneous inflow is defined in the input file.
fi = FlorisInterface("inputs/gch_heterogeneous_inflow.yaml")

# Set shear to 0.0 to highlight the heterogeneous inflow
fi.reinitialize(
wind_shear=0.0,
wind_speeds=[8.0],
wind_directions=[270.],
layout_x=[0,0],
layout_y=[-300, 300],
layout_x=[0, 0],
layout_y=[-299., 299.],
)
fi.calculate_wake()
turbine_powers = fi.get_turbine_powers().flatten() / 1000.

# Show the initial results
print('------------------------------------------')
print('Given the speedsups and turbine locations, ')
print('Given the speedups and turbine locations, ')
print(' the first turbine has an inflow wind speed')
print(' twice that of the second')
print(' Wind Speed = 8., Wind Direction = 270.')
Expand All @@ -74,9 +70,17 @@

# To change the number of wind directions however it is necessary to make a matching
# change to the dimensions of the het map
speed_ups = [[2.0, 1.0, 2.0, 1.0], [2.0, 1.0, 2.0, 1.0] ] # Expand to two wind directions
het_map_2d = generate_heterogeneous_wind_map(speed_ups, x_locs, y_locs)
fi.reinitialize(wind_directions=[270., 275.], wind_speeds=[8.], het_map=het_map_2d)
speed_multipliers = [[2.0, 1.0, 2.0, 1.0], [2.0, 1.0, 2.0, 1.0]] # Expand to two wind directions
heterogenous_inflow_config = {
'speed_multipliers': speed_multipliers,
'x': x_locs,
'y': y_locs,
}
fi.reinitialize(
wind_directions=[270.0, 275.0],
wind_speeds=[8.0],
heterogenous_inflow_config=heterogenous_inflow_config
)
fi.calculate_wake()
turbine_powers = np.round(fi.get_turbine_powers() / 1000.)
print('With wind directions now set to 270 and 275 deg')
Expand Down
102 changes: 102 additions & 0 deletions examples/inputs/gch_heterogeneous_inflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
name: GCH
description: Three turbines using Gauss Curl Hybrid model
floris_version: v3.0.0

logging:
console:
enable: true
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
heterogenous_inflow_config:
speed_multipliers:
- - 2.0
- 1.0
- 2.0
- 1.0
x:
- -300.
- -300.
- 2600.
- 2600.
y:
- -300.
- 300.
- -300.
- 300.
reference_wind_height: -1
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: sosfs
deflection_model: gauss
turbulence_model: crespo_hernandez
velocity_model: gauss
enable_secondary_steering: true
enable_yaw_added_recovery: true
enable_transverse_velocities: true

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

wake_turbulence_parameters:
crespo_hernandez:
initial: 0.1
constant: 0.5
ai: 0.8
downstream: -0.32
Loading