Skip to content

Commit 284b71c

Browse files
author
Rudy Alkarem
committed
Turbine not positioned in the center of high-res boxes fixes
1 parent 70403d1 commit 284b71c

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

openfast_toolbox/fastfarm/FASTFarmCaseCreation.py

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2600,8 +2600,8 @@ def _getBoxesParamsForFF(self, lowbts, highbts, dt_low_desired, D, HubHt, xWT, y
26002600
# --- High-res location per turbine
26012601
X0_desired = np.asarray(xWT)-LX_High/2 # high-res is centered on turbine location
26022602
Y0_desired = np.asarray(yt)-LY_High/2 # high-res is centered on turbine location
2603-
X0_High = X0_Low + np.floor((X0_desired-X0_Low)/dX_High)*dX_High
2604-
Y0_High = Y0_Low + np.floor((Y0_desired-Y0_Low)/dY_High)*dY_High
2603+
X0_High = X0_Low + (X0_desired-X0_Low)/dX_High*dX_High # removed np.floor because it would prevent turbines being centered
2604+
Y0_High = Y0_Low + (Y0_desired-Y0_Low)/dY_High*dY_High # removed np.floor because it would prevent turbines being centered
26052605

26062606
if self.verbose>2:
26072607
print(f' Low Box \t\t High box ')
@@ -2648,19 +2648,20 @@ def _getBoxesParamsForFF(self, lowbts, highbts, dt_low_desired, D, HubHt, xWT, y
26482648
d['U_mean_Low'] = meanU_Low
26492649
d['U_mean_High'] = meanU_High
26502650

2651-
2651+
2652+
# Commenting this for now: it was creating problems when the turbine is not exactly centered in the high-res box so I removed the np.floor
26522653
# --- Sanity check: check that the high res is at "almost" an integer location
2653-
X_rel = (np.array(d['X0_High'])-d['X0_Low'])/d['dX_High']
2654-
Y_rel = (np.array(d['Y0_High'])-d['Y0_Low'])/d['dY_High']
2655-
dX = X_rel - np.round(X_rel) # Should be close to zero
2656-
dY = Y_rel - np.round(Y_rel) # Should be close to zero
2654+
# X_rel = (np.array(d['X0_High'])-d['X0_Low'])/d['dX_High']
2655+
# Y_rel = (np.array(d['Y0_High'])-d['Y0_Low'])/d['dY_High']
2656+
# dX = X_rel - np.round(X_rel) # Should be close to zero
2657+
# dY = Y_rel - np.round(Y_rel) # Should be close to zero
26572658

2658-
if any(abs(dX)>1e-3):
2659-
print('Deltas:',dX)
2660-
raise Exception('Some X0_High are not on an integer multiple of the high-res grid')
2661-
if any(abs(dY)>1e-3):
2662-
print('Deltas:',dY)
2663-
raise Exception('Some Y0_High are not on an integer multiple of the high-res grid')
2659+
# if any(abs(dX)>1e-3):
2660+
# print('Deltas:',dX)
2661+
# raise Exception('Some X0_High are not on an integer multiple of the high-res grid')
2662+
# if any(abs(dY)>1e-3):
2663+
# print('Deltas:',dY)
2664+
# raise Exception('Some Y0_High are not on an integer multiple of the high-res grid')
26642665

26652666
return d
26662667

openfast_toolbox/fastfarm/TurbSimCaseCreation.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,9 @@ def __init__(self, D, HubHt, Vhub, TI, PLexp, x, y, z=None, zbot=1.0, cmax=5.0,
6161
else:
6262
manual_ds_low = True
6363

64-
# Force manual modes off:
65-
manual_mode = False
66-
manual_ds_low = False
64+
# # Force manual modes off:
65+
# manual_mode = False
66+
# manual_ds_low = False
6767

6868
# Set parameters for convenience
6969
self.Cmeander = Cmeander

0 commit comments

Comments
 (0)