Skip to content

Commit

Permalink
Optional wind speed, TMax inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
nikhar-abbas committed Sep 17, 2020
1 parent 12fbbd0 commit b1fe191
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions ROSCO_testing/ROSCO_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,28 @@ def __init__(self, **kwargs):

super(ROSCO_testing, self).__init__()

def ROSCO_Test_lite(self, more_case_inputs=None):
def ROSCO_Test_lite(self, more_case_inputs=None, U=[]):
'''
DLC 1.1 - 5 wind speeds, 60s
Parameters:
-----------
more_case_inputs: dict
Additional case inputs
U: list
List of wind inputs
'''
TMax = 360

# Check for time and wind inputs
if ('Fst','TMax') in more_case_inputs.keys():
TMax = np.max(more_case_inputs[('Fst','TMax')]['vals'])
else:
TMax = 360

if len(U) > 0:
WindSpeeds = U
else:
WindSpeeds = [5, 8, 11, 14, 17]

fastRead = InputReader_OpenFAST(
FAST_ver=self.FAST_ver, dev_branch=self.dev_branch)
Expand Down Expand Up @@ -126,9 +138,8 @@ def ROSCO_Test_lite(self, more_case_inputs=None):

iec.dlc_inputs = {}
iec.dlc_inputs['DLC'] = [1.1] # ,6.1,6.3]
iec.dlc_inputs['U'] = [[5, 8, 11, 14, 17]]
# nothing special about these seeds, randomly generated (???)
iec.dlc_inputs['Seeds'] = [[11346]]
iec.dlc_inputs['U'] = [WindSpeeds]
iec.dlc_inputs['Seeds'] = [[971231]]
iec.dlc_inputs['Yaw'] = [[]]
iec.transient_dir_change = '-' # '+','-','both': sign for transient events in EDC, EWS
iec.transient_shear_orientation = 'v' # 'v','h','both': vertical or horizontal shear for EWS
Expand Down Expand Up @@ -163,6 +174,7 @@ def ROSCO_Test_lite(self, more_case_inputs=None):
case_inputs[('ServoDyn', 'GenTiStp')] = {'vals': ['True'], 'group': 0}
case_inputs[('ServoDyn', 'SpdGenOn')] = {'vals': [0.], 'group': 0}
case_inputs[('ServoDyn', 'DLL_FileName')] = {'vals': [self.rosco_path], 'group': 0}
case_inputs[('ServoDyn', 'DLL_DT')] = {'vals': ['"default"'], 'group': 0}

case_inputs[("AeroDyn15", "WakeMod")] = {'vals': [1], 'group': 0}
case_inputs[("AeroDyn15", "AFAeroMod")] = {'vals': [2], 'group': 0}
Expand All @@ -183,7 +195,7 @@ def ROSCO_Test_lite(self, more_case_inputs=None):
case_inputs.update(more_case_inputs)

# generate cases
case_list, case_name_list = iec.execute(case_inputs=case_inputs)
case_list, case_name_list, _ = iec.execute(case_inputs=case_inputs)

# Ensure proper output channels
var_out = self.var_out
Expand Down Expand Up @@ -364,7 +376,7 @@ def ROSCO_Test_heavy(self, more_case_inputs=None):
else:
fastBatch.run_serial()

def ROSCO_Controller_Comp(self, controller_paths, testtype='light'):
def ROSCO_Controller_Comp(self, controller_paths, testtype='light', more_case_inputs=[], U=[]):
'''
Heavy or light testing for n controllers, n = len(controller_paths)
Expand All @@ -386,7 +398,7 @@ def ROSCO_Controller_Comp(self, controller_paths, testtype='light'):
self.windDir = os.path.join(run_dir_init, 'wind') # wind in base runDir

if testtype.lower() == 'light':
self.ROSCO_Test_lite()
self.ROSCO_Test_lite(more_case_inputs=more_case_inputs, U=U)
elif testtype.lower() == 'heavy':
self.ROSCO_Test_heavy()
else:
Expand Down

0 comments on commit b1fe191

Please sign in to comment.