diff --git a/wetb/dlc/dlc_fatigue.py b/wetb/dlc/dlc_fatigue.py new file mode 100644 index 0000000000000000000000000000000000000000..f2fc84797ee893229e59ed6cdc491ca3b2236817 --- /dev/null +++ b/wetb/dlc/dlc_fatigue.py @@ -0,0 +1,84 @@ +''' +Created on 23/09/2014 + +@author: MMPE +''' + +import numpy as np +import glob +import os +HOURS_PR_YEAR = 365.0 * 24.0 + + +def Weibull(u, k, start, stop, step): + C = 2 * u / np.sqrt(np.pi) + cdf = lambda x :-np.exp(-(x / C) ** k) + wsprange = (np.arange(start, stop + step * 0.01, step)).tolist() + return {wsp:-cdf(wsp - step / 2) + cdf(wsp + step / 2) for wsp in wsprange} + + +def dlc_dict(Vin=4, Vr=12, Vout=26, Vref=50, Vstep=2, shape_k=2): + weibull = Weibull(Vref * 0.2, shape_k, Vin, Vout, Vstep) + + return { #dlc : (hour_dist, yaw, wsp + '12': (.975, weibull, {0:.5, 10:.25, -10:.25}), #normal + '64': (.025, Weibull(Vref * 0.2, shape_k, Vin, Vref * 0.7, Vstep), {8:.5, -8:.5}), #idle + '24': (50.0 / HOURS_PR_YEAR, weibull, {-20:.5, 20:.5}), # Yaw error + '31': (1100 * 100 / 3600 / HOURS_PR_YEAR, {Vin:1000 / 1100, Vr:50 / 1100, Vout:50 / 1100}, {0:1}), #start ups + '41': (1100 * 100 / 3600 / HOURS_PR_YEAR, {Vin:1000 / 1100, Vr:50 / 1100, Vout:50 / 1100}, {0:1}) #shut down + } + + +def file_hour_lst(path, dlc_dict, dlc_folder="DLC%s_IEC61400-1ed3/", + dlc_name="dlc%s_wsp%02d_wdir%03d_s*.sel", years=20.0): + """Create a list of (filename, hours_pr_year) that can be used as input for LifeTimeEqLoad + + Parameters + ---------- + path : str + path to result folder, i.e. dlc12 result files are found in path + "DLC12_IEC61400-1ed3/*.sel" + dlc_dict : dict + Dictionary of {dlc_id: (dlc_prob, wsp_dict, wdir_dict, wsp),...} where\n + - dlc_id is the design load case id, e.g. '12'\n + - dlc_prob is the probability of the dlc_id, e.g. 0.95 for dlc12, i.e 95% normal operation\n + - wsp_dict is a dictionary of {wsp: wsp_prob,...} see dlc_fatigue.Weibull where\n + - wsp is a wind speed, e.g. 10 for 10m/s + - wsp_prob is the probability of the wind speed, e.g. .14 for 14% + - wdir_dict is a dictionary of {wdir: wdir_prob,...} where\n + - wdir is a wind direction(yaw error), e.g. 10 for 10 deg yaw error + - wdir_prob is the probability of the wind direction(yaw error), e.g. .25 for 25% + dlc_folder : str, default="DLC%s_IEC61400-1ed3/" + String with the DLC subfolder names. One string substitution is required + (%s), and should represent the DLC number (withouth comma or point) + dlc_name : str, default="dlc%s_wsp%02d_wdir%03d_s*.sel" + String with the DLC names. One string, and two integer substitutions + are required (%s, %02d, %03d), indicating the DLC number (e.g. '12'), + the windspeed (e.g. int(6)), and wind speed direction (e.g. int(10)) + respectively. Notice that different seed numbers are covered with the + wildcard *. + years : float, default=20.0 + Life time years. + Returns + ------- + file_hour_lst : list + [(filename, hours),...] where\n + - filename is the name of the file, including path + - hours is the number of hours pr. 20 year (or whatever is defined in + the `years` variable) of this file + """ + + fh_lst = [] + for dlc_id in sorted(dlc_dict.keys()): + dlc_dist, wsp_dict, wdir_dict = dlc_dict[dlc_id] + for wsp in sorted(wsp_dict.keys()): + wsp_dist = wsp_dict[wsp] + for wdir in sorted(wdir_dict.keys()): + wdir_dist = wdir_dict[wdir] + folder = os.path.join(path, dlc_folder % dlc_id) + name = dlc_name % (dlc_id, wsp, wdir % 360) + files = glob.glob(os.path.join(folder, name)) + for f in sorted(files): + f_prob = dlc_dist * wsp_dist * wdir_dist / len(files) + f_hours_lifetime = years * HOURS_PR_YEAR * f_prob + fh_lst.append((f, f_hours_lifetime)) + return fh_lst diff --git a/wetb/dlc/high_level.py b/wetb/dlc/high_level.py new file mode 100644 index 0000000000000000000000000000000000000000..ea6421676cc5ce86d1488b444859c8f1d0c62215 --- /dev/null +++ b/wetb/dlc/high_level.py @@ -0,0 +1,171 @@ +''' +Created on 01/10/2014 + +@author: MMPE +''' +import xlrd +import pandas as pd +import numpy as np +import glob +import os +import functools + +from wetb.hawc2.sel_file import SelFile +from wetb.functions.caching import cache_function +HOURS_PR_20YEAR = 20 * 365 * 24 + +def Weibull(u, k, start, stop, step): + C = 2 * u / np.sqrt(np.pi) + cdf = lambda x :-np.exp(-(x / C) ** k) + return {wsp:-cdf(wsp - step / 2) + cdf(wsp + step / 2) for wsp in np.arange(start, stop + step, step)} + + +class DLCHighLevel(object): + def __init__(self, filename): + self.filename = filename + wb = xlrd.open_workbook(self.filename) + + # Variables + sheet = wb.sheet_by_name("Variables") + for row_index in range(1, sheet.nrows): + name = str(sheet.cell(row_index, 0).value).lower() + value = sheet.cell(row_index, 1).value + setattr(self, name, value) + if not hasattr(self, "res_path"): + raise Warning("The 'Variables' sheet of '%s' must contain the variable 'res_path' specifying the path to the result folder" % self.filename) + self.res_path = os.path.join(os.path.dirname(self.filename), self.res_path) + + #DLC sheet + sheet = wb.sheet_by_name("DLC") + self.dlc_df = pd.DataFrame({sheet.cell(0, col_index).value.lower(): [sheet.cell(row_index, col_index).value for row_index in range(2, sheet.nrows) if sheet.cell(row_index, 0).value != ""] for col_index in range(sheet.ncols)}) + for k in ['name', 'load', 'wsp', 'wdir', 'dlc_dist', 'wsp_dist', 'wdir_dist']: + assert k.lower() in self.dlc_df.keys(), "DLC sheet must have a '%s' column" % k + self.dlc_df['name'] = [n.lower().replace("dlc", "") for n in self.dlc_df['name']] + if 'psf' not in self.dlc_df: + self.dlc_df['psf'] = 1 + + # Sensors sheet + sheet = wb.sheet_by_name("Sensors") + name_col_index = [sheet.cell(0, col_index).value.lower() for col_index in range(0, sheet.ncols)].index("name") + self.sensor_df = pd.DataFrame({sheet.cell(0, col_index).value.lower(): [sheet.cell(row_index, col_index).value for row_index in range(1, sheet.nrows) if sheet.cell(row_index, name_col_index).value != ""] for col_index in range(sheet.ncols)}) + for k in ['Name', 'Nr']: + assert k.lower() in self.sensor_df.keys(), "Sensor sheet must have a '%s' column" % k + assert not any(self.sensor_df['name'].duplicated()), "Duplicate sensor names: %s" % ",".join(self.sensor_df['name'][self.sensor_df['name'].duplicated()].values) + for k in ['description', 'unit', 'statistic', 'ultimate', 'fatigue', 'm', 'neql', 'extremeload', 'bearingdamage', 'mindistance', 'maxdistance']: + if k not in self.sensor_df.keys(): + self.sensor_df[k] = "" + for _, row in self.sensor_df[self.sensor_df['fatigue'] != ""].iterrows(): + assert isinstance(row['m'], (int, float)), "Invalid m-value for %s (m='%s')" % (row['name'], row['m']) + assert isinstance(row['neql'], (int, float)), "Invalid NeqL-value for %s (NeqL='%s')" % (row['name'], row['neql']) + for name, nrs in zip(self.sensor_info("extremeload").name, self.sensor_info("extremeload").nr): + assert (np.atleast_1d((eval(str(nrs)))).shape[0] == 6), "'Nr' for Extremeload-sensor '%s' must contain 6 sensors (Fx,Fy,Fz,Mx,My,Mz)" % name + + + def __str__(self): + return self.filename + + + def sensor_info(self, sensors=[]): + if sensors != []: + return self.sensor_df[functools.reduce(np.logical_or, [((self.sensor_df.get(f, np.array([""] * len(self.sensor_df.name))).values != "") | (self.sensor_df.name == f)) for f in np.atleast_1d(sensors)])] + else: + return self.sensor_df + + def dlc_variables(self, dlc): + dlc_row = self.dlc_df[self.dlc_df['name'] == dlc] + def get_lst(x): + if isinstance(x, pd.Series): + x = x.iloc[0] + if ":" in str(x): + start, step, stop = [float(eval(v, globals(), self.__dict__)) for v in x.lower().split(":")] + return list(np.arange(start, stop + step, step)) + else: + return [float(eval(v, globals(), self.__dict__)) for v in str(x).lower().replace("/", ",").split(",")] + wsp = get_lst(dlc_row['wsp']) + wdir = get_lst(dlc_row['wdir']) + return wsp, wdir + + def fatigue_distribution(self): + fatigue_dist = {} + data = self.dlc_df #[[sheet.cell(row_index, col_index).value for row_index in range(1, sheet.nrows)] for col_index in range(sheet.ncols)] + for i, load in enumerate(data['load']): + if "F" in str(load).upper(): + dlc = data['name'][i].lower().replace("dlc", "") + def fmt(v): + if "#" in str(v): + return v + else: + if v == "": + return 0 + else: + return float(v) / 100 + dlc_dist = fmt(data['dlc_dist'][i]) + wsp_dist = data['wsp_dist'][i] + wsp = data['wsp'][i] + if wsp_dist.lower() == "weibull" or wsp_dist.lower() == "rayleigh": + start, step, stop = [float(eval(v, globals(), self.__dict__)) for v in wsp.lower().split(":")] + wsp_dist = Weibull(self.vref * .2, 2, start, stop, step) + else: + wsp = [(eval(v, globals(), self.__dict__)) for v in str(wsp).lower().replace("/", ",").split(",")] + wsp_dist = [fmt(v) for v in str(wsp_dist).lower().replace("/", ",").split(",")] + assert len(wsp) == len(wsp_dist), "\nWsp: %s\nWsp_dist: %s" % (wsp , wsp_dist) + wsp_dist = {k:v for k, v in zip(wsp, wsp_dist)} + wdir_dist = [float(v) for v in str(data['wdir_dist'][i]).replace("/", ",").split(",")] + wdir = [float(v) for v in str(data['wdir'][i]).replace("/", ",").split(",")] + fatigue_dist[dlc] = (dlc_dist, wsp_dist, {k:v / 100 for k, v in zip(wdir, wdir_dist)}) + return fatigue_dist + + def file_hour_lst(self): + """Create a list of (filename, hours_pr_year) that can be used as input for LifeTimeEqLoad + + Returns + ------- + file_hour_lst : list + [(filename, hours),...] where\n + - filename is the name of the file, including path + - hours is the number of hours pr. 20 year of this file + """ + + fh_lst = [] + dlc_dict = self.fatigue_distribution() + for dlc_id in sorted(dlc_dict.keys()): + dlc_dist, wsp_dict, wdir_dict = dlc_dict[dlc_id] + for wsp in sorted(wsp_dict.keys()): + wsp_dist = wsp_dict[wsp] + for wdir in sorted(wdir_dict.keys()): + wdir_dist = wdir_dict[wdir] + if not hasattr(self, "res_folder"): + folder = "" + elif "%" in self.res_folder: + folder = self.res_folder % dlc_id + else: + folder = self.res_folder + files = glob.glob(os.path.join(self.res_path , folder, "dlc%s_wsp%02d_wdir%03d*.sel" % (dlc_id, wsp, wdir % 360))) + for f in sorted(files): + if "#" in str(dlc_dist): + duration = SelFile(f).duration + dlc_dist = float(dlc_dist[1:]) * duration / (60 * 60 * 24 * 365) + if "#" in str(wsp_dist): + total = sum([float(v[1:]) for v in wsp_dict.values()]) + wsp_dist = float(wsp_dist[1:]) / total + f_prob = dlc_dist * wsp_dist * wdir_dist / len(files) + f_hours_pr_20year = HOURS_PR_20YEAR * f_prob + fh_lst.append((f, f_hours_pr_20year)) + return fh_lst + + def dlc_lst(self, load='all'): + dlc_lst = np.array(self.dlc_df['name'])[np.array([load == 'all' or load.lower() in d.lower() for d in self.dlc_df['load']])] + return [v.lower().replace('dlc', '') for v in dlc_lst] + + @cache_function + def psf(self): + return {dlc.lower().replace('dlc', ''): float((psf, 1)[psf == ""]) for dlc, psf in zip(self.dlc_df['name'], self.dlc_df['psf']) if dlc != ""} + +if __name__ == "__main__": + dlc_hl = DLCHighLevel(r'X:\NREL5MW\dlc.xlsx') + #print (DLCHighLevelInputFile(r'C:\mmpe\Projects\DLC.xlsx').sensor_info(0, 0, 1)['Name']) + #print (dlc_dict()['64']) + #print (dlc_hl.fatigue_distribution()['64']) + print (dlc_hl.file_hour_lst(r"X:\NREL5MW/C0008/res/")) + + diff --git a/wetb/dlc/tests/test_files/DLC_test.xlsx b/wetb/dlc/tests/test_files/DLC_test.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..02ae074820efdf1a916648250cbf1fc2e8e01275 Binary files /dev/null and b/wetb/dlc/tests/test_files/DLC_test.xlsx differ diff --git a/wetb/dlc/tests/test_files/res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s3001.dat b/wetb/dlc/tests/test_files/res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s3001.dat new file mode 100644 index 0000000000000000000000000000000000000000..86f743f95787d3a863752558e7de74fa5401d8ea Binary files /dev/null and b/wetb/dlc/tests/test_files/res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s3001.dat differ diff --git a/wetb/dlc/tests/test_files/res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s3001.sel b/wetb/dlc/tests/test_files/res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s3001.sel new file mode 100644 index 0000000000000000000000000000000000000000..bc177ba729f0d4229efc2445a71514d38b10e122 --- /dev/null +++ b/wetb/dlc/tests/test_files/res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s3001.sel @@ -0,0 +1,288 @@ +________________________________________________________________________________________________________________________ + Version ID : HAWC2MB 11.8 + Time : 17:43:56 + Date : 26:09.2014 +________________________________________________________________________________________________________________________ + Result file : ./res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s3001.dat +________________________________________________________________________________________________________________________ + Scans Channels Time [sec] Format + 30000 137 600.000 BINARY + + Channel Variable Description + + 1 Time s Time + 2 bea1 angle deg shaft_rot angle + 3 bea1 angle_speed rpm shaft_rot angle speed + 4 bea1 angle deg pitch1 angle + 5 bea1 angle_speed deg/s pitch1 angle speed + 6 bea1 angle deg pitch2 angle + 7 bea1 angle_speed deg/s pitch2 angle speed + 8 bea1 angle deg pitch3 angle + 9 bea1 angle_speed deg/s pitch3 angle speed + 10 Omega rad/s Rotor speed + 11 Ae rot. torque kNm Aero rotor torque + 12 Ae rot. power kW Aero rotor power + 13 Ae rot. thrust kN Aero rotor thrust + 14 WSP gl. coo.,Vx m/s Free wind speed Vx, gl. coo, of gl. pos 0.00, 0.00, -90.00 + 15 WSP gl. coo.,Vy m/s Free wind speed Vy, gl. coo, of gl. pos 0.00, 0.00, -90.00 + 16 WSP gl. coo.,Vz m/s Free wind speed Vz, gl. coo, of gl. pos 0.00, 0.00, -90.00 + 17 Mx coo: tower kNm MomentMx Mbdy:tower nodenr: 1 coo: tower tower base + 18 My coo: tower kNm MomentMy Mbdy:tower nodenr: 1 coo: tower tower base + 19 Mz coo: tower kNm MomentMz Mbdy:tower nodenr: 1 coo: tower tower base + 20 Mx coo: tower kNm MomentMx Mbdy:tower nodenr: 8 coo: tower yaw bearing + 21 My coo: tower kNm MomentMy Mbdy:tower nodenr: 8 coo: tower yaw bearing + 22 Mz coo: tower kNm MomentMz Mbdy:tower nodenr: 8 coo: tower yaw bearing + 23 Mx coo: shaft kNm MomentMx Mbdy:shaft nodenr: 4 coo: shaft main bearing + 24 My coo: shaft kNm MomentMy Mbdy:shaft nodenr: 4 coo: shaft main bearing + 25 Mz coo: shaft kNm MomentMz Mbdy:shaft nodenr: 4 coo: shaft main bearing + 26 Mx coo: blade1 kNm MomentMx Mbdy:blade1 nodenr: 3 coo: blade1 blade 1 root + 27 My coo: blade1 kNm MomentMy Mbdy:blade1 nodenr: 3 coo: blade1 blade 1 root + 28 Mz coo: blade1 kNm MomentMz Mbdy:blade1 nodenr: 3 coo: blade1 blade 1 root + 29 Mx coo: local kNm MomentMx Mbdy:blade1 nodenr: 10 coo: local blade 1 50% local e coo + 30 My coo: local kNm MomentMy Mbdy:blade1 nodenr: 10 coo: local blade 1 50% local e coo + 31 Mz coo: local kNm MomentMz Mbdy:blade1 nodenr: 10 coo: local blade 1 50% local e coo + 32 Mx coo: blade2 kNm MomentMx Mbdy:blade2 nodenr: 3 coo: blade2 blade 2 root + 33 My coo: blade2 kNm MomentMy Mbdy:blade2 nodenr: 3 coo: blade2 blade 2 root + 34 Mz coo: blade2 kNm MomentMz Mbdy:blade2 nodenr: 3 coo: blade2 blade 2 root + 35 Mx coo: local kNm MomentMx Mbdy:blade2 nodenr: 10 coo: local blade 2 50% local e coo + 36 My coo: local kNm MomentMy Mbdy:blade2 nodenr: 10 coo: local blade 2 50% local e coo + 37 Mz coo: local kNm MomentMz Mbdy:blade2 nodenr: 10 coo: local blade 2 50% local e coo + 38 Mx coo: blade3 kNm MomentMx Mbdy:blade3 nodenr: 3 coo: blade3 blade 3 root + 39 My coo: blade3 kNm MomentMy Mbdy:blade3 nodenr: 3 coo: blade3 blade 3 root + 40 Mz coo: blade3 kNm MomentMz Mbdy:blade3 nodenr: 3 coo: blade3 blade 3 root + 41 Mx coo: local kNm MomentMx Mbdy:blade3 nodenr: 10 coo: local blade 3 50% local e coo + 42 My coo: local kNm MomentMy Mbdy:blade3 nodenr: 10 coo: local blade 3 50% local e coo + 43 Mz coo: local kNm MomentMz Mbdy:blade3 nodenr: 10 coo: local blade 3 50% local e coo + 44 State pos x coo: global m State pos x Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 45 State pos y coo: global m State pos y Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 46 State pos z coo: global m State pos z Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 47 State acc x coo: global m/s^2 State acc x Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 48 State acc y coo: global m/s^2 State acc y Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 49 State acc z coo: global m/s^2 State acc z Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 50 State pos x coo: global m State pos x Mbdy:tower E-nr: 3 Z-rel:1.00 coo: global tower approx tip height + 51 State pos y coo: global m State pos y Mbdy:tower E-nr: 3 Z-rel:1.00 coo: global tower approx tip height + 52 State pos z coo: global m State pos z Mbdy:tower E-nr: 3 Z-rel:1.00 coo: global tower approx tip height + 53 State pos x coo: blade1 m State pos x Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: blade1 blade 1 tip pos + 54 State pos y coo: blade1 m State pos y Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: blade1 blade 1 tip pos + 55 State pos z coo: blade1 m State pos z Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: blade1 blade 1 tip pos + 56 State pos x coo: blade2 m State pos x Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: blade2 blade 2 tip pos + 57 State pos y coo: blade2 m State pos y Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: blade2 blade 2 tip pos + 58 State pos z coo: blade2 m State pos z Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: blade2 blade 2 tip pos + 59 State pos x coo: blade3 m State pos x Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: blade3 blade 3 tip pos + 60 State pos y coo: blade3 m State pos y Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: blade3 blade 3 tip pos + 61 State pos z coo: blade3 m State pos z Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: blade3 blade 3 tip pos + 62 State pos x coo: global m State pos x Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: global blade 1 tip pos + 63 State pos y coo: global m State pos y Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: global blade 1 tip pos + 64 State pos z coo: global m State pos z Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: global blade 1 tip pos + 65 State pos x coo: global m State pos x Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: global blade 2 tip pos + 66 State pos y coo: global m State pos y Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: global blade 2 tip pos + 67 State pos z coo: global m State pos z Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: global blade 2 tip pos + 68 State pos x coo: global m State pos x Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: global blade 3 tip pos + 69 State pos y coo: global m State pos y Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: global blade 3 tip pos + 70 State pos z coo: global m State pos z Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: global blade 3 tip pos + 71 WSP Vx, glco, R= 61.5 m/s Wind speed Vx of blade 1 at radius 61.52, global coo. + 72 WSP Vy, glco, R= 61.5 m/s Wind speed Vy of blade 1 at radius 61.52, global coo. + 73 WSP Vz, glco, R= 61.5 m/s Wind speed Vz of blade 1 at radius 61.52, global coo. + 74 Alfa, R= 45.0 deg Angle of attack of blade 1 at radius 45.17 + 75 Alfa, R= 45.0 deg Angle of attack of blade 2 at radius 45.17 + 76 Alfa, R= 45.0 deg Angle of attack of blade 3 at radius 45.17 + 77 Cl, R= 45.0 deg Cl of blade 1 at radius 45.17 + 78 Cl, R= 45.0 deg Cl of blade 2 at radius 45.17 + 79 Cl, R= 45.0 deg Cl of blade 3 at radius 45.17 + 80 DLL out 1: 1 - DLL : 1 outvec : 1 time + 81 DLL out 1: 2 - DLL : 1 outvec : 2 slow speed shaft rad/s + 82 DLL out 1: 3 - DLL : 1 outvec : 3 pitch angle 1 + 83 DLL out 1: 4 - DLL : 1 outvec : 4 pitch angle 2 + 84 DLL out 1: 5 - DLL : 1 outvec : 5 pitch angle 3 + 85 DLL out 1: 6 - DLL : 1 outvec : 6 wsp_x_global + 86 DLL out 1: 7 - DLL : 1 outvec : 7 wsp_y_global + 87 DLL out 1: 8 - DLL : 1 outvec : 8 wsp_z_global + 88 DLL out 1: 9 - DLL : 1 outvec : 9 elec. pwr + 89 DLL out 1: 10 - DLL : 1 outvec : 10 grid flag + 90 DLL inp 1: 1 - DLL : 1 inpvec : 1 generator torque reference [nm] + 91 DLL inp 1: 2 - DLL : 1 inpvec : 2 pitch angle reference of blade 1 [rad] + 92 DLL inp 1: 3 - DLL : 1 inpvec : 3 pitch angle reference of blade 2 [rad] + 93 DLL inp 1: 4 - DLL : 1 inpvec : 4 pitch angle reference of blade 3 [rad] + 94 DLL inp 1: 5 - DLL : 1 inpvec : 5 power reference [w] + 95 DLL inp 1: 6 - DLL : 1 inpvec : 6 filtered wind speed [m/s] + 96 DLL inp 1: 7 - DLL : 1 inpvec : 7 filtered rotor speed [rad/s] + 97 DLL inp 1: 8 - DLL : 1 inpvec : 8 filtered rotor speed error for torque [rad/s] + 98 DLL inp 1: 9 - DLL : 1 inpvec : 9 bandpass filtered rotor speed [rad/s] + 99 DLL inp 1: 10 - DLL : 1 inpvec : 10 proportional term of torque contr. [nm] + 100 DLL inp 1: 11 - DLL : 1 inpvec : 11 integral term of torque controller [nm] + 101 DLL inp 1: 12 - DLL : 1 inpvec : 12 minimum limit of torque [nm] + 102 DLL inp 1: 13 - DLL : 1 inpvec : 13 maximum limit of torque [nm] + 103 DLL inp 1: 14 - DLL : 1 inpvec : 14 torque limit switch based on pitch [-] + 104 DLL inp 1: 15 - DLL : 1 inpvec : 15 filtered rotor speed error for pitch [rad/s] + 105 DLL inp 1: 16 - DLL : 1 inpvec : 16 power error for pitch [w] + 106 DLL inp 1: 17 - DLL : 1 inpvec : 17 proportional term of pitch controller [rad] + 107 DLL inp 1: 18 - DLL : 1 inpvec : 18 integral term of pitch controller [rad] + 108 DLL inp 1: 19 - DLL : 1 inpvec : 19 minimum limit of pitch [rad] + 109 DLL inp 1: 20 - DLL : 1 inpvec : 20 maximum limit of pitch [rad] + 110 DLL inp 1: 21 - DLL : 1 inpvec : 21 torque reference from dt dammper [nm] + 111 DLL inp 1: 22 - DLL : 1 inpvec : 22 status signal [-] + 112 DLL inp 1: 23 - DLL : 1 inpvec : 23 total added pitch rate [rad/s] + 113 DLL inp 1: 25 - DLL : 1 inpvec : 25 flag for mechnical brake [0=off/1=on] + 114 DLL inp 1: 26 - DLL : 1 inpvec : 26 flag for emergency pitch stop [0=off/1=on] + 115 DLL out 2: 1 - DLL : 2 outvec : 1 time + 116 DLL out 2: 2 - DLL : 2 outvec : 2 electrical torque reference [nm] + 117 DLL out 2: 3 - DLL : 2 outvec : 3 omega lss + 118 DLL inp 2: 1 - DLL : 2 inpvec : 1 mgen lss [nm] + 119 DLL inp 2: 2 - DLL : 2 inpvec : 2 pelec w + 120 DLL inp 2: 3 - DLL : 2 inpvec : 3 mframe + 121 DLL inp 2: 4 - DLL : 2 inpvec : 4 mgen hss + 122 DLL inp 2: 5 - DLL : 2 inpvec : 5 generator pmech kw + 123 DLL inp 2: 6 - DLL : 2 inpvec : 6 filtered gen speed + 124 DLL inp 2: 7 - DLL : 2 inpvec : 7 elec. pwr + 125 DLL inp 2: 8 - DLL : 2 inpvec : 8 grid flag + 126 DLL inp 3: 1 - DLL : 3 inpvec : 1 brake torque [nm] + 127 DLL out 3: 1 - DLL : 3 outvec : 1 time [s] + 128 DLL out 3: 2 - DLL : 3 outvec : 2 generator lss speed [rad/s] + 129 DLL out 3: 3 - DLL : 3 outvec : 3 deploy brake + 130 DLL out 4: 1 - DLL : 4 outvec : 1 time + 131 DLL out 4: 2 - DLL : 4 outvec : 2 pitchref 1 + 132 DLL out 4: 3 - DLL : 4 outvec : 3 pitchref 2 + 133 DLL out 4: 4 - DLL : 4 outvec : 4 pitchref 3 + 134 DLL out 4: 5 - DLL : 4 outvec : 5 emerg. stop + 135 DLL inp 4: 1 - DLL : 4 inpvec : 1 pitch 1 + 136 DLL inp 4: 2 - DLL : 4 inpvec : 2 pitch 2 + 137 DLL inp 4: 3 - DLL : 4 inpvec : 3 pitch 3 +________________________________________________________________________________________________________________________ +Scale factors: + 2.18750E-02 + 1.12498E-02 + 2.18636E-04 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 2.28532E-05 + 3.13599E-02 + 2.27484E-02 + 5.73713E-03 + 1.15515E-04 + 2.40756E-04 + 6.23275E-05 + 1.11306E+00 + 5.08507E-01 + 8.64416E-02 + 1.01068E-01 + 3.17092E-02 + 8.61685E-02 + 1.40286E-01 + 1.43956E-01 + 2.38998E-02 + 1.13235E-01 + 1.02102E-01 + 1.50253E-03 + 3.53141E-02 + 1.88099E-02 + 7.98218E-04 + 1.20270E-01 + 1.01277E-01 + 1.50009E-03 + 3.83268E-02 + 1.90180E-02 + 8.10642E-04 + 1.08378E-01 + 1.01415E-01 + 1.47277E-03 + 3.48370E-02 + 1.87840E-02 + 7.77792E-04 + 3.24309E-06 + 6.83608E-06 + 2.73736E-03 + 1.36118E-05 + 2.45856E-05 + 1.15138E-07 + 3.94253E-07 + 8.58154E-07 + 9.37454E-04 + 2.20391E-05 + 7.50926E-05 + 1.92189E-03 + 2.27469E-05 + 8.16279E-05 + 1.92185E-03 + 2.16108E-05 + 7.26739E-05 + 1.92190E-03 + 1.97076E-03 + 4.09314E-04 + 4.77864E-03 + 1.97100E-03 + 4.01846E-04 + 4.77841E-03 + 1.97071E-03 + 4.10716E-04 + 4.77889E-03 + 1.35009E-04 + 2.53494E-04 + 8.32807E-05 + 2.38630E-04 + 2.60029E-04 + 2.12999E-04 + 3.58159E-05 + 3.73508E-05 + 3.42983E-05 + 2.18750E-02 + 2.28955E-05 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.15515E-04 + 2.40756E-04 + 6.23275E-05 + 1.55135E+01 + 1.00000E+00 + 2.14205E+01 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.55185E+01 + 1.99803E-04 + 2.28158E-05 + 2.35485E-07 + 1.00000E+00 + 4.54852E+00 + 1.89358E+01 + 3.69236E+00 + 3.91993E+01 + 1.00000E+00 + 1.71933E-05 + 1.56251E+02 + 3.61163E-05 + 3.58929E-05 + 1.00000E+00 + 4.58149E-05 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 2.18750E-02 + 2.14205E+01 + 2.28955E-05 + 2.26911E+01 + 1.55135E+01 + 2.24572E+01 + 2.33929E-01 + 1.64338E-02 + 2.38998E+01 + 2.95000E-05 + 1.00000E+00 + 1.00000E+00 + 2.18750E-02 + 2.28955E-05 + 1.00000E+00 + 2.18750E-02 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 diff --git a/wetb/dlc/tests/test_files/res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s4001.dat b/wetb/dlc/tests/test_files/res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s4001.dat new file mode 100644 index 0000000000000000000000000000000000000000..0a8609899136692874ee5f572ebe7116a56b0fe7 Binary files /dev/null and b/wetb/dlc/tests/test_files/res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s4001.dat differ diff --git a/wetb/dlc/tests/test_files/res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s4001.sel b/wetb/dlc/tests/test_files/res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s4001.sel new file mode 100644 index 0000000000000000000000000000000000000000..63848843cb7b30235d6897fac972e21bddea464a --- /dev/null +++ b/wetb/dlc/tests/test_files/res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s4001.sel @@ -0,0 +1,288 @@ +________________________________________________________________________________________________________________________ + Version ID : HAWC2MB 11.8 + Time : 16:55:19 + Date : 26:09.2014 +________________________________________________________________________________________________________________________ + Result file : ./res/dlc12_iec61400-1ed3/dlc12_wsp04_wdir350_s4001.dat +________________________________________________________________________________________________________________________ + Scans Channels Time [sec] Format + 30000 137 600.000 BINARY + + Channel Variable Description + + 1 Time s Time + 2 bea1 angle deg shaft_rot angle + 3 bea1 angle_speed rpm shaft_rot angle speed + 4 bea1 angle deg pitch1 angle + 5 bea1 angle_speed deg/s pitch1 angle speed + 6 bea1 angle deg pitch2 angle + 7 bea1 angle_speed deg/s pitch2 angle speed + 8 bea1 angle deg pitch3 angle + 9 bea1 angle_speed deg/s pitch3 angle speed + 10 Omega rad/s Rotor speed + 11 Ae rot. torque kNm Aero rotor torque + 12 Ae rot. power kW Aero rotor power + 13 Ae rot. thrust kN Aero rotor thrust + 14 WSP gl. coo.,Vx m/s Free wind speed Vx, gl. coo, of gl. pos 0.00, 0.00, -90.00 + 15 WSP gl. coo.,Vy m/s Free wind speed Vy, gl. coo, of gl. pos 0.00, 0.00, -90.00 + 16 WSP gl. coo.,Vz m/s Free wind speed Vz, gl. coo, of gl. pos 0.00, 0.00, -90.00 + 17 Mx coo: tower kNm MomentMx Mbdy:tower nodenr: 1 coo: tower tower base + 18 My coo: tower kNm MomentMy Mbdy:tower nodenr: 1 coo: tower tower base + 19 Mz coo: tower kNm MomentMz Mbdy:tower nodenr: 1 coo: tower tower base + 20 Mx coo: tower kNm MomentMx Mbdy:tower nodenr: 8 coo: tower yaw bearing + 21 My coo: tower kNm MomentMy Mbdy:tower nodenr: 8 coo: tower yaw bearing + 22 Mz coo: tower kNm MomentMz Mbdy:tower nodenr: 8 coo: tower yaw bearing + 23 Mx coo: shaft kNm MomentMx Mbdy:shaft nodenr: 4 coo: shaft main bearing + 24 My coo: shaft kNm MomentMy Mbdy:shaft nodenr: 4 coo: shaft main bearing + 25 Mz coo: shaft kNm MomentMz Mbdy:shaft nodenr: 4 coo: shaft main bearing + 26 Mx coo: blade1 kNm MomentMx Mbdy:blade1 nodenr: 3 coo: blade1 blade 1 root + 27 My coo: blade1 kNm MomentMy Mbdy:blade1 nodenr: 3 coo: blade1 blade 1 root + 28 Mz coo: blade1 kNm MomentMz Mbdy:blade1 nodenr: 3 coo: blade1 blade 1 root + 29 Mx coo: local kNm MomentMx Mbdy:blade1 nodenr: 10 coo: local blade 1 50% local e coo + 30 My coo: local kNm MomentMy Mbdy:blade1 nodenr: 10 coo: local blade 1 50% local e coo + 31 Mz coo: local kNm MomentMz Mbdy:blade1 nodenr: 10 coo: local blade 1 50% local e coo + 32 Mx coo: blade2 kNm MomentMx Mbdy:blade2 nodenr: 3 coo: blade2 blade 2 root + 33 My coo: blade2 kNm MomentMy Mbdy:blade2 nodenr: 3 coo: blade2 blade 2 root + 34 Mz coo: blade2 kNm MomentMz Mbdy:blade2 nodenr: 3 coo: blade2 blade 2 root + 35 Mx coo: local kNm MomentMx Mbdy:blade2 nodenr: 10 coo: local blade 2 50% local e coo + 36 My coo: local kNm MomentMy Mbdy:blade2 nodenr: 10 coo: local blade 2 50% local e coo + 37 Mz coo: local kNm MomentMz Mbdy:blade2 nodenr: 10 coo: local blade 2 50% local e coo + 38 Mx coo: blade3 kNm MomentMx Mbdy:blade3 nodenr: 3 coo: blade3 blade 3 root + 39 My coo: blade3 kNm MomentMy Mbdy:blade3 nodenr: 3 coo: blade3 blade 3 root + 40 Mz coo: blade3 kNm MomentMz Mbdy:blade3 nodenr: 3 coo: blade3 blade 3 root + 41 Mx coo: local kNm MomentMx Mbdy:blade3 nodenr: 10 coo: local blade 3 50% local e coo + 42 My coo: local kNm MomentMy Mbdy:blade3 nodenr: 10 coo: local blade 3 50% local e coo + 43 Mz coo: local kNm MomentMz Mbdy:blade3 nodenr: 10 coo: local blade 3 50% local e coo + 44 State pos x coo: global m State pos x Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 45 State pos y coo: global m State pos y Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 46 State pos z coo: global m State pos z Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 47 State acc x coo: global m/s^2 State acc x Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 48 State acc y coo: global m/s^2 State acc y Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 49 State acc z coo: global m/s^2 State acc z Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 50 State pos x coo: global m State pos x Mbdy:tower E-nr: 3 Z-rel:1.00 coo: global tower approx tip height + 51 State pos y coo: global m State pos y Mbdy:tower E-nr: 3 Z-rel:1.00 coo: global tower approx tip height + 52 State pos z coo: global m State pos z Mbdy:tower E-nr: 3 Z-rel:1.00 coo: global tower approx tip height + 53 State pos x coo: blade1 m State pos x Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: blade1 blade 1 tip pos + 54 State pos y coo: blade1 m State pos y Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: blade1 blade 1 tip pos + 55 State pos z coo: blade1 m State pos z Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: blade1 blade 1 tip pos + 56 State pos x coo: blade2 m State pos x Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: blade2 blade 2 tip pos + 57 State pos y coo: blade2 m State pos y Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: blade2 blade 2 tip pos + 58 State pos z coo: blade2 m State pos z Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: blade2 blade 2 tip pos + 59 State pos x coo: blade3 m State pos x Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: blade3 blade 3 tip pos + 60 State pos y coo: blade3 m State pos y Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: blade3 blade 3 tip pos + 61 State pos z coo: blade3 m State pos z Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: blade3 blade 3 tip pos + 62 State pos x coo: global m State pos x Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: global blade 1 tip pos + 63 State pos y coo: global m State pos y Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: global blade 1 tip pos + 64 State pos z coo: global m State pos z Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: global blade 1 tip pos + 65 State pos x coo: global m State pos x Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: global blade 2 tip pos + 66 State pos y coo: global m State pos y Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: global blade 2 tip pos + 67 State pos z coo: global m State pos z Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: global blade 2 tip pos + 68 State pos x coo: global m State pos x Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: global blade 3 tip pos + 69 State pos y coo: global m State pos y Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: global blade 3 tip pos + 70 State pos z coo: global m State pos z Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: global blade 3 tip pos + 71 WSP Vx, glco, R= 61.5 m/s Wind speed Vx of blade 1 at radius 61.52, global coo. + 72 WSP Vy, glco, R= 61.5 m/s Wind speed Vy of blade 1 at radius 61.52, global coo. + 73 WSP Vz, glco, R= 61.5 m/s Wind speed Vz of blade 1 at radius 61.52, global coo. + 74 Alfa, R= 45.0 deg Angle of attack of blade 1 at radius 45.17 + 75 Alfa, R= 45.0 deg Angle of attack of blade 2 at radius 45.17 + 76 Alfa, R= 45.0 deg Angle of attack of blade 3 at radius 45.17 + 77 Cl, R= 45.0 deg Cl of blade 1 at radius 45.17 + 78 Cl, R= 45.0 deg Cl of blade 2 at radius 45.17 + 79 Cl, R= 45.0 deg Cl of blade 3 at radius 45.17 + 80 DLL out 1: 1 - DLL : 1 outvec : 1 time + 81 DLL out 1: 2 - DLL : 1 outvec : 2 slow speed shaft rad/s + 82 DLL out 1: 3 - DLL : 1 outvec : 3 pitch angle 1 + 83 DLL out 1: 4 - DLL : 1 outvec : 4 pitch angle 2 + 84 DLL out 1: 5 - DLL : 1 outvec : 5 pitch angle 3 + 85 DLL out 1: 6 - DLL : 1 outvec : 6 wsp_x_global + 86 DLL out 1: 7 - DLL : 1 outvec : 7 wsp_y_global + 87 DLL out 1: 8 - DLL : 1 outvec : 8 wsp_z_global + 88 DLL out 1: 9 - DLL : 1 outvec : 9 elec. pwr + 89 DLL out 1: 10 - DLL : 1 outvec : 10 grid flag + 90 DLL inp 1: 1 - DLL : 1 inpvec : 1 generator torque reference [nm] + 91 DLL inp 1: 2 - DLL : 1 inpvec : 2 pitch angle reference of blade 1 [rad] + 92 DLL inp 1: 3 - DLL : 1 inpvec : 3 pitch angle reference of blade 2 [rad] + 93 DLL inp 1: 4 - DLL : 1 inpvec : 4 pitch angle reference of blade 3 [rad] + 94 DLL inp 1: 5 - DLL : 1 inpvec : 5 power reference [w] + 95 DLL inp 1: 6 - DLL : 1 inpvec : 6 filtered wind speed [m/s] + 96 DLL inp 1: 7 - DLL : 1 inpvec : 7 filtered rotor speed [rad/s] + 97 DLL inp 1: 8 - DLL : 1 inpvec : 8 filtered rotor speed error for torque [rad/s] + 98 DLL inp 1: 9 - DLL : 1 inpvec : 9 bandpass filtered rotor speed [rad/s] + 99 DLL inp 1: 10 - DLL : 1 inpvec : 10 proportional term of torque contr. [nm] + 100 DLL inp 1: 11 - DLL : 1 inpvec : 11 integral term of torque controller [nm] + 101 DLL inp 1: 12 - DLL : 1 inpvec : 12 minimum limit of torque [nm] + 102 DLL inp 1: 13 - DLL : 1 inpvec : 13 maximum limit of torque [nm] + 103 DLL inp 1: 14 - DLL : 1 inpvec : 14 torque limit switch based on pitch [-] + 104 DLL inp 1: 15 - DLL : 1 inpvec : 15 filtered rotor speed error for pitch [rad/s] + 105 DLL inp 1: 16 - DLL : 1 inpvec : 16 power error for pitch [w] + 106 DLL inp 1: 17 - DLL : 1 inpvec : 17 proportional term of pitch controller [rad] + 107 DLL inp 1: 18 - DLL : 1 inpvec : 18 integral term of pitch controller [rad] + 108 DLL inp 1: 19 - DLL : 1 inpvec : 19 minimum limit of pitch [rad] + 109 DLL inp 1: 20 - DLL : 1 inpvec : 20 maximum limit of pitch [rad] + 110 DLL inp 1: 21 - DLL : 1 inpvec : 21 torque reference from dt dammper [nm] + 111 DLL inp 1: 22 - DLL : 1 inpvec : 22 status signal [-] + 112 DLL inp 1: 23 - DLL : 1 inpvec : 23 total added pitch rate [rad/s] + 113 DLL inp 1: 25 - DLL : 1 inpvec : 25 flag for mechnical brake [0=off/1=on] + 114 DLL inp 1: 26 - DLL : 1 inpvec : 26 flag for emergency pitch stop [0=off/1=on] + 115 DLL out 2: 1 - DLL : 2 outvec : 1 time + 116 DLL out 2: 2 - DLL : 2 outvec : 2 electrical torque reference [nm] + 117 DLL out 2: 3 - DLL : 2 outvec : 3 omega lss + 118 DLL inp 2: 1 - DLL : 2 inpvec : 1 mgen lss [nm] + 119 DLL inp 2: 2 - DLL : 2 inpvec : 2 pelec w + 120 DLL inp 2: 3 - DLL : 2 inpvec : 3 mframe + 121 DLL inp 2: 4 - DLL : 2 inpvec : 4 mgen hss + 122 DLL inp 2: 5 - DLL : 2 inpvec : 5 generator pmech kw + 123 DLL inp 2: 6 - DLL : 2 inpvec : 6 filtered gen speed + 124 DLL inp 2: 7 - DLL : 2 inpvec : 7 elec. pwr + 125 DLL inp 2: 8 - DLL : 2 inpvec : 8 grid flag + 126 DLL inp 3: 1 - DLL : 3 inpvec : 1 brake torque [nm] + 127 DLL out 3: 1 - DLL : 3 outvec : 1 time [s] + 128 DLL out 3: 2 - DLL : 3 outvec : 2 generator lss speed [rad/s] + 129 DLL out 3: 3 - DLL : 3 outvec : 3 deploy brake + 130 DLL out 4: 1 - DLL : 4 outvec : 1 time + 131 DLL out 4: 2 - DLL : 4 outvec : 2 pitchref 1 + 132 DLL out 4: 3 - DLL : 4 outvec : 3 pitchref 2 + 133 DLL out 4: 4 - DLL : 4 outvec : 4 pitchref 3 + 134 DLL out 4: 5 - DLL : 4 outvec : 5 emerg. stop + 135 DLL inp 4: 1 - DLL : 4 inpvec : 1 pitch 1 + 136 DLL inp 4: 2 - DLL : 4 inpvec : 2 pitch 2 + 137 DLL inp 4: 3 - DLL : 4 inpvec : 3 pitch 3 +________________________________________________________________________________________________________________________ +Scale factors: + 2.18750E-02 + 1.12498E-02 + 2.19138E-04 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 2.29111E-05 + 4.63331E-02 + 3.35193E-02 + 7.38630E-03 + 1.02420E-04 + 2.26197E-04 + 6.99822E-05 + 1.25546E+00 + 6.10768E-01 + 1.23671E-01 + 1.02073E-01 + 4.39042E-02 + 1.23414E-01 + 1.34985E-01 + 1.40241E-01 + 3.44742E-02 + 1.28033E-01 + 1.10615E-01 + 1.35665E-03 + 4.43491E-02 + 1.92483E-02 + 7.61245E-04 + 1.35394E-01 + 1.13591E-01 + 1.40935E-03 + 4.55200E-02 + 2.03161E-02 + 6.64117E-04 + 1.24917E-01 + 1.07065E-01 + 1.37461E-03 + 4.31240E-02 + 1.90637E-02 + 7.21858E-04 + 3.90320E-06 + 7.97756E-06 + 2.73736E-03 + 1.61200E-05 + 2.82396E-05 + 1.45970E-07 + 4.73941E-07 + 9.71200E-07 + 9.37454E-04 + 2.56777E-05 + 9.20533E-05 + 1.92185E-03 + 2.68336E-05 + 9.43824E-05 + 1.92184E-03 + 2.53346E-05 + 8.90607E-05 + 1.92188E-03 + 1.97127E-03 + 4.02692E-04 + 4.77849E-03 + 1.97134E-03 + 4.00361E-04 + 4.77801E-03 + 1.97109E-03 + 4.07428E-04 + 4.77854E-03 + 1.39631E-04 + 2.59576E-04 + 9.32767E-05 + 3.10257E-04 + 3.19075E-04 + 2.69427E-04 + 4.28413E-05 + 4.34555E-05 + 4.02817E-05 + 2.18750E-02 + 2.29481E-05 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.02420E-04 + 2.26197E-04 + 6.99822E-05 + 2.28560E+01 + 1.00000E+00 + 3.17334E+01 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 2.28661E+01 + 1.76720E-04 + 2.28417E-05 + 2.61397E-07 + 1.00000E+00 + 5.04901E+00 + 2.94025E+01 + 4.48361E+00 + 3.91993E+01 + 1.00000E+00 + 1.72579E-05 + 1.56251E+02 + 3.63568E-05 + 3.61336E-05 + 1.00000E+00 + 4.58149E-05 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 2.18750E-02 + 3.17334E+01 + 2.29481E-05 + 3.36158E+01 + 2.28560E+01 + 3.32692E+01 + 3.46554E-01 + 2.42118E-02 + 3.44742E+01 + 2.95000E-05 + 1.00000E+00 + 1.00000E+00 + 2.18750E-02 + 2.29481E-05 + 1.00000E+00 + 2.18750E-02 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 diff --git a/wetb/dlc/tests/test_files/res/dlc31_iec61400-1ed3/dlc31_wsp25_wdir000_s0000.dat b/wetb/dlc/tests/test_files/res/dlc31_iec61400-1ed3/dlc31_wsp25_wdir000_s0000.dat new file mode 100644 index 0000000000000000000000000000000000000000..d05fc13d65f55e1c49e3e4dff9e2429eabe32b9d Binary files /dev/null and b/wetb/dlc/tests/test_files/res/dlc31_iec61400-1ed3/dlc31_wsp25_wdir000_s0000.dat differ diff --git a/wetb/dlc/tests/test_files/res/dlc31_iec61400-1ed3/dlc31_wsp25_wdir000_s0000.sel b/wetb/dlc/tests/test_files/res/dlc31_iec61400-1ed3/dlc31_wsp25_wdir000_s0000.sel new file mode 100644 index 0000000000000000000000000000000000000000..7da7358bb032e6d1c2eb3a21795fca33a9110968 --- /dev/null +++ b/wetb/dlc/tests/test_files/res/dlc31_iec61400-1ed3/dlc31_wsp25_wdir000_s0000.sel @@ -0,0 +1,288 @@ +________________________________________________________________________________________________________________________ + Version ID : HAWC2MB 11.8 + Time : 21:00:03 + Date : 25:09.2014 +________________________________________________________________________________________________________________________ + Result file : ./res/dlc31_iec61400-1ed3/dlc31_wsp25_wdir000_s0000.dat +________________________________________________________________________________________________________________________ + Scans Channels Time [sec] Format + 12500 137 250.000 BINARY + + Channel Variable Description + + 1 Time s Time + 2 bea1 angle deg shaft_rot angle + 3 bea1 angle_speed rpm shaft_rot angle speed + 4 bea1 angle deg pitch1 angle + 5 bea1 angle_speed deg/s pitch1 angle speed + 6 bea1 angle deg pitch2 angle + 7 bea1 angle_speed deg/s pitch2 angle speed + 8 bea1 angle deg pitch3 angle + 9 bea1 angle_speed deg/s pitch3 angle speed + 10 Omega rad/s Rotor speed + 11 Ae rot. torque kNm Aero rotor torque + 12 Ae rot. power kW Aero rotor power + 13 Ae rot. thrust kN Aero rotor thrust + 14 WSP gl. coo.,Vx m/s Free wind speed Vx, gl. coo, of gl. pos 0.00, 0.00, -90.00 + 15 WSP gl. coo.,Vy m/s Free wind speed Vy, gl. coo, of gl. pos 0.00, 0.00, -90.00 + 16 WSP gl. coo.,Vz m/s Free wind speed Vz, gl. coo, of gl. pos 0.00, 0.00, -90.00 + 17 Mx coo: tower kNm MomentMx Mbdy:tower nodenr: 1 coo: tower tower base + 18 My coo: tower kNm MomentMy Mbdy:tower nodenr: 1 coo: tower tower base + 19 Mz coo: tower kNm MomentMz Mbdy:tower nodenr: 1 coo: tower tower base + 20 Mx coo: tower kNm MomentMx Mbdy:tower nodenr: 8 coo: tower yaw bearing + 21 My coo: tower kNm MomentMy Mbdy:tower nodenr: 8 coo: tower yaw bearing + 22 Mz coo: tower kNm MomentMz Mbdy:tower nodenr: 8 coo: tower yaw bearing + 23 Mx coo: shaft kNm MomentMx Mbdy:shaft nodenr: 4 coo: shaft main bearing + 24 My coo: shaft kNm MomentMy Mbdy:shaft nodenr: 4 coo: shaft main bearing + 25 Mz coo: shaft kNm MomentMz Mbdy:shaft nodenr: 4 coo: shaft main bearing + 26 Mx coo: blade1 kNm MomentMx Mbdy:blade1 nodenr: 3 coo: blade1 blade 1 root + 27 My coo: blade1 kNm MomentMy Mbdy:blade1 nodenr: 3 coo: blade1 blade 1 root + 28 Mz coo: blade1 kNm MomentMz Mbdy:blade1 nodenr: 3 coo: blade1 blade 1 root + 29 Mx coo: local kNm MomentMx Mbdy:blade1 nodenr: 10 coo: local blade 1 50% local e coo + 30 My coo: local kNm MomentMy Mbdy:blade1 nodenr: 10 coo: local blade 1 50% local e coo + 31 Mz coo: local kNm MomentMz Mbdy:blade1 nodenr: 10 coo: local blade 1 50% local e coo + 32 Mx coo: blade2 kNm MomentMx Mbdy:blade2 nodenr: 3 coo: blade2 blade 2 root + 33 My coo: blade2 kNm MomentMy Mbdy:blade2 nodenr: 3 coo: blade2 blade 2 root + 34 Mz coo: blade2 kNm MomentMz Mbdy:blade2 nodenr: 3 coo: blade2 blade 2 root + 35 Mx coo: local kNm MomentMx Mbdy:blade2 nodenr: 10 coo: local blade 2 50% local e coo + 36 My coo: local kNm MomentMy Mbdy:blade2 nodenr: 10 coo: local blade 2 50% local e coo + 37 Mz coo: local kNm MomentMz Mbdy:blade2 nodenr: 10 coo: local blade 2 50% local e coo + 38 Mx coo: blade3 kNm MomentMx Mbdy:blade3 nodenr: 3 coo: blade3 blade 3 root + 39 My coo: blade3 kNm MomentMy Mbdy:blade3 nodenr: 3 coo: blade3 blade 3 root + 40 Mz coo: blade3 kNm MomentMz Mbdy:blade3 nodenr: 3 coo: blade3 blade 3 root + 41 Mx coo: local kNm MomentMx Mbdy:blade3 nodenr: 10 coo: local blade 3 50% local e coo + 42 My coo: local kNm MomentMy Mbdy:blade3 nodenr: 10 coo: local blade 3 50% local e coo + 43 Mz coo: local kNm MomentMz Mbdy:blade3 nodenr: 10 coo: local blade 3 50% local e coo + 44 State pos x coo: global m State pos x Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 45 State pos y coo: global m State pos y Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 46 State pos z coo: global m State pos z Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 47 State acc x coo: global m/s^2 State acc x Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 48 State acc y coo: global m/s^2 State acc y Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 49 State acc z coo: global m/s^2 State acc z Mbdy:tower E-nr: 7 Z-rel:1.00 coo: global tower top flange position + 50 State pos x coo: global m State pos x Mbdy:tower E-nr: 3 Z-rel:1.00 coo: global tower approx tip height + 51 State pos y coo: global m State pos y Mbdy:tower E-nr: 3 Z-rel:1.00 coo: global tower approx tip height + 52 State pos z coo: global m State pos z Mbdy:tower E-nr: 3 Z-rel:1.00 coo: global tower approx tip height + 53 State pos x coo: blade1 m State pos x Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: blade1 blade 1 tip pos + 54 State pos y coo: blade1 m State pos y Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: blade1 blade 1 tip pos + 55 State pos z coo: blade1 m State pos z Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: blade1 blade 1 tip pos + 56 State pos x coo: blade2 m State pos x Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: blade2 blade 2 tip pos + 57 State pos y coo: blade2 m State pos y Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: blade2 blade 2 tip pos + 58 State pos z coo: blade2 m State pos z Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: blade2 blade 2 tip pos + 59 State pos x coo: blade3 m State pos x Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: blade3 blade 3 tip pos + 60 State pos y coo: blade3 m State pos y Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: blade3 blade 3 tip pos + 61 State pos z coo: blade3 m State pos z Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: blade3 blade 3 tip pos + 62 State pos x coo: global m State pos x Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: global blade 1 tip pos + 63 State pos y coo: global m State pos y Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: global blade 1 tip pos + 64 State pos z coo: global m State pos z Mbdy:blade1 E-nr: 18 Z-rel:1.00 coo: global blade 1 tip pos + 65 State pos x coo: global m State pos x Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: global blade 2 tip pos + 66 State pos y coo: global m State pos y Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: global blade 2 tip pos + 67 State pos z coo: global m State pos z Mbdy:blade2 E-nr: 18 Z-rel:1.00 coo: global blade 2 tip pos + 68 State pos x coo: global m State pos x Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: global blade 3 tip pos + 69 State pos y coo: global m State pos y Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: global blade 3 tip pos + 70 State pos z coo: global m State pos z Mbdy:blade3 E-nr: 18 Z-rel:1.00 coo: global blade 3 tip pos + 71 WSP Vx, glco, R= 61.5 m/s Wind speed Vx of blade 1 at radius 61.52, global coo. + 72 WSP Vy, glco, R= 61.5 m/s Wind speed Vy of blade 1 at radius 61.52, global coo. + 73 WSP Vz, glco, R= 61.5 m/s Wind speed Vz of blade 1 at radius 61.52, global coo. + 74 Alfa, R= 45.0 deg Angle of attack of blade 1 at radius 45.17 + 75 Alfa, R= 45.0 deg Angle of attack of blade 2 at radius 45.17 + 76 Alfa, R= 45.0 deg Angle of attack of blade 3 at radius 45.17 + 77 Cl, R= 45.0 deg Cl of blade 1 at radius 45.17 + 78 Cl, R= 45.0 deg Cl of blade 2 at radius 45.17 + 79 Cl, R= 45.0 deg Cl of blade 3 at radius 45.17 + 80 DLL out 1: 1 - DLL : 1 outvec : 1 time + 81 DLL out 1: 2 - DLL : 1 outvec : 2 slow speed shaft rad/s + 82 DLL out 1: 3 - DLL : 1 outvec : 3 pitch angle 1 + 83 DLL out 1: 4 - DLL : 1 outvec : 4 pitch angle 2 + 84 DLL out 1: 5 - DLL : 1 outvec : 5 pitch angle 3 + 85 DLL out 1: 6 - DLL : 1 outvec : 6 wsp_x_global + 86 DLL out 1: 7 - DLL : 1 outvec : 7 wsp_y_global + 87 DLL out 1: 8 - DLL : 1 outvec : 8 wsp_z_global + 88 DLL out 1: 9 - DLL : 1 outvec : 9 elec. pwr + 89 DLL out 1: 10 - DLL : 1 outvec : 10 grid flag + 90 DLL inp 1: 1 - DLL : 1 inpvec : 1 generator torque reference [nm] + 91 DLL inp 1: 2 - DLL : 1 inpvec : 2 pitch angle reference of blade 1 [rad] + 92 DLL inp 1: 3 - DLL : 1 inpvec : 3 pitch angle reference of blade 2 [rad] + 93 DLL inp 1: 4 - DLL : 1 inpvec : 4 pitch angle reference of blade 3 [rad] + 94 DLL inp 1: 5 - DLL : 1 inpvec : 5 power reference [w] + 95 DLL inp 1: 6 - DLL : 1 inpvec : 6 filtered wind speed [m/s] + 96 DLL inp 1: 7 - DLL : 1 inpvec : 7 filtered rotor speed [rad/s] + 97 DLL inp 1: 8 - DLL : 1 inpvec : 8 filtered rotor speed error for torque [rad/s] + 98 DLL inp 1: 9 - DLL : 1 inpvec : 9 bandpass filtered rotor speed [rad/s] + 99 DLL inp 1: 10 - DLL : 1 inpvec : 10 proportional term of torque contr. [nm] + 100 DLL inp 1: 11 - DLL : 1 inpvec : 11 integral term of torque controller [nm] + 101 DLL inp 1: 12 - DLL : 1 inpvec : 12 minimum limit of torque [nm] + 102 DLL inp 1: 13 - DLL : 1 inpvec : 13 maximum limit of torque [nm] + 103 DLL inp 1: 14 - DLL : 1 inpvec : 14 torque limit switch based on pitch [-] + 104 DLL inp 1: 15 - DLL : 1 inpvec : 15 filtered rotor speed error for pitch [rad/s] + 105 DLL inp 1: 16 - DLL : 1 inpvec : 16 power error for pitch [w] + 106 DLL inp 1: 17 - DLL : 1 inpvec : 17 proportional term of pitch controller [rad] + 107 DLL inp 1: 18 - DLL : 1 inpvec : 18 integral term of pitch controller [rad] + 108 DLL inp 1: 19 - DLL : 1 inpvec : 19 minimum limit of pitch [rad] + 109 DLL inp 1: 20 - DLL : 1 inpvec : 20 maximum limit of pitch [rad] + 110 DLL inp 1: 21 - DLL : 1 inpvec : 21 torque reference from dt dammper [nm] + 111 DLL inp 1: 22 - DLL : 1 inpvec : 22 status signal [-] + 112 DLL inp 1: 23 - DLL : 1 inpvec : 23 total added pitch rate [rad/s] + 113 DLL inp 1: 25 - DLL : 1 inpvec : 25 flag for mechnical brake [0=off/1=on] + 114 DLL inp 1: 26 - DLL : 1 inpvec : 26 flag for emergency pitch stop [0=off/1=on] + 115 DLL out 2: 1 - DLL : 2 outvec : 1 time + 116 DLL out 2: 2 - DLL : 2 outvec : 2 electrical torque reference [nm] + 117 DLL out 2: 3 - DLL : 2 outvec : 3 omega lss + 118 DLL inp 2: 1 - DLL : 2 inpvec : 1 mgen lss [nm] + 119 DLL inp 2: 2 - DLL : 2 inpvec : 2 pelec w + 120 DLL inp 2: 3 - DLL : 2 inpvec : 3 mframe + 121 DLL inp 2: 4 - DLL : 2 inpvec : 4 mgen hss + 122 DLL inp 2: 5 - DLL : 2 inpvec : 5 generator pmech kw + 123 DLL inp 2: 6 - DLL : 2 inpvec : 6 filtered gen speed + 124 DLL inp 2: 7 - DLL : 2 inpvec : 7 elec. pwr + 125 DLL inp 2: 8 - DLL : 2 inpvec : 8 grid flag + 126 DLL inp 3: 1 - DLL : 3 inpvec : 1 brake torque [nm] + 127 DLL out 3: 1 - DLL : 3 outvec : 1 time [s] + 128 DLL out 3: 2 - DLL : 3 outvec : 2 generator lss speed [rad/s] + 129 DLL out 3: 3 - DLL : 3 outvec : 3 deploy brake + 130 DLL out 4: 1 - DLL : 4 outvec : 1 time + 131 DLL out 4: 2 - DLL : 4 outvec : 2 pitchref 1 + 132 DLL out 4: 3 - DLL : 4 outvec : 3 pitchref 2 + 133 DLL out 4: 4 - DLL : 4 outvec : 4 pitchref 3 + 134 DLL out 4: 5 - DLL : 4 outvec : 5 emerg. stop + 135 DLL inp 4: 1 - DLL : 4 inpvec : 1 pitch 1 + 136 DLL inp 4: 2 - DLL : 4 inpvec : 2 pitch 2 + 137 DLL inp 4: 3 - DLL : 4 inpvec : 3 pitch 3 +________________________________________________________________________________________________________________________ +Scale factors: + 9.37500E-03 + 1.12500E-02 + 3.79499E-04 + 2.62500E-03 + 1.94383E-04 + 2.62500E-03 + 1.94133E-04 + 2.62500E-03 + 1.94195E-04 + 3.97137E-05 + 2.43523E-01 + 2.25946E-01 + 1.11034E-02 + 1.00000E+00 + 7.81250E-04 + 1.00000E+00 + 1.50777E+00 + 3.87895E-01 + 6.69263E-02 + 1.68820E-01 + 1.50613E-01 + 6.66108E-02 + 7.91940E-02 + 1.05178E-01 + 1.51754E-01 + 1.69986E-01 + 9.72859E-02 + 2.10824E-03 + 4.26188E-02 + 2.01016E-02 + 2.08250E-03 + 1.74911E-01 + 1.10583E-01 + 1.95993E-03 + 2.97018E-02 + 2.63782E-02 + 1.98623E-03 + 1.33747E-01 + 9.57100E-02 + 2.21517E-03 + 4.07498E-02 + 1.76145E-02 + 2.14648E-03 + 3.14767E-06 + 9.56132E-06 + 2.73736E-03 + 4.36974E-06 + 2.21718E-05 + 1.27816E-07 + 3.14383E-07 + 1.16663E-06 + 9.37454E-04 + 1.95030E-05 + 8.94505E-05 + 1.92205E-03 + 2.10613E-05 + 6.70507E-05 + 1.92208E-03 + 2.00411E-05 + 8.40965E-05 + 1.92204E-03 + 1.97103E-03 + 4.88821E-04 + 4.77895E-03 + 1.97094E-03 + 4.49147E-04 + 4.77893E-03 + 1.96982E-03 + 4.72025E-04 + 4.77966E-03 + 1.00000E+00 + 8.69380E-04 + 1.00000E+00 + 3.15021E-04 + 1.78840E-04 + 2.44440E-04 + 2.11049E-05 + 2.44307E-05 + 2.80758E-05 + 9.37500E-03 + 3.97410E-05 + 4.58149E-05 + 4.58149E-05 + 4.58149E-05 + 1.00000E+00 + 7.81250E-04 + 1.00000E+00 + 1.56315E+02 + 1.00000E+00 + 1.37096E+02 + 4.58149E-05 + 4.58149E-05 + 4.58149E-05 + 1.56250E+02 + 7.81240E-04 + 3.96872E-05 + 2.10705E-05 + 1.00000E+00 + 4.05545E+02 + 4.03725E+02 + 1.37096E+02 + 1.37096E+02 + 3.12500E-05 + 1.57962E-05 + 1.24438E+02 + 5.45248E-06 + 2.95833E-05 + 4.27495E-05 + 4.58149E-05 + 1.00000E+00 + 3.12500E-05 + 1.00000E+00 + 1.00000E+00 + 1.00000E+00 + 9.37500E-03 + 1.37096E+02 + 3.97410E-05 + 1.43754E+02 + 1.56315E+02 + 1.42272E+02 + 1.48200E+00 + 1.65588E-01 + 1.51754E+02 + 2.95000E-05 + 1.00000E+00 + 1.00000E+00 + 9.37500E-03 + 3.97410E-05 + 1.00000E+00 + 9.37500E-03 + 4.58149E-05 + 4.58149E-05 + 4.58149E-05 + 1.00000E+00 + 4.58149E-05 + 4.58149E-05 + 4.58149E-05 diff --git a/wetb/dlc/tests/test_high_level.py b/wetb/dlc/tests/test_high_level.py new file mode 100644 index 0000000000000000000000000000000000000000..ca652c252e377934942b3e245cfd94cdd586a310 --- /dev/null +++ b/wetb/dlc/tests/test_high_level.py @@ -0,0 +1,77 @@ +''' +Created on 09/10/2014 + +@author: MMPE +''' +import unittest +from wetb.dlc.high_level import DLCHighLevel +import os + + +class TestDLCHighLevel(unittest.TestCase): + + def setUp(self): + unittest.TestCase.setUp(self) + self.dlc_hl = DLCHighLevel('test_files/DLC_test.xlsx') + + def test_variables(self): + self.assertEqual(self.dlc_hl.vref, 50) + self.assertEqual(os.path.realpath(self.dlc_hl.res_path), os.path.realpath(os.path.join(os.getcwd(), "test_files/res"))) + + def test_sensor_info(self): + self.assertEqual(list(self.dlc_hl.sensor_info().name), ['MxTB', 'MyTB', 'MxBR', 'PyBT', 'Power', 'Pitch', 'PitchBearing', 'Tip1TowerDistance', 'TipTowerDistance']) + + def test_sensor_info_filter(self): + self.assertEqual(list(self.dlc_hl.sensor_info(['fatigue']).m), [4, 4, 10]) + + + def test_fatigue_distribution_pct(self): + dlc, wsp, wdir = self.dlc_hl.fatigue_distribution()['12'] + self.assertEqual(dlc, 0.975) + self.assertEqual(min(wsp.keys()), 4) + self.assertEqual(max(wsp.keys()), 26) + self.assertEqual(wsp[4], 0.11002961306549919) + + def test_fatigue_distribution_count(self): + dlc, wsp, wdir = self.dlc_hl.fatigue_distribution()['31'] + #self.assertEqual(dlc, "#1000") + self.assertEqual(min(wsp.keys()), 4) + self.assertEqual(max(wsp.keys()), 25) + self.assertEqual(wsp[4], "#1000") + + def test_file_hour_lst(self): + f, h = self.dlc_hl.file_hour_lst()[0] + self.assertEqual(f, 'test_files\\res\\DLC12_IEC61400-1ed3\\dlc12_wsp04_wdir350_s3001.sel') + self.assertEqual(h, .975 * .25 * 0.11002961306549919 / 2 * 20 * 365 * 24) + + def test_file_hour_lst_count(self): + f, h = self.dlc_hl.file_hour_lst()[-1] + self.assertEqual(f, 'test_files\\res\\DLC31_IEC61400-1ed3\\dlc31_wsp25_wdir000_s0000.sel') + self.assertAlmostEqual(h, 0.0087201928 * 1 * (50 / 1100) * 20 * 365 * 24) + + + def test_dlc_lst(self): + self.assertEqual(self.dlc_hl.dlc_lst(), ['12', '13', '14', '31']) + + + def test_dlc_lst_filter(self): + self.assertEqual(self.dlc_hl.dlc_lst('F'), ['12', '31']) + self.assertEqual(self.dlc_hl.dlc_lst('U'), ['12', '13', '31']) + + + def test_psf(self): + self.assertEqual(self.dlc_hl.psf()['31'], 1.3) + + def test_keys(self): + for k in ['name', 'nr', 'description', 'unit', 'statistic', 'ultimate', 'fatigue', 'm', 'neql', 'bearingdamage', 'mindistance', 'maxdistance', 'extremeload']: + self.assertTrue(k in self.dlc_hl.sensor_info().keys(), k) + + + def test_extremeload_sensors(self): + self.dlc_hl = DLCHighLevel('test_files/DLC_test2.xlsx') + + + +if __name__ == "__main__": + #import sys;sys.argv = ['', 'Test.testName'] + unittest.main() diff --git a/wetb/fatigue_tools/fatigue.py b/wetb/fatigue_tools/fatigue.py index a411a1674a222fc7a6066970b225ec893b5f5eb7..98bad48131ca3a0ba9af455fe3fed2bf4db02c33 100644 --- a/wetb/fatigue_tools/fatigue.py +++ b/wetb/fatigue_tools/fatigue.py @@ -174,7 +174,7 @@ if __name__ == "__main__": signal1 = np.array([-2.0, 0.0, 1.0, 0.0, -3.0, 0.0, 5.0, 0.0, -1.0, 0.0, 3.0, 0.0, -4.0, 0.0, 4.0, 0.0, -2.0]) signal2 = signal1 * 1.1 - # equivalent load for default wöhler slopes + # equivalent load for default wohler slopes print (eq_load(signal1, no_bins=50, neq=17, rainflow_func=rainflow_windap)) print (eq_load(signal1, no_bins=50, neq=17, rainflow_func=rainflow_astm))