diff --git a/ROSCO_toolbox/turbine.py b/ROSCO_toolbox/turbine.py index 7a92b7a20..ac89902b4 100644 --- a/ROSCO_toolbox/turbine.py +++ b/ROSCO_toolbox/turbine.py @@ -175,8 +175,11 @@ def load_from_fast(self, FAST_InputFile,FAST_directory, FAST_ver='OpenFAST',dev_ elif rot_source == 'cc-blade': self.load_from_ccblade(fast) else: # default load from cc-blade - print('No desired rotor performance data source specified, running CC-Blade.') - self.load_from_ccblade(fast) + if os.path.exists(txt_filename): + self.load_from_txt(txt_filename) + else: + print('No rotor performance data source available, running CC-Blade.') + self.load_from_ccblade(fast) # Parse rotor performance data self.Cp = RotorPerformance(self.Cp_table,self.pitch_initial_rad,self.TSR_initial) diff --git a/ROSCO_toolbox/utilities.py b/ROSCO_toolbox/utilities.py index 657e01b9b..72fb82c2a 100644 --- a/ROSCO_toolbox/utilities.py +++ b/ROSCO_toolbox/utilities.py @@ -88,7 +88,7 @@ class FileProcessing(): def __init__(self): pass - def write_param_file(self, turbine, controller, param_file='DISCON.IN'): + def write_param_file(self, turbine, controller, param_file='DISCON.IN', txt_filename='Cp_Ct_Cq.txt'): """ Print the controller parameters to the DISCON.IN input file for the generic controller @@ -99,7 +99,9 @@ def write_param_file(self, turbine, controller, param_file='DISCON.IN'): controller: class Controller class containing controller operation information (gains, etc...) param_file: str, optional - filename to for parameter input file, should be DISCON.IN + filename for parameter input file, should be DISCON.IN + txt_filename: str, optional + filename of rotor performance file """ print('Writing new controller parameter file parameter file: %s.' % param_file) # Should be obvious what's going on here... @@ -219,7 +221,7 @@ def write_rotor_performance(self,turbine,txt_filename='Cp_Ct_Cq.txt'): txt_filename: str, optional Desired output filename to print rotor performance data. Default is Cp_Ct_Cq.txt ''' - + print('Writing rotor performance text file: {}'.format(txt_filename)) file = open(txt_filename,'w') # Headerlines file.write('# ----- Rotor performance tables for the {} wind turbine ----- \n'.format(turbine.TurbineName))