Skip to content

Commit

Permalink
Use weis.aeroelasticse for file reading
Browse files Browse the repository at this point in the history
  • Loading branch information
dzalkind committed Dec 18, 2020
1 parent c8e9954 commit 0e53372
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions ROSCO_toolbox/turbine.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import os
import numpy as np
import datetime
from wisdem.ccblade.ccblade import CCAirfoil, CCBlade
from scipy import interpolate
from numpy import gradient
import pickle
Expand Down Expand Up @@ -159,7 +160,7 @@ def load_from_fast(self, FAST_InputFile,FAST_directory, FAST_ver='OpenFAST',dev_
txt_filename: str, optional
filename for *.txt, only used if rot_source='txt'
"""
from ofTools.fast_io.FAST_reader import InputReader_OpenFAST
from weis.aeroelasticse.FAST_reader import InputReader_OpenFAST

print('Loading FAST model: %s ' % FAST_InputFile)
self.TurbineName = FAST_InputFile.strip('.fst')
Expand Down Expand Up @@ -248,8 +249,6 @@ def load_from_ccblade(self):
Dictionary containing fast model details - defined using from InputReader_OpenFAST (distributed as a part of AeroelasticSE)
'''
from wisdem.ccblade.ccblade import CCAirfoil, CCBlade

print('Loading rotor performance data from CC-Blade.')

# Load blade information if it isn't already
Expand All @@ -274,13 +273,10 @@ def load_from_ccblade(self):

# Get values from cc-blade
print('Running CCBlade aerodynamic analysis, this may take a minute...')
try: # wisde/master as of Nov 9, 2020
_, _, _, _, CP, CT, CQ, CM = self.cc_rotor.evaluate(ws_flat, omega_flat, pitch_flat, coefficients=True)
except(ValueError): # wisdem/dev as of Nov 9, 2020
outputs, derivs = self.cc_rotor.evaluate(ws_flat, omega_flat, pitch_flat, coefficients=True)
CP = outputs['CP']
CT = outputs['CT']
CQ = outputs['CQ']
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 Down Expand Up @@ -316,8 +312,10 @@ def generate_rotperf_fast(self, openfast_path, FAST_runDirectory=None, run_BeamD
'serial' - run in serial, 'multi' - run using python multiprocessing tools,
'mpi' - run using mpi tools
'''
from ofTools.case_gen import runFAST_pywrapper, CaseGen_General
from ofTools.util import FileTools

# Load additional WEIS tools
from weis.aeroelasticse import runFAST_pywrapper, CaseGen_General
from weis.aeroelasticse.Util import FileTools
# Load pCrunch tools
from pCrunch import pdTools, Processing

Expand Down Expand Up @@ -499,8 +497,7 @@ def load_blade_info(self):
-----------
self - note: needs to contain fast input file info provided by load_from_fast.
'''
from ofTools.fast_io.FAST_reader import InputReader_OpenFAST
from wisdem.ccblade.ccblade import CCAirfoil, CCBlade
from weis.aeroelasticse.FAST_reader import InputReader_OpenFAST

# Create CC-Blade Rotor
r0 = np.array(self.fast.fst_vt['AeroDynBlade']['BlSpn'])
Expand Down

0 comments on commit 0e53372

Please sign in to comment.