Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
259 changes: 259 additions & 0 deletions floris/Gaussian_wake_visualization.ipynb

Large diffs are not rendered by default.

135 changes: 135 additions & 0 deletions floris/V27_v3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"type": "floris_input",
"name": "V27_v3",
"description": "V27 model based on OpenFAST-simulated model (v3) performance",
"farm": {
"type": "farm",
"name": "SWiFT",
"description": "nearly-neutral conditions",
"properties": {
"wind_speed": 8.7,
"wind_direction": 270.0,
"turbulence_intensity": 0.107,
"wind_shear": 0.14,
"wind_veer": 0.0,
"air_density": 1.225,
"layout_x": [
0.0
],
"layout_y": [
0.0
]
}
},
"turbine": {
"type": "turbine",
"name": "V27",
"description": "Vestas V27",
"properties": {
"rotor_diameter": 27.0,
"hub_height": 32.1,
"blade_count": 3,
"pP": 1.88,
"pT": 1.88,
"generator_efficiency": 0.96349,
"power_thrust_table": {
"power": [
0.4896,
0.4894,
0.4892,
0.4892,
0.4890,
0.4886,
0.4784,
0.4569,
0.4285
],
"thrust": [
0.8192,
0.8189,
0.8189,
0.8188,
0.8184,
0.8098,
0.7519,
0.6909,
0.6292
],
"wind_speed": [
3.0000,
4.0000,
5.0000,
6.0000,
7.0000,
8.0000,
9.0000,
10.0000,
11.0000
]
},
"blade_pitch": 0.0,
"yaw_angle": 0.0,
"tilt_angle": 0.0,
"TSR": 8.0
}
},
"wake": {
"type": "wake",
"name": "wake_default",
"description": "wake",
"properties": {
"velocity_model": "gauss",
"deflection_model": "gauss",
"combination_model": "sosfs",
"parameters": {
"turbulence_intensity": {
"initial": 0.1,
"constant": 0.73,
"ai": 0.8,
"downstream": -0.275
},
"jensen": {
"we": 0.05
},
"multizone": {
"me": [
-0.5,
0.3,
1.0
],
"we": 0.05,
"aU": 12.0,
"bU": 1.3,
"mU": [
0.5,
1.0,
5.5
]
},
"gauss": {
"ka": 0.3,
"kb": 0.004,
"alpha": 0.58,
"beta": 0.077,
"ad": 0.0,
"bd": 0.0
},
"jimenez": {
"kd": 0.05,
"ad": 0.0,
"bd": 0.0
},
"curl": {
"model_grid_resolution": [
250,
100,
75
],
"initial_deficit": 2.0,
"dissipation": 0.06,
"veer_linear": 0.0
}
}
}
}
}
339 changes: 339 additions & 0 deletions floris/extract_Gaussian_wake_profiles.ipynb

Large diffs are not rendered by default.

91 changes: 91 additions & 0 deletions floris/florishelpers.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
import numpy as np
from copy import deepcopy
from floris.simulation import Floris
from floris.utilities import Vec3

class MyFlorisInterface(object):

def __init__(self,inputfile,D=27.0,zhub=32.1,sampling_resolution=1.0):
self.D = D
self.zhub = zhub
self.ds = sampling_resolution
self.flor = Floris(inputfile)

def update_flow(self,**kwargs):
self.flor.farm.flow_field.reinitialize_flow_field(**kwargs)
self.flor.farm.flow_field.calculate_wake()

def get_Cp_Ct(self):
turbine = self.flor.farm.turbine_map.turbines[0]
return turbine.Cp, turbine.Ct

def get_power_thrust(self):
turbine = self.flor.farm.turbine_map.turbines[0]

# Compute the yaw effective velocity
pW = turbine.pP / 3.0 # Convert from pP to w
yaw_effective_velocity = turbine.average_velocity \
* np.cos(np.radians(turbine.yaw_angle))**pW

# Now compute the power
cptmp = turbine.Cp #Note Cp is also now based on yaw effective velocity
power_kW = 0.5 * turbine.air_density * (np.pi * turbine.rotor_radius**2) \
* cptmp * turbine.generator_efficiency \
* yaw_effective_velocity**3 \
/ 1000

# Rotor aerodynamic thrust
cttmp = turbine.Ct
thrust_kN = 0.5 * turbine.air_density * (np.pi * turbine.rotor_radius**2) \
* cttmp * yaw_effective_velocity**2 \
/ 1000

return power_kW, thrust_kN

def get_horizontal_profile(self, x_D):
ff = deepcopy(self.flor.farm.flow_field)
bounds = (
x_D*self.D, x_D*self.D,
-1.5*self.D, 1.5*self.D,
self.zhub, self.zhub
)
Ny = 1 + (bounds[3] - bounds[2])/self.ds
res = Vec3(1, Ny, 1)
#print(res)
ff.reinitialize_flow_field(bounds_to_set=bounds, with_resolution=res)
ff.calculate_wake()
assert np.min(ff.x) == np.max(ff.x)
assert np.min(ff.z) == np.max(ff.z)
return np.squeeze(ff.y), np.squeeze(ff.u)

def get_vertical_profile(self, x_D):
ff = deepcopy(self.flor.farm.flow_field)
bounds = (
x_D*self.D, x_D*self.D,
0, 0,
self.zhub - self.D, self.zhub + 2*self.D,
)
Nz = 1 + (bounds[5] - bounds[4])/self.ds
res = Vec3(1, 1, Nz)
#print(res)
ff.reinitialize_flow_field(bounds_to_set=bounds, with_resolution=res)
ff.calculate_wake()
assert np.min(ff.x) == np.max(ff.x)
assert np.min(ff.y) == np.max(ff.y)
return np.squeeze(ff.z), np.squeeze(ff.u)

def get_downstream_plane(self, x_D):
ff = deepcopy(self.flor.farm.flow_field)
bounds = (
x_D*self.D, x_D*self.D,
-2*self.D, 2*self.D,
self.zhub-self.D, self.zhub+2*self.D,
)
Ny = 1 + (bounds[3] - bounds[2])/self.ds
Nz = 1 + (bounds[5] - bounds[4])/self.ds
res = Vec3(1, Ny, Nz)
#print(res)
ff.reinitialize_flow_field(bounds_to_set=bounds, with_resolution=res)
ff.calculate_wake()
assert np.min(ff.x) == np.max(ff.x)
return np.squeeze(ff.y), np.squeeze(ff.z), np.squeeze(ff.u)