Skip to content

Commit

Permalink
Pitch angles in rad, interpolate to bounds
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhar-abbas committed Sep 6, 2019
1 parent 48df286 commit 3492320
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions WTC_toolbox/turbine.py
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def load_from_txt(self,fast,txt_filename):
if line.__contains__('Pitch angle'):
# Beta.append(pfile.readline())
pitch_initial = np.array([float(x) for x in pfile.__next__().strip().split()])

pitch_initial = pitch_initial * (np.pi/180) # degrees to rad
# Read Tip Speed Ratios (rad)
if line.__contains__('TSR'):
TSR_initial = np.array([float(x) for x in pfile.__next__().strip().split()])
Expand Down Expand Up @@ -233,8 +233,8 @@ def load_from_txt(self,fast,txt_filename):

# # Form the interpolant functions which can look up any arbitrary location
self.cp_interp = interpolate.interp2d(pitch_initial, TSR_initial, CP, kind='cubic',bounds_error=False)
self.ct_interp = interpolate.interp2d(pitch_initial, TSR_initial, CT, kind='cubic')
self.cq_interp = interpolate.interp2d(pitch_initial, TSR_initial, CQ, kind='cubic')
self.ct_interp = interpolate.interp2d(pitch_initial, TSR_initial, CT, kind='cubic',bounds_error=False))
self.cq_interp = interpolate.interp2d(pitch_initial, TSR_initial, CQ, kind='cubic',bounds_error=False))


# # NOT CERTAIN OF THESE ALTERNATIVES YET
Expand Down
8 changes: 7 additions & 1 deletion examples/TuningTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
from scipy import interpolate

from WTC_toolbox import turbine as wtc_turbine
from WTC_toolbox import controller as wtc_controller
from WTC_toolbox import sim as wtc_sim

# Initialiize a turbine class
Expand All @@ -26,4 +25,11 @@
turbine.load_from_fast(FAST_InputFile,FAST_directory,drivetrain_inertia,dev_branch=True,rot_source='txt', txt_filename=txt_filename)


#%% Run controller
from WTC_toolbox import controller as wtc_controller
controller = wtc_controller.Controller()

controller.turbine_params


#%%

0 comments on commit 3492320

Please sign in to comment.