Exemplo n.º 1
0
    def run_FAST(self, fst_vt, case_list, case_name_list, channels):

        # FAST wrapper setup
        fastBatch = runFAST_pywrapper_batch(FAST_ver=self.FAST_ver)

        fastBatch.FAST_exe = self.FAST_exe
        fastBatch.FAST_runDirectory = self.FAST_runDirectory
        fastBatch.FAST_InputFile = self.FAST_InputFile
        fastBatch.FAST_directory = self.FAST_directory
        fastBatch.debug_level = self.debug_level
        fastBatch.dev_branch = self.dev_branch
        fastBatch.fst_vt = fst_vt
        fastBatch.post = return_timeseries

        fastBatch.case_list = case_list
        fastBatch.case_name_list = case_name_list
        fastBatch.channels = channels

        # Run FAST
        if self.mpi_run:
            FAST_Output = fastBatch.run_mpi(self.mpi_comm_map_down)
        else:
            if self.cores == 1:
                FAST_Output = fastBatch.run_serial()
            else:
                FAST_Output = fastBatch.run_multi(self.cores)

        self.fst_vt = fst_vt

        return FAST_Output
Exemplo n.º 2
0
case_inputs[("AeroDyn15", "AFAeroMod")] = {'vals': [2], 'group': 0}
case_inputs[("AeroDyn15", "TwrPotent")] = {'vals': [0], 'group': 0}
case_inputs[("AeroDyn15", "TwrShadow")] = {'vals': ['True'], 'group': 0}
case_inputs[("AeroDyn15", "TwrAero")] = {'vals': ['True'], 'group': 0}
case_inputs[("AeroDyn15", "SkewMod")] = {'vals': [2], 'group': 0}
case_inputs[("AeroDyn15", "TipLoss")] = {'vals': ['True'], 'group': 0}
case_inputs[("AeroDyn15", "HubLoss")] = {'vals': ['True'], 'group': 0}
case_inputs[("AeroDyn15", "TanInd")] = {'vals': ['True'], 'group': 0}
case_inputs[("AeroDyn15", "AIDrag")] = {'vals': ['True'], 'group': 0}
case_inputs[("AeroDyn15", "TIDrag")] = {'vals': ['True'], 'group': 0}
case_inputs[("AeroDyn15", "UseBlCm")] = {'vals': ['True'], 'group': 0}

case_list, case_name_list = iec.execute(case_inputs=case_inputs)

# Run FAST cases
fastBatch = runFAST_pywrapper_batch(FAST_ver='OpenFAST', dev_branch=True)
if eagle:
    fastBatch.FAST_exe = '/home/pbortolo/openfast/build/glue-codes/openfast/openfast'  # Path to executable
    fastBatch.FAST_InputFile = 'OpenFAST_BAR_01.fst'  # FAST input file (ext=.fst)
    fastBatch.FAST_directory = '/home/pbortolo/wisdem_1_0_0/BAR/OpenFAST_Models/BAR_01'  # Path to fst directory files
else:
    fastBatch.FAST_exe = '/Users/pbortolo/work/2_openfast/openfast/build/glue-codes/openfast/openfast'  # Path to executable
    fastBatch.FAST_InputFile = 'OpenFAST_BAR_00.fst'  # FAST input file (ext=.fst)
    fastBatch.FAST_directory = '/Users/pbortolo/work/2_openfast/BAR/OpenFAST_Models/BAR_00'  # Path to fst directory files
fastBatch.FAST_runDirectory = iec.run_dir
fastBatch.case_list = case_list
fastBatch.case_name_list = case_name_list
fastBatch.debug_level = 2

if eagle:
    fastBatch.run_multi(36)
Exemplo n.º 3
0
    def generate_rotperf_fast(self, openfast_path, FAST_runDirectory=None, run_BeamDyn=False,
                              debug_level=1, run_type='multi'):
        '''
        Use openfast to generate Cp surface data. Will be slow, especially if using BeamDyn,
        but may be necessary if cc-blade is not sufficient.

        Parameters:
        -----------
        openfast_path: str
            path to openfast
        FAST_runDirectory: str
            directory to run openfast simulations in
        run_BeamDyn: bool
            Flag to run beamdyn - does not exist yet
        debug_level: float
            0 - no outputs, 1 - simple outputs, 2 - all outputs
        run_type: str
            'serial' - run in serial, 'multi' - run using python multiprocessing tools, 
            'mpi' - run using mpi tools
        '''

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


        # setup values for surface
        v0 = self.v_rated + 2
        TSR_initial = np.arange(3, 15,1)
        pitch_initial = np.arange(-1,25,1)
        rotspeed_initial = TSR_initial*v0/self.rotor_radius * RadSec2rpm # rpms

        # Specify Case Inputs
        case_inputs = {}

        # ------- Setup OpenFAST inputs --------
        case_inputs[('Fst','TMax')] = {'vals': [330], 'group': 0}
        case_inputs[('Fst','Compinflow')] = {'vals': [1], 'group': 0}
        case_inputs[('Fst','CompAero')] = {'vals': [2], 'group': 0}
        case_inputs[('Fst','CompServo')] = {'vals': [1], 'group': 0}
        case_inputs[('Fst','CompHydro')] = {'vals': [0], 'group': 0}
        if run_BeamDyn:
            case_inputs[('Fst','CompElast')] = {'vals': [2], 'group': 0}
        else:
            case_inputs[('Fst','CompElast')] = {'vals': [1], 'group': 0}
        case_inputs[('Fst', 'OutFileFmt')] = {'vals': [2], 'group': 0}

        # AeroDyn15
        case_inputs[('AeroDyn15', 'WakeMod')] = {'vals': [1], 'group': 0}
        case_inputs[('AeroDyn15', 'AfAeroMod')] = {'vals': [1], 'group': 0}
        case_inputs[('AeroDyn15', 'TwrPotent')] = {'vals': [0], 'group': 0}
        
        # ElastoDyn
        case_inputs[('ElastoDyn', 'FlapDOF1')] = {'vals': ['True'], 'group': 0}
        case_inputs[('ElastoDyn', 'FlapDOF2')] = {'vals': ['True'], 'group': 0}
        case_inputs[('ElastoDyn', 'EdgeDOF')] = {'vals': ['True'], 'group': 0}
        case_inputs[('ElastoDyn', 'TeetDOF')] = {'vals': ['False'], 'group': 0}
        case_inputs[('ElastoDyn', 'DrTrDOF')] = {'vals': ['False'], 'group': 0}
        case_inputs[('ElastoDyn', 'GenDOF')] = {'vals': ['False'], 'group': 0}
        case_inputs[('ElastoDyn', 'YawDOF')] = {'vals': ['False'], 'group': 0}
        case_inputs[('ElastoDyn', 'TwFADOF1')] = {'vals': ['False'], 'group': 0}
        case_inputs[('ElastoDyn', 'TwFADOF2')] = {'vals': ['False'], 'group': 0}
        case_inputs[('ElastoDyn', 'TwSSDOF1')] = {'vals': ['False'], 'group': 0}
        case_inputs[('ElastoDyn', 'TwSSDOF2')] = {'vals': ['False'], 'group': 0}
        case_inputs[('ElastoDyn', 'PtfmSgDOF')] = {'vals': ['False'], 'group': 0}
        case_inputs[('ElastoDyn', 'PtfmSwDOF')] = {'vals': ['False'], 'group': 0}
        case_inputs[('ElastoDyn', 'PtfmHvDOF')] = {'vals': ['False'], 'group': 0}
        case_inputs[('ElastoDyn', 'PtfmRDOF')] = {'vals': ['False'], 'group': 0}
        case_inputs[('ElastoDyn', 'PtfmPDOF')] = {'vals': ['False'], 'group': 0}
        case_inputs[('ElastoDyn', 'PtfmYDOF')] = {'vals': ['False'], 'group': 0}

        # BeamDyn
        # NEEDED

        # InflowWind
        case_inputs[('InflowWind', 'WindType')] = {'vals': [1], 'group': 0}
        case_inputs[('InflowWind', 'HWindSpeed')] = {'vals': [v0], 'group': 0}
        case_inputs[('InflowWind', 'PLexp')] = {'vals': [0], 'group': 0}

        # ServoDyn
        case_inputs[('ServoDyn', 'PCMode')] = {'vals': [0], 'group': 0}
        case_inputs[('ServoDyn', 'VSContrl')] = {'vals': [0], 'group': 0} 
        case_inputs[('ServoDyn', 'HSSBrMode')] = {'vals': [0], 'group': 0}
        case_inputs[('ServoDyn', 'YCMode')] = {'vals': [0], 'group': 0}

        # ------- Setup sweep values inputs --------
        case_inputs[('ElastoDyn', 'BlPitch1')] = {'vals': list(pitch_initial), 'group': 1}
        case_inputs[('ElastoDyn', 'BlPitch2')] = {'vals': list(pitch_initial), 'group': 1}
        case_inputs[('ElastoDyn', 'BlPitch3')] = {'vals': list(pitch_initial), 'group': 1}
        case_inputs[('ElastoDyn', 'RotSpeed')] = {'vals': list(rotspeed_initial), 'group': 2}


        # FAST details
        fastBatch = runFAST_pywrapper.runFAST_pywrapper_batch(FAST_ver='OpenFAST', dev_branch=True)
        fastBatch.FAST_exe = openfast_path  # Path to executable
        fastBatch.FAST_InputFile = self.fast.FAST_InputFile
        fastBatch.FAST_directory = self.fast.FAST_directory
        if not FAST_runDirectory:
            FAST_runDirectory = os.path.join(os.getcwd(), 'RotPerf_OpenFAST')
        fastBatch.FAST_runDirectory = FAST_runDirectory
        fastBatch.debug_level = debug_level

        # Generate cases
        case_name_base = self.TurbineName + '_rotperf'
        case_list, case_name_list = CaseGen_General.CaseGen_General(
            case_inputs, dir_matrix=fastBatch.FAST_runDirectory, namebase=case_name_base)
        fastBatch.case_list = case_list
        fastBatch.case_name_list = case_name_list

        # Make sure proper outputs exist
        var_out = [
            # ElastoDyn (this is probably overkill on the outputs)
            "BldPitch1", "BldPitch2", "BldPitch3", "Azimuth", "RotSpeed", "GenSpeed", "NacYaw",
            "OoPDefl1", "IPDefl1", "TwstDefl1", "OoPDefl2", "IPDefl2", "TwstDefl2", "OoPDefl3",
            "IPDefl3", "TwstDefl3", "RootFxc1",
            "RootFyc1", "RootFzc1", "RootMxc1", "RootMyc1", "RootMzc1", "RootFxc2", "RootFyc2",
            "RootFzc2", "RootMxc2", "RootMyc2", "RootMzc2", "RootFxc3", "RootFyc3", "RootFzc3",
            "RootMxc3", "RootMyc3", "RootMzc3", "Spn1MLxb1", "Spn1MLyb1", "Spn1MLzb1", "Spn1MLxb2",
            "Spn1MLyb2", "Spn1MLzb2", "Spn1MLxb3", "Spn1MLyb3", "Spn1MLzb3", "RotThrust", "LSSGagFya",
            "LSSGagFza", "RotTorq", "LSSGagMya", "LSSGagMza", 
            # ServoDyn
            "GenPwr", "GenTq",
            # AeroDyn15
            "RtArea", "RtVAvgxh", "B1N3Clrnc", "B2N3Clrnc", "B3N3Clrnc",
            "RtAeroCp", 'RtAeroCq', 'RtAeroCt', 'RtTSR', # NECESSARY
            # InflowWind
            "Wind1VelX", 
        ]
        channels = {}
        for var in var_out:
            channels[var] = True
        fastBatch.channels = channels

        # Run OpenFAST
        if run_type.lower() == 'multi':
            fastBatch.run_multi()
        elif run_type.lower()=='mpi':
            fastBatch.run_mpi()
        elif run_type.lower()=='serial':
            fastBatch.run_serial()

        # ========== Post Processing ==========
        # Save statistics
        fp = Processing.FAST_Processing()

        # Find all outfiles
        fname_case_matrix = os.path.join(FAST_runDirectory, 'case_matrix.yaml')
        case_matrix = FileTools.load_yaml(fname_case_matrix, package=1)
        cm = pd.DataFrame(case_matrix)
        # Parse case matrix and find outfiles names
        outfiles = []
        case_names = cm['Case_Name']
        outfiles = []
        for name in case_names:
            outfiles.append(os.path.join(FAST_runDirectory, name + '.outb'))



        # Set some processing parameters
        fp.OpenFAST_outfile_list = outfiles
        fp.namebase = case_name_base
        fp.t0 = 270 
        fp.parallel_analysis = True
        fp.results_dir = os.path.join(FAST_runDirectory,'stats')
        fp.verbose = True
        # Save for debug!
        fp.save_LoadRanking = False
        fp.save_SummaryStats = False

        print('Processing openfast data on {} cores.'.format(fp.parallel_cores))

        # Load and save statistics and load rankings
        stats, load_rankings = fp.batch_processing()

        # Get means of last 30 seconds of 300 second simulation
        CP = stats[0]['RtAeroCp']['mean']
        CT = stats[0]['RtAeroCt']['mean']
        CQ = stats[0]['RtAeroCq']['mean']

        # Reshape Cp, Ct and Cq
        Cp = np.transpose(np.reshape(CP, (len(pitch_initial), len(TSR_initial))))
        Ct = np.transpose(np.reshape(CT, (len(pitch_initial), len(TSR_initial))))
        Cq = np.transpose(np.reshape(CQ, (len(pitch_initial), len(TSR_initial))))

        # Store necessary metrics for analysis
        self.pitch_initial_rad = pitch_initial * deg2rad
        self.TSR_initial = TSR_initial
        self.Cp_table = Cp
        self.Ct_table = Ct
        self.Cq_table = Cq
Exemplo n.º 4
0
def runFAST_CaseGenIEC(init_cond, offshore=False):

    ####
    #TMax    = 720.
    #TStart  = 120.
    #T_trans = 320.
    TMax = 840.
    TStart = 240.
    T_trans = 540.
    ####

    iec = CaseGen_IEC()

    # Turbine Data
    iec.init_cond = {}  # can leave as {} if data not available
    iec.init_cond[("ElastoDyn", "RotSpeed")] = {'U': init_cond['Wind1VelX']}
    iec.init_cond[("ElastoDyn", "RotSpeed")]['val'] = init_cond['RotSpeed']
    iec.init_cond[("ElastoDyn", "BlPitch1")] = {'U': init_cond['Wind1VelX']}
    iec.init_cond[("ElastoDyn", "BlPitch1")]['val'] = init_cond['BldPitch1']
    iec.init_cond[("ElastoDyn", "BlPitch2")] = iec.init_cond[("ElastoDyn",
                                                              "BlPitch1")]
    iec.init_cond[("ElastoDyn", "BlPitch3")] = iec.init_cond[("ElastoDyn",
                                                              "BlPitch1")]

    if offshore:
        iec.init_cond[("HydroDyn", "WaveHs")] = {
            'U': [3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 25, 40, 50]
        }
        iec.init_cond[("HydroDyn", "WaveHs")]['val'] = [
            1.101917033, 1.101917033, 1.179052649, 1.315715154, 1.536867124,
            1.835816514, 2.187994638, 2.598127096, 3.061304068, 3.617035443,
            4.027470219, 4.51580671, 4.51580671, 9.686162473, 11.307125
        ]
        iec.init_cond[("HydroDyn", "WaveTp")] = {
            'U': [3, 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 25, 40, 50]
        }
        iec.init_cond[("HydroDyn", "WaveTp")]['val'] = [
            8.515382435, 8.515382435, 8.310063688, 8.006300889, 7.6514231,
            7.440581338, 7.460834063, 7.643300307, 8.046899942, 8.521314105,
            8.987021024, 9.451641026, 9.451641026, 16.65396967, 18.50491229
        ]
        iec.init_cond[("HydroDyn", "PtfmSurge")] = {'U': [3., 15., 25.]}
        iec.init_cond[("HydroDyn", "PtfmSurge")]['val'] = [4., 15., 10.]
        iec.init_cond[("HydroDyn", "PtfmPitch")] = {'U': [3., 15., 25.]}
        iec.init_cond[("HydroDyn", "PtfmPitch")]['val'] = [-1., 3., 1.3]
        iec.init_cond[("HydroDyn", "PtfmHeave")] = {'U': [3., 25.]}
        iec.init_cond[("HydroDyn", "PtfmHeave")]['val'] = [0.5, 0.5]

    iec.Turbine_Class = 'I'  # I, II, III, IV
    iec.Turbulence_Class = 'B'
    iec.D = 240.
    iec.z_hub = 150.

    V_rated = 8.25867815

    # DLC inputs
    iec.dlc_inputs = {}
    #iec.dlc_inputs['DLC']   = [1.1]
    #iec.dlc_inputs['U']     = [np.arange(3., 26., 2.)] #
    #iec.dlc_inputs['Seeds'] = [range(1,7)]
    #iec.dlc_inputs['Yaw']   = [[]]
    iec.dlc_inputs['DLC'] = [1.1, 1.3, 1.4, 1.5, 6.1, 6.3]
    iec.dlc_inputs['U'] = [
        np.arange(3., 26., 2.),
        np.arange(3., 26., 2.), [V_rated - 2., V_rated, V_rated + 2.],
        np.arange(3., 26., 2.), [], []
    ]  #
    iec.dlc_inputs['Seeds'] = [
        range(1, 7),
        range(1, 7), [], [],
        range(1, 7),
        range(1, 7)
    ]
    iec.dlc_inputs['Yaw'] = [[], [], [], [], [], []]
    #iec.dlc_inputs['DLC']   = [1.1]
    #iec.dlc_inputs['U']     = [[13.]] #
    #iec.dlc_inputs['Seeds'] = [[1]]
    #iec.dlc_inputs['Yaw']   = [[]]

    iec.transient_dir_change = 'both'  # '+','-','both': sign for transient events in EDC, EWS
    iec.transient_shear_orientation = 'both'  # 'v','h','both': vertical or horizontal shear for EWS
    iec.TMax = TMax  # wind file length
    iec.TStart = T_trans  # start of transcient events (annoying different use of TStart var name)

    # Naming, file management, etc
    iec.wind_dir = 'run_dir/BAR00_IEC_run2/wind'
    iec.case_name_base = 'BAR00_IEC_run2'
    iec.Turbsim_exe = "TurbSim"
    # iec.Turbsim_exe           = "/mnt/c/linux/WT_Codes/TurbSim_v2.00.07a-bjj/TurbSim_glin64"
    iec.debug_level = 2
    iec.overwrite = False
    iec.parallel_windfile_gen = True
    iec.cores = 24
    iec.run_dir = 'run_dir/BAR00_IEC_run2'
    iec.flag_enlarge_grid = True

    # Run case generator / wind file writing
    case_inputs = {}
    # case_inputs[("Fst","TStart")]            = {'vals':[0.], 'group':0} # 120
    # case_inputs[("Fst","TMax")]              = {'vals':[200.], 'group':0} # 720
    case_inputs[("Fst", "DT")] = {'vals': [0.01], 'group': 0}
    case_inputs[("Fst", "OutFileFmt")] = {'vals': [2], 'group': 0}
    case_inputs[("Fst", "TMax")] = {'vals': [TMax], 'group': 0}  # 720
    case_inputs[("Fst", "TStart")] = {'vals': [TStart], 'group': 0}  # 120
    if offshore:
        # case_inputs[("Fst","DT_Out")]            = {'vals':[0.05], 'group':0} # 720
        case_inputs[("Fst", "CompHydro")] = {'vals': [1], 'group': 0}
        case_inputs[("HydroDyn", "WaveMod")] = {'vals': [2], 'group': 0}
        case_inputs[("HydroDyn", "WvDiffQTF")] = {
            'vals': ["False"],
            'group': 0
        }
        # case_inputs[("Fst","CompSub")]           = {'vals':[1], 'group':0}
        case_inputs[("ElastoDyn", "PtfmSgDOF")] = {
            'vals': ["True"],
            'group': 0
        }
        case_inputs[("ElastoDyn", "PtfmSwDOF")] = {
            'vals': ["True"],
            'group': 0
        }
        case_inputs[("ElastoDyn", "PtfmHvDOF")] = {
            'vals': ["True"],
            'group': 0
        }
        case_inputs[("ElastoDyn", "PtfmRDOF")] = {'vals': ["True"], 'group': 0}
        case_inputs[("ElastoDyn", "PtfmPDOF")] = {'vals': ["True"], 'group': 0}
        case_inputs[("ElastoDyn", "PtfmYDOF")] = {'vals': ["True"], 'group': 0}
    else:
        case_inputs[("Fst", "CompHydro")] = {'vals': [0], 'group': 0}
        case_inputs[("Fst", "CompSub")] = {'vals': [0], 'group': 0}
        case_inputs[("ElastoDyn", "PtfmSgDOF")] = {
            'vals': ["False"],
            'group': 0
        }
        case_inputs[("ElastoDyn", "PtfmSwDOF")] = {
            'vals': ["False"],
            'group': 0
        }
        case_inputs[("ElastoDyn", "PtfmHvDOF")] = {
            'vals': ["False"],
            'group': 0
        }
        case_inputs[("ElastoDyn", "PtfmRDOF")] = {
            'vals': ["False"],
            'group': 0
        }
        case_inputs[("ElastoDyn", "PtfmPDOF")] = {
            'vals': ["False"],
            'group': 0
        }
        case_inputs[("ElastoDyn", "PtfmYDOF")] = {
            'vals': ["False"],
            'group': 0
        }
    case_inputs[("ElastoDyn", "TwFADOF1")] = {'vals': ["False"], 'group': 0}
    case_inputs[("ElastoDyn", "TwFADOF2")] = {'vals': ["False"], 'group': 0}
    case_inputs[("ElastoDyn", "TwSSDOF1")] = {'vals': ["False"], 'group': 0}
    case_inputs[("ElastoDyn", "TwSSDOF2")] = {'vals': ["False"], 'group': 0}
    case_inputs[("ElastoDyn", "FlapDOF1")] = {'vals': ["True"], 'group': 0}
    case_inputs[("ElastoDyn", "FlapDOF2")] = {'vals': ["True"], 'group': 0}
    case_inputs[("ElastoDyn", "EdgeDOF")] = {'vals': ["True"], 'group': 0}
    case_inputs[("ElastoDyn", "DrTrDOF")] = {'vals': ["False"], 'group': 0}
    case_inputs[("ElastoDyn", "GenDOF")] = {'vals': ["True"], 'group': 0}
    case_inputs[("ElastoDyn", "YawDOF")] = {'vals': ["False"], 'group': 0}
    case_inputs[("ServoDyn", "PCMode")] = {'vals': [5], 'group': 0}
    case_inputs[("ServoDyn", "VSContrl")] = {'vals': [5], 'group': 0}

    case_inputs[("AeroDyn15", "WakeMod")] = {'vals': [1], 'group': 0}
    case_inputs[("AeroDyn15", "AFAeroMod")] = {'vals': [2], 'group': 0}
    case_inputs[("AeroDyn15", "TwrPotent")] = {'vals': [0], 'group': 0}
    case_inputs[("AeroDyn15", "TwrShadow")] = {'vals': ['False'], 'group': 0}
    case_inputs[("AeroDyn15", "TwrAero")] = {'vals': ['False'], 'group': 0}
    case_inputs[("AeroDyn15", "SkewMod")] = {'vals': [1], 'group': 0}
    case_inputs[("AeroDyn15", "TipLoss")] = {'vals': ['True'], 'group': 0}
    case_inputs[("AeroDyn15", "HubLoss")] = {'vals': ['True'], 'group': 0}
    case_inputs[("AeroDyn15", "TanInd")] = {'vals': ['True'], 'group': 0}
    case_inputs[("AeroDyn15", "AIDrag")] = {'vals': ['True'], 'group': 0}
    case_inputs[("AeroDyn15", "TIDrag")] = {'vals': ['True'], 'group': 0}
    case_inputs[("AeroDyn15", "IndToler")] = {'vals': [1.e-5], 'group': 0}
    case_inputs[("AeroDyn15", "MaxIter")] = {'vals': [5000], 'group': 0}
    case_inputs[("AeroDyn15", "UseBlCm")] = {'vals': ['True'], 'group': 0}

    case_list, case_name_list = iec.execute(case_inputs=case_inputs)

    # Run FAST cases
    fastBatch = runFAST_pywrapper_batch(FAST_ver='OpenFAST', dev_branch=True)

    fastBatch.post = return_fname
    fastBatch.debug_level = 1
    fastBatch.FAST_exe = 'openfast'  # Path to executable
    fastBatch.FAST_InputFile = 'OpenFAST_BAR_00.fst'  # FAST input file (ext=.fst)
    fastBatch.FAST_namingOut = 'BAR00_IEC_run2'
    # fastBatch.FAST_directory     = 'IEA-15-240-RWT/OpenFAST'   # Path to fst directory files
    fastBatch.FAST_directory = "/projects/windse/egaertne/bar_loads/BAR/OpenFAST_Models/BAR_00/"
    fastBatch.FAST_runDirectory = 'run_dir/BAR00_IEC_run2/'

    fastBatch.case_list = case_list
    fastBatch.case_name_list = case_name_list
    fastBatch.debug_level = 2

    # Out Channels
    var_out = [
        "TipDxc1", "TipDyc1", "TipDzc1", "TipDxb1", "TipDyb1", "TipDxc2",
        "TipDyc2", "TipDzc2", "TipDxb2", "TipDyb2", "TipDxc3", "TipDyc3",
        "TipDzc3", "TipDxb3", "TipDyb3", "RootMxc1", "RootMyc1", "RootMzc1",
        "RootMxb1", "RootMyb1", "RootMxc2", "RootMyc2", "RootMzc2", "RootMxb2",
        "RootMyb2", "RootMxc3", "RootMyc3", "RootMzc3", "RootMxb3", "RootMyb3",
        "TwrBsMxt", "TwrBsMyt", "TwrBsMzt", "GenPwr", "GenTq", "RotThrust",
        "RtAeroCp", "RtAeroCt", "RotSpeed", "BldPitch1", "TTDspSS", "TTDspFA",
        "NacYaw", "Wind1VelX", "Wind1VelY", "Wind1VelZ", "LSSTipMxa",
        "LSSTipMya", "LSSTipMza", "LSSTipMxs", "LSSTipMys", "LSSTipMzs",
        "LSShftFys", "LSShftFzs"
    ]
    channels = {}
    for var in var_out:
        channels[var] = True
    fastBatch.channels = channels

    #fastBatch.run_serial()
    output = fastBatch.run_multi(iec.cores)

    # results
    outdir = 'results/BAR00_IEC_run2/'
    outnaming = "BAR00_IEC_run2" + "_outfile_list.dat"
    fname = os.path.join(outdir, outnaming)
    if not os.path.isdir(outdir):
        os.makedirs(outdir)
    output = [os.path.abspath(file) for file in output]
    np.savetxt(fname, output, fmt='%s')

    shutil.copyfile(
        os.path.join(fastBatch.FAST_runDirectory, "case_matrix.txt"),
        os.path.join(outdir, "case_matrix.txt"))