Skip to content

Commit

Permalink
Update for cc-blade API changes (only on wisdem's IEAontology4all bra…
Browse files Browse the repository at this point in the history
…nch)
  • Loading branch information
nikhar-abbas committed Jun 4, 2020
1 parent 023dcbc commit e9d639c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 10 deletions.
13 changes: 12 additions & 1 deletion ROSCO_toolbox/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,18 @@ def tune_flap_controller(self,turbine):
for i, _ in enumerate(self.v):
turbine.cc_rotor.induction_inflow=True
# Axial and tangential inductions
a, ap, alpha0, cl, cd = turbine.cc_rotor.distributedAeroLoads(self.v[i], self.omega_op[i], self.pitch_op[i], 0.0)
try:
a, ap, alpha0, cl, cd = turbine.cc_rotor.distributedAeroLoads(
self.v[i], self.omega_op[i], self.pitch_op[i], 0.0)
except ValueError:
loads, derivs = turbine.cc_rotor.distributedAeroLoads(
self.v[i], self.omega_op[i], self.pitch_op[i], 0.0)
a = loads['a']
ap = loads['ap']
alpha0 = loads['alpha']
cl = loads['Cl']
cd = loads['Cd']

# Relative windspeed
v_rel.append([np.sqrt(self.v[i]**2*(1-a)**2 + self.omega_op[i]**2*turbine.span**2*(1-ap)**2)])
# Inflow wind direction
Expand Down
29 changes: 20 additions & 9 deletions ROSCO_toolbox/turbine.py
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,13 @@ def load_from_ccblade(self):

# Get values from cc-blade
print('Running CCBlade aerodynamic analysis, this may take a minute...')
# P, T, Q, M, CP, CT, CQ, CM = self.cc_rotor.evaluate(ws_flat, omega_flat, pitch_flat, coefficients=True)
_, _, _, _, CP, CT, CQ, _ = self.cc_rotor.evaluate(ws_flat, omega_flat, pitch_flat, coefficients=True)
try:
_, _, _, _, CP, CT, CQ, _ = self.cc_rotor.evaluate(ws_flat, omega_flat, pitch_flat, coefficients=True)
except ValueError: # On IEAontology4all
outputs, derivs = self.cc_rotor.evaluate(ws_flat, omega_flat, pitch_flat, coefficients=True)
CP = outputs['CP']
CT = outputs['CT']
CQ = outputs['CQ']
print('CCBlade aerodynamic analysis run successfully.')

# Reshape Cp, Ct and Cq
Expand All @@ -321,6 +326,11 @@ def load_from_ccblade(self):
self.Cp_table = Cp
self.Ct_table = Ct
self.Cq_table = Cq

# Save some blade parameters
self.span = r
self.chord = chord
self.twist = theta

def load_blade_info(self):
'''
Expand All @@ -343,7 +353,8 @@ def load_blade_info(self):
# Make sure cc_rotor exists for DAC analysis
try:
if self.cc_rotor:
pass
self.af_data = self.fast.fst_vt['AeroDyn15']['af_data']
self.bld_flapwise_damp = self.fast.fst_vt['ElastoDynBlade']['BldFlDmp1']/100 * 0.7
except AttributeError:
# Create CC-Blade Rotor
r0 = np.array(self.fast.fst_vt['AeroDynBlade']['BlSpn'])
Expand Down Expand Up @@ -389,12 +400,12 @@ def load_blade_info(self):
self.cc_rotor = CCBlade(r, chord, theta, af, self.Rhub, self.rotor_radius, self.NumBl, rho=self.rho, mu=self.mu,
precone=-self.precone, tilt=-self.tilt, yaw=self.yaw, shearExp=self.shearExp, hubHt=self.hubHt, nSector=nSector)

# Save some blade data
self.af_data = self.fast.fst_vt['AeroDyn15']['af_data']
self.span = r
self.chord = chord
self.twist = theta
self.bld_flapwise_damp = self.fast.fst_vt['ElastoDynBlade']['BldFlDmp1']/100 * 0.7
# Save some blade data
self.af_data = self.fast.fst_vt['AeroDyn15']['af_data']
self.span = r
self.chord = chord
self.twist = theta
self.bld_flapwise_damp = self.fast.fst_vt['ElastoDynBlade']['BldFlDmp1']/100 * 0.7

class RotorPerformance():
'''
Expand Down

0 comments on commit e9d639c

Please sign in to comment.