From 7f333aff4cbcc0420106695e132ceb2001ccf55f Mon Sep 17 00:00:00 2001 From: pibo Date: Tue, 16 Feb 2021 18:26:24 -0700 Subject: [PATCH 1/8] support multiple Re - AFTab=2 --- .../06_IEA-15-240-RWT/IEA-15-240-RWT.yaml | 11 ++++++ examples/07_te_flaps/modeling_options.yaml | 6 +-- weis/aeroelasticse/FAST_writer.py | 10 +++-- weis/aeroelasticse/openmdao_openfast.py | 38 +++++++++++++------ weis/glue_code/glue_code.py | 6 +-- 5 files changed, 48 insertions(+), 23 deletions(-) diff --git a/examples/06_IEA-15-240-RWT/IEA-15-240-RWT.yaml b/examples/06_IEA-15-240-RWT/IEA-15-240-RWT.yaml index 50a48e872..98fadf7bd 100644 --- a/examples/06_IEA-15-240-RWT/IEA-15-240-RWT.yaml +++ b/examples/06_IEA-15-240-RWT/IEA-15-240-RWT.yaml @@ -515,6 +515,17 @@ airfoils: c_m: grid: *grid005 values: [-0.0001, -0.0001] + - configuration: Default + re: 1.00E+07 + c_l: + grid: &grid004 [-3.14, -3.101699414, -3.061806173, -3.021912933, -2.98202, -2.94213, -2.902233213, -2.862339973, -2.82245, -2.78255, -2.74266, -2.70277, -2.662873773, -2.622980533, -2.583087293, -2.510780795, -2.438474298, -2.3661678, -2.293861303, -2.221554805, -2.149248307, -2.07694181, -2.004635312, -1.932328815, -1.860022317, -1.78771582, -1.715409322, -1.643102824, -1.570796327, -1.498489829, -1.426183332, -1.353876834, -1.281570336, -1.209263839, -1.136957341, -1.064650844, -0.992344346, -0.920037849, -0.847731351, -0.775424853, -0.703118356, -0.630811858, -0.558505361, -0.488692191, -0.41887902, -0.34906585, -0.314159265, -0.27925268, -0.244346095, -0.20943951, -0.174532925, -0.13962634, -0.104719755, -0.06981317, -0.034906585, -0.017453293, 0, 0.017453293, 0.034906585, 0.052359878, 0.06981317, 0.087266463, 0.104719755, 0.122173048, 0.13962634, 0.157079633, 0.174532925, 0.191986218, 0.20943951, 0.226892803, 0.244346095, 0.261799388, 0.27925268, 0.314159265, 0.34906585, 0.41887902, 0.488692191, 0.558505361, 0.630811858, 0.703118356, 0.775424853, 0.847731351, 0.920037849, 0.992344346, 1.064650844, 1.136957341, 1.209263839, 1.281570336, 1.353876834, 1.426183332, 1.498489829, 1.570796327, 1.643102824, 1.715409322, 1.78771582, 1.860022317, 1.932328815, 2.004635312, 2.07694181, 2.149248307, 2.221554805, 2.293861303, 2.3661678, 2.438474298, 2.510780795, 2.583087293, 2.622980533, 2.662873773, 2.702767013, 2.742660253, 2.782553493, 2.822446733, 2.862339973, 2.902233213, 2.942126453, 2.982019693, 3.021912933, 3.061806173, 3.101699414, 3.14] + values: [0.0, 0.05402504999999973, 0.1080501000000001, 0.1620751499999998, 0.2161002000000001, 0.2701252499999999, 0.3241502999999996, 0.3781753499999999, 0.4322003999999997, 0.4862254499999999, 0.5402504999999997, 0.5942755500000001, 0.6483005999999998, 0.70232565, 0.7563506999999998, 0.7318783269239915, 0.7065528355994307, 0.6776040044026928, 0.6433295384757597, 0.6027662380766498, 0.5555015408989838, 0.5015565175320579, 0.441306592466731, 0.3754225708324188, 0.3048226261816518, 0.2306301410703767, 0.1541346331849047, 0.0767543574378533, 6.938893903907228e-17, -0.07675435743785307, -0.1541346331849047, -0.2306301410703764, -0.3048226261816516, -0.3754225708324188, -0.4413065924667308, -0.5015565175320579, -0.5555015408989837, -0.6027662380766498, -0.6433295384757594, -0.6776040044026929, -0.7065528355994307, -0.7318783269239915, -0.7563507000000002, -0.85636, -1.18292, -1.23596, -1.22536, -1.20476, -1.18332, -1.10093, -0.882085, -0.62981, -0.376701, -0.121772, 0.128101, 0.25192, 0.375354, 0.498281, 0.6205240000000001, 0.742004, 0.862375, 0.98114, 1.09662, 1.20904, 1.3168, 1.42209, 1.52361, 1.61988, 1.70937, 1.78681, 1.8429, 1.85313, 1.80951, 1.66033, 1.56152, 1.43327, 1.29062, 1.080501, 1.045540467034274, 1.009361193713472, 0.9680057205752755, 0.9190421978225134, 0.8610946258237854, 0.7935736298556911, 0.7165093107600827, 0.6304379892381867, 0.5363179583320269, 0.4354608945452166, 0.3294716301005378, 0.2201923331212924, 0.1096490820540758, 9.71445146547012e-17, -0.07675435743785305, -0.1541346331849047, -0.2306301410703764, -0.3048226261816516, -0.3754225708324188, -0.4413065924667307, -0.5015565175320579, -0.5555015408989835, -0.6027662380766498, -0.6433295384757597, -0.6776040044026928, -0.7065528355994307, -0.7318783269239915, -0.7563507000000002, -0.70232565, -0.6483005999999998, -0.5942755500000001, -0.5402504999999997, -0.4862254499999999, -0.4322004000000002, -0.3781753499999999, -0.3241503000000002, -0.2701252499999999, -0.2161002000000001, -0.1620751499999998, -0.1080501000000001, -0.05402504999999973, 4.85722573273506e-18] + c_d: + grid: *grid004 + values: [0.02464146255885971, 0.0253381915760185, 0.02742386791262707, 0.03088494454883671, 0.03569894666004403, 0.05599104793704501, 0.08143456941199648, 0.111118119977472, 0.1448529823401942, 0.1824246843171338, 0.2235943631517934, 0.2681002849817088, 0.3156595097900088, 0.3659696912483095, 0.418711, 0.5194063216490634, 0.624878215320418, 0.7329268692419378, 0.8412988626197737, 0.9477341973794456, 1.050013466313862, 1.146004172998905, 1.233705236549658, 1.311288752188593, 1.37713813588963, 1.429881856853057, 1.468422053679695, 1.491957436925499, 1.5, 1.491957436925499, 1.468422053679695, 1.429881856853057, 1.37713813588963, 1.311288752188593, 1.233705236549658, 1.146004172998905, 1.050013466313863, 0.9477341973794456, 0.8412988626197743, 0.7329268692419378, 0.6248782153204183, 0.5194063216490632, 0.418711, 0.286909, 0.139597, 0.0834459, 0.0650916, 0.0488819, 0.0341723, 0.0213247, 0.0138586, 0.0107541, 0.008815799999999999, 0.00702184, 0.00663047, 0.00664363, 0.00670056, 0.00680819, 0.00697859, 0.00720311, 0.007514809999999999, 0.00795847, 0.00872169, 0.009683530000000001, 0.0109695, 0.0122748, 0.0136859, 0.0152881, 0.0171709, 0.0197355, 0.0236792, 0.0309403, 0.0430319, 0.0773041, 0.112017, 0.18408, 0.275892, 0.418711, 0.5194063216490632, 0.6248782153204185, 0.7329268692419378, 0.8412988626197743, 0.9477341973794456, 1.050013466313863, 1.146004172998905, 1.233705236549658, 1.311288752188593, 1.37713813588963, 1.429881856853057, 1.468422053679695, 1.491957436925499, 1.5, 1.491957436925499, 1.468422053679695, 1.429881856853057, 1.37713813588963, 1.311288752188593, 1.233705236549658, 1.146004172998905, 1.050013466313863, 0.9477341973794456, 0.8412988626197737, 0.7329268692419378, 0.624878215320418, 0.5194063216490634, 0.418711, 0.3659696912483095, 0.3156595097900088, 0.2681002849817088, 0.2235943631517934, 0.1824246843171338, 0.1448529823401946, 0.111118119977472, 0.08143456941199678, 0.05599104793704501, 0.03569894666004403, 0.03088494454883671, 0.02742386791262707, 0.0253381915760185, 0.02464146255885971] + c_m: + grid: *grid004 + values: [0.0, 0.09142857142857111, 0.1828571428571434, 0.2742857142857145, 0.3657142857142855, 0.3919171380083344, 0.3789845588216693, 0.3660519796350041, 0.353119400448339, 0.3476784059442646, 0.3647121654879618, 0.3817459250316594, 0.3987796845753567, 0.4158134441190544, 0.4195454592054533, 0.4228655348597155, 0.4263227290676669, 0.4316310237504245, 0.436939318433182, 0.4438932390944983, 0.4517132786918981, 0.458974087487912, 0.4644773137652843, 0.4699805400426567, 0.4709637155505512, 0.4710052138148045, 0.4682373893923625, 0.4614896911637687, 0.4547419929351749, 0.440261605201769, 0.4257812174683632, 0.4082106877197933, 0.3884588812546371, 0.3681533816888277, 0.3451901552398833, 0.322226928790939, 0.2986411272359326, 0.2748572336017246, 0.2512805789575005, 0.2280976783942457, 0.2049147778309909, 0.1541624777852183, 0.101368, 0.0652698, 0.01647420000000005, -0.0035156, -0.006716600000000001, -0.00881275, -0.0110092, -0.02268789999999999, -0.0439675, -0.0575595, -0.0674747, -0.07680390000000001, -0.08283, -0.08534420000000001, -0.0877721, -0.0901057, -0.0923415, -0.094469, -0.0964635, -0.0982801, -0.0997729, -0.100947, -0.1016336, -0.1020701, -0.1021297, -0.1017353, -0.100868, -0.09936350000000001, -0.0971987, -0.0940975, -0.0914393, -0.09242, -0.09870720000000001, -0.117702, -0.145658, -0.18266, -0.2091344193953699, -0.2353353726197231, -0.2578445325353481, -0.2803536924509731, -0.301631395515415, -0.3222609633950237, -0.3424694255055559, -0.3613544123418473, -0.3802393991781386, -0.3970410534414668, -0.4134086800854276, -0.4284443809438795, -0.4415931869395273, -0.4547419929351749, -0.4614896911637686, -0.4682373893923625, -0.4710052138148045, -0.4709637155505513, -0.4699805400426568, -0.4644773137652844, -0.458974087487912, -0.4517132786918981, -0.4438932390944983, -0.436939318433182, -0.4316310237504245, -0.4263227290676669, -0.4228655348597155, -0.4195454592054533, -0.4158134441190544, -0.3987796845753567, -0.3817459250316594, -0.3647121654879618, -0.3476784059442646, -0.3702622575911958, -0.4060519796350041, -0.4418417016788119, -0.4776314237226202, -0.457142857142857, -0.3428571428571431, -0.2285714285714291, -0.1142857142857139, 0.0] - name: SNL-FFA-W3-500 coordinates: x: [1.00000000, 0.99944304, 0.99812049, 0.99569352, 0.99230484, 0.98802844, 0.98281508, 0.97666422, 0.96964069, 0.96174313, 0.95297315, 0.94338928, 0.93301284, 0.92185147, 0.90995468, 0.89736121, 0.88408503, 0.87016290, 0.85565276, 0.84057695, 0.82497463, 0.80889455, 0.79236237, 0.77542101, 0.75812546, 0.74050180, 0.72259209, 0.70444539, 0.68608843, 0.66757021, 0.64892678, 0.63018643, 0.61140138, 0.59259673, 0.57380843, 0.55507570, 0.53641763, 0.51787958, 0.49948103, 0.48125155, 0.46322225, 0.44540666, 0.42784323, 0.41053864, 0.39352525, 0.37681123, 0.36041977, 0.34436494, 0.32865846, 0.31331898, 0.29834798, 0.28376580, 0.26956679, 0.25577362, 0.24237780, 0.22939648, 0.21681735, 0.20465763, 0.19290757, 0.18157496, 0.17065819, 0.16014896, 0.15005511, 0.14035465, 0.13106750, 0.12216148, 0.11365876, 0.10553619, 0.09779065, 0.09042902, 0.08341621, 0.07677403, 0.07046920, 0.06450016, 0.05888182, 0.05356799, 0.04857581, 0.04389793, 0.03949498, 0.03539484, 0.03157626, 0.02800644, 0.02471592, 0.02168071, 0.01886319, 0.01629514, 0.01396620, 0.01181764, 0.00988361, 0.00818368, 0.00663128, 0.00524853, 0.00408271, 0.00308998, 0.00219098, 0.00145967, 0.00096333, 0.00059878, 0.00028988, 0.00007804, 0.00000000, 0.00007807, 0.00029009, 0.00059937, 0.00096448, 0.00146264, 0.00219661, 0.00309879, 0.00409516, 0.00526774, 0.00665839, 0.00821941, 0.00993095, 0.01187982, 0.01404463, 0.01639219, 0.01898469, 0.02182867, 0.02489252, 0.02822001, 0.03182924, 0.03568998, 0.03984236, 0.04430035, 0.04903788, 0.05410025, 0.05948747, 0.06518787, 0.07124791, 0.07764648, 0.08439704, 0.09152340, 0.09900711, 0.10688721, 0.11514762, 0.12380644, 0.13287211, 0.14233176, 0.15221460, 0.16249918, 0.17321393, 0.18434125, 0.19590296, 0.20788328, 0.22029378, 0.23312344, 0.24637487, 0.26004146, 0.27412439, 0.28861129, 0.30349962, 0.31877410, 0.33443448, 0.35045732, 0.36684322, 0.38356093, 0.40060975, 0.41795607, 0.43559330, 0.45349250, 0.47163211, 0.48999236, 0.50853595, 0.52724867, 0.54608860, 0.56503090, 0.58404504, 0.60308800, 0.62213765, 0.64114752, 0.66008031, 0.67890619, 0.69757164, 0.71604492, 0.73429135, 0.75225234, 0.76989792, 0.78719153, 0.80407383, 0.82051349, 0.83646946, 0.85189026, 0.86674791, 0.88100970, 0.89461041, 0.90752456, 0.91973040, 0.93117530, 0.94182765, 0.95167536, 0.96067486, 0.96878747, 0.97601191, 0.98233053, 0.98768615, 0.99208631, 0.99557391, 0.99806302, 0.99942968, 1.00000000] diff --git a/examples/07_te_flaps/modeling_options.yaml b/examples/07_te_flaps/modeling_options.yaml index df1f2a420..e56dfe5e6 100644 --- a/examples/07_te_flaps/modeling_options.yaml +++ b/examples/07_te_flaps/modeling_options.yaml @@ -20,9 +20,9 @@ Level3: # Options for WEIS fidelity level 3 = nonlinear time domain flag: True simulation: DT: 0.01 - TMax: 720 - TStart: 120 - SttsTime: 100. + TMax: 10 + TStart: 0 + SttsTime: 1. ElastoDyn: flag: True FlapDOF1: True diff --git a/weis/aeroelasticse/FAST_writer.py b/weis/aeroelasticse/FAST_writer.py index 4ede01e59..f6665fa75 100644 --- a/weis/aeroelasticse/FAST_writer.py +++ b/weis/aeroelasticse/FAST_writer.py @@ -1036,9 +1036,11 @@ def write_AeroDyn15Polar(self): # f.write('{:<22d} {:<11} {:}'.format(self.fst_vt['AeroDyn15']['af_data'][afi][0]['NumTabs'], 'NumTabs', '! Number of airfoil tables in this file. Each table must have lines for Re and Ctrl.\n')) - # check if airfoils with multiple flaps exists. + # Check if we have multiple tables per airfoil # if yes, allocate the number of airfoils to the respective radial stations - if self.fst_vt['AeroDyn15']['af_data'][afi][0]['NumTabs'] > 1: + if self.fst_vt['AeroDyn15']['AFTabMod'] == 2: + num_tab = len(self.fst_vt['AeroDyn15']['af_data'][afi]) + elif self.fst_vt['AeroDyn15']['AFTabMod'] == 3: # for tab_orig in range(self.fst_vt['AeroDyn15']['af_data'][afi][0]['NumTabs'] - 1): if self.fst_vt['AeroDyn15']['af_data'][afi][0]['Ctrl'] == self.fst_vt['AeroDyn15']['af_data'][afi][1]['Ctrl']: num_tab = 1 # assume that all Ctrl angles of the flaps are identical if the first two are -> no flaps! @@ -1049,8 +1051,8 @@ def write_AeroDyn15Polar(self): # f.write('{:<22d} {:<11} {:}'.format(self.fst_vt['AeroDyn15']['af_data'][afi][0]['NumTabs'], 'NumTabs','! Number of airfoil tables in this file. Each table must have lines for Re and Ctrl.\n')) f.write('{:<22d} {:<11} {:}'.format(num_tab, 'NumTabs','! Number of airfoil tables in this file. Each table must have lines for Re and Ctrl.\n')) - # for tab in range(self.fst_vt['AeroDyn15']['af_data'][afi][0]['NumTabs']): # For writting multiple tables (different Re or Ctrl values) - for tab in range(num_tab): # For writting multiple tables (different Re or Ctrl values) + # for tab in range(self.fst_vt['AeroDyn15']['af_data'][afi][0]['NumTabs']): # For writing multiple tables (different Re or Ctrl values) + for tab in range(num_tab): # For writing multiple tables (different Re or Ctrl values) f.write('! ------------------------------------------------------------------------------\n') f.write("! data for table %i \n" % (tab + 1)) f.write('! ------------------------------------------------------------------------------\n') diff --git a/weis/aeroelasticse/openmdao_openfast.py b/weis/aeroelasticse/openmdao_openfast.py index 7b114c6c2..89af06fad 100644 --- a/weis/aeroelasticse/openmdao_openfast.py +++ b/weis/aeroelasticse/openmdao_openfast.py @@ -141,8 +141,6 @@ def setup(self): self.add_input('airfoils_cm', val=np.zeros((n_span, n_aoa, n_Re, n_tab)), desc='moment coefficients, spanwise') self.add_input('airfoils_aoa', val=np.zeros((n_aoa)), units='deg', desc='angle of attack grid for polars') self.add_input('airfoils_Re', val=np.zeros((n_Re)), desc='Reynolds numbers of polars') - self.add_input('airfoils_Re_loc', val=np.zeros((n_span, n_Re, n_tab)), desc='temporary - matrix of Re numbers') - self.add_input('airfoils_Ma_loc', val=np.zeros((n_span, n_Re, n_tab)), desc='temporary - matrix of Ma numbers') self.add_input('airfoils_Ctrl', val=np.zeros((n_span, n_Re, n_tab)), units='deg',desc='Airfoil control paremeter (i.e. flap angle)') # Airfoil coordinates @@ -610,16 +608,34 @@ def update_FAST_model(self, fst_vt, inputs, discrete_inputs): # fst_vt['AeroDyn15']['af_data'] = [{}]*len(airfoils) fst_vt['AeroDyn15']['af_data'] = [] - if self.n_tab > 1: + # Set the AD15 flag AFTabMod, deciding whether we use more Re per airfoil or user-defined tables (used for example in distributed aerodynamic control) + if fst_vt['AeroDyn15']['AFTabMod'] == 1: + # If AFTabMod is the default coming form the schema, check the value from WISDEM, which might be set to 2 if more Re per airfoil are defined in the geometry yaml + fst_vt['AeroDyn15']['AFTabMod'] = modeling_options["WISDEM"]["RotorSE"]["AFTabMod"] + if self.n_tab > 1 and fst_vt['AeroDyn15']['AFTabMod'] == 1: fst_vt['AeroDyn15']['AFTabMod'] = 3 + elif self.n_tab > 1 and fst_vt['AeroDyn15']['AFTabMod'] == 2: + raise Exception('OpenFAST does not support both multiple Re and multiple user defined tabs. Please remove DAC devices or Re polars') for i in range(self.n_span): # No of blade radial stations fst_vt['AeroDyn15']['af_data'].append([]) + if fst_vt['AeroDyn15']['AFTabMod'] == 1: + loop_index = 1 + elif fst_vt['AeroDyn15']['AFTabMod'] == 2: + loop_index = self.n_Re + else: + loop_index = self.n_tab - for j in range(self.n_tab): # No of tabs; if there are no flaps at this blade station - unsteady = eval_unsteady(inputs['airfoils_aoa'], inputs['airfoils_cl'][i,:,0,j], inputs['airfoils_cd'][i,:,0,j], inputs['airfoils_cm'][i,:,0,j]) + for j in range(loop_index): # Number of tabs or Re + if fst_vt['AeroDyn15']['AFTabMod'] == 1: + unsteady = eval_unsteady(inputs['airfoils_aoa'], inputs['airfoils_cl'][i,:,0,0], inputs['airfoils_cd'][i,:,0,0], inputs['airfoils_cm'][i,:,0,0]) + elif fst_vt['AeroDyn15']['AFTabMod'] == 2: + unsteady = eval_unsteady(inputs['airfoils_aoa'], inputs['airfoils_cl'][i,:,j,0], inputs['airfoils_cd'][i,:,j,0], inputs['airfoils_cm'][i,:,j,0]) + else: + unsteady = eval_unsteady(inputs['airfoils_aoa'], inputs['airfoils_cl'][i,:,0,j], inputs['airfoils_cd'][i,:,0,j], inputs['airfoils_cm'][i,:,0,j]) + fst_vt['AeroDyn15']['af_data'][i].append({}) @@ -629,13 +645,13 @@ def update_FAST_model(self, fst_vt, inputs, discrete_inputs): fst_vt['AeroDyn15']['af_data'][i][j]['NumCoords'] = '@"AF{:02d}_Coords.txt"'.format(i) else: fst_vt['AeroDyn15']['af_data'][i][j]['NumCoords'] = 0 - fst_vt['AeroDyn15']['af_data'][i][j]['NumTabs'] = self.n_tab - if inputs['airfoils_Re_loc'][i][0][j] == 0: # check if Re ws locally determined (e.g. for trailing edge flaps) - fst_vt['AeroDyn15']['af_data'][i][j]['Re'] = 0.75 # TODO: functionality for multiple Re tables + + fst_vt['AeroDyn15']['af_data'][i][j]['NumTabs'] = loop_index + fst_vt['AeroDyn15']['af_data'][i][j]['Re'] = inputs['airfoils_Re'][j] + if fst_vt['AeroDyn15']['AFTabMod'] == 3: + fst_vt['AeroDyn15']['af_data'][i][j]['Ctrl'] = inputs['airfoils_Ctrl'][i,0,j] # unsteady['Ctrl'] # added to unsteady function for variable flap controls at airfoils else: - fst_vt['AeroDyn15']['af_data'][i][j]['Re'] = inputs['airfoils_Re_loc'][i,0,j]/1000000 # give in millions - fst_vt['AeroDyn15']['af_data'][i][j]['Ctrl'] = inputs['airfoils_Ctrl'][i,0,j] # unsteady['Ctrl'] # added to unsteady function for variable flap controls at airfoils - + fst_vt['AeroDyn15']['af_data'][i][j]['Ctrl'] = 0. fst_vt['AeroDyn15']['af_data'][i][j]['InclUAdata']= "True" fst_vt['AeroDyn15']['af_data'][i][j]['alpha0'] = unsteady['alpha0'] fst_vt['AeroDyn15']['af_data'][i][j]['alpha1'] = unsteady['alpha1'] diff --git a/weis/glue_code/glue_code.py b/weis/glue_code/glue_code.py index ceb7b51d5..acf9b2b8f 100644 --- a/weis/glue_code/glue_code.py +++ b/weis/glue_code/glue_code.py @@ -326,6 +326,7 @@ def setup(self): self.connect('sse_tune.aeroperf_tables.Cp', 'aeroelastic.Cp_aero_table') self.connect('sse_tune.aeroperf_tables.Ct', 'aeroelastic.Ct_aero_table') self.connect('sse_tune.aeroperf_tables.Cq', 'aeroelastic.Cq_aero_table') + self.connect('xf.flap_angles', 'aeroelastic.airfoils_Ctrl') if modeling_options['flags']['mooring']: self.connect("mooring.line_diameter", "aeroelastic.line_diameter") @@ -342,11 +343,6 @@ def setup(self): self.connect("mooring.nodes_drag_area", "aeroelastic.nodes_drag_area") self.connect("mooring.unstretched_length", "aeroelastic.unstretched_length") self.connect("mooring.node_names", "aeroelastic.node_names") - - # Temporary - self.connect('xf.Re_loc', 'aeroelastic.airfoils_Re_loc') - self.connect('xf.Ma_loc', 'aeroelastic.airfoils_Ma_loc') - self.connect('xf.flap_angles', 'aeroelastic.airfoils_Ctrl') if modeling_options['openfast']['dlc_settings']['run_blade_fatigue']: self.connect('re.precomp.x_tc', 'aeroelastic.x_tc') From c2487ff1ea0a1e0bfc93347b39fa123649e099f3 Mon Sep 17 00:00:00 2001 From: pibo Date: Tue, 16 Feb 2021 18:36:31 -0700 Subject: [PATCH 2/8] same Re across tables for DAC --- weis/aeroelasticse/openmdao_openfast.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/weis/aeroelasticse/openmdao_openfast.py b/weis/aeroelasticse/openmdao_openfast.py index 89af06fad..e3aa58a12 100644 --- a/weis/aeroelasticse/openmdao_openfast.py +++ b/weis/aeroelasticse/openmdao_openfast.py @@ -647,10 +647,11 @@ def update_FAST_model(self, fst_vt, inputs, discrete_inputs): fst_vt['AeroDyn15']['af_data'][i][j]['NumCoords'] = 0 fst_vt['AeroDyn15']['af_data'][i][j]['NumTabs'] = loop_index - fst_vt['AeroDyn15']['af_data'][i][j]['Re'] = inputs['airfoils_Re'][j] if fst_vt['AeroDyn15']['AFTabMod'] == 3: fst_vt['AeroDyn15']['af_data'][i][j]['Ctrl'] = inputs['airfoils_Ctrl'][i,0,j] # unsteady['Ctrl'] # added to unsteady function for variable flap controls at airfoils + fst_vt['AeroDyn15']['af_data'][i][j]['Re'] = inputs['airfoils_Re'][0] # If AFTabMod==3 the Re is neglected, but it still must be the same across tables else: + fst_vt['AeroDyn15']['af_data'][i][j]['Re'] = inputs['airfoils_Re'][j] fst_vt['AeroDyn15']['af_data'][i][j]['Ctrl'] = 0. fst_vt['AeroDyn15']['af_data'][i][j]['InclUAdata']= "True" fst_vt['AeroDyn15']['af_data'][i][j]['alpha0'] = unsteady['alpha0'] From 49fb46703f75a9267cdb04154361670aec1182ca Mon Sep 17 00:00:00 2001 From: pibo Date: Tue, 16 Feb 2021 21:40:36 -0700 Subject: [PATCH 3/8] Squashed 'WISDEM/' changes from 34c5eb437..5a5521b34 5a5521b34 Merge pull request #235 from WISDEM/multiple_Re 5ab3d2c87 pushed this by mistake 5a90a5e97 support multiple Re in WEIS c59651258 Merge pull request #234 from WISDEM/b/fix_unsteady 5ab393ba3 switch to Branlard's polar class for unsteady calcs 8b520ed29 avoiding divide by zero in null cases git-subtree-dir: WISDEM git-subtree-split: 5a5521b34ee29096ccd516971b92503f46c3d99e --- wisdem/ccblade/Polar.py | 16 ++-- wisdem/glue_code/gc_LoadInputs.py | 3 + wisdem/glue_code/gc_WT_InitModel.py | 10 +-- wisdem/rotorse/rotor_power.py | 126 ++++------------------------ 4 files changed, 33 insertions(+), 122 deletions(-) diff --git a/wisdem/ccblade/Polar.py b/wisdem/ccblade/Polar.py index 9b182b524..1ae31b473 100644 --- a/wisdem/ccblade/Polar.py +++ b/wisdem/ccblade/Polar.py @@ -1,12 +1,15 @@ -from __future__ import print_function, division -import numpy as np +from __future__ import division, print_function + import os -""" This module contains: +import numpy as np + + +""" This module contains: - Polar: class to represent a polar (computes steady/unsteady parameters, corrections etc.) - blend: function to blend two polars - - thicknessinterp_from_one_set: interpolate polars at different thickeness based on one set of polars - + - thicknessinterp_from_one_set: interpolate polars at different thickeness based on one set of polars + JPJ 7/20 : This class can probably be combined with Polar() from airfoilprep.py. They do not have one-to-one matching for the methods. Because both are not tested extensively, we first need to write tests for both @@ -769,7 +772,7 @@ def cl_fully_separated(self): # Ensuring everything is in harmony cl_inv = cla * (self.alpha - alpha0) - f_st = (self.cl - cl_fs) / (cl_inv - cl_fs) + f_st = (self.cl - cl_fs) / (cl_inv - cl_fs + 1e-10) f_st[np.where(f_st < 1e-15)] = 0 # Storing self.f_st = f_st @@ -942,6 +945,7 @@ def _find_alpha0(alpha, coeff, window): alpha = alpha[iwindow] coeff = coeff[iwindow] alpha_zc, i_zc = _zero_crossings(x=alpha, y=coeff, direction="up") + if len(alpha_zc) > 1: raise Exception( "Cannot find alpha0, {} zero crossings of Coeff in the range of alpha values: [{} {}] ".format( diff --git a/wisdem/glue_code/gc_LoadInputs.py b/wisdem/glue_code/gc_LoadInputs.py index d0c412e11..7f17b42b1 100644 --- a/wisdem/glue_code/gc_LoadInputs.py +++ b/wisdem/glue_code/gc_LoadInputs.py @@ -148,9 +148,12 @@ def set_openmdao_vectors(self): + " is not a multiple of 4 and an equally spaced grid is adopted." ) Re_all = [] + self.modeling_options["WISDEM"]["RotorSE"]["AFTabMod"] = 1 for i in range(self.modeling_options["WISDEM"]["RotorSE"]["n_af"]): for j in range(len(self.wt_init["airfoils"][i]["polars"])): Re_all.append(self.wt_init["airfoils"][i]["polars"][j]["re"]) + if len(self.wt_init["airfoils"][i]["polars"]) > 1: + self.modeling_options["WISDEM"]["RotorSE"]["AFTabMod"] = 2 self.modeling_options["WISDEM"]["RotorSE"]["n_Re"] = len(np.unique(Re_all)) self.modeling_options["WISDEM"]["RotorSE"]["n_tab"] = 1 self.modeling_options["WISDEM"]["RotorSE"]["n_xy"] = self.modeling_options["WISDEM"]["RotorSE"]["n_xy"] diff --git a/wisdem/glue_code/gc_WT_InitModel.py b/wisdem/glue_code/gc_WT_InitModel.py index ff6d9cb55..caa565af9 100644 --- a/wisdem/glue_code/gc_WT_InitModel.py +++ b/wisdem/glue_code/gc_WT_InitModel.py @@ -1224,7 +1224,7 @@ def assign_airfoil_values(wt_opt, modeling_options, airfoils): j_Re = np.zeros(n_Re_i, dtype=int) for j in range(n_Re_i): Re_j[j] = airfoils[i]["polars"][j]["re"] - j_Re[j] = np.argmin(Re - Re_j) + j_Re[j] = np.argmin(abs(Re - Re_j[j])) for k in range(n_tab): cl[i, :, j_Re[j], k] = np.interp( aoa, airfoils[i]["polars"][j]["c_l"]["grid"], airfoils[i]["polars"][j]["c_l"]["values"] @@ -1242,7 +1242,7 @@ def assign_airfoil_values(wt_opt, modeling_options, airfoils): "WARNING: Airfoil " + name[i] + " has the lift coefficient at Re " - + str(Re_j) + + str(Re_j[j]) + " different between + and - pi rad. This is fixed automatically, but please check the input data." ) if abs(cd[i, 0, j, k] - cd[i, -1, j, k]) > 1.0e-5: @@ -1251,7 +1251,7 @@ def assign_airfoil_values(wt_opt, modeling_options, airfoils): "WARNING: Airfoil " + name[i] + " has the drag coefficient at Re " - + str(Re_j) + + str(Re_j[j]) + " different between + and - pi rad. This is fixed automatically, but please check the input data." ) if abs(cm[i, 0, j, k] - cm[i, -1, j, k]) > 1.0e-5: @@ -1260,7 +1260,7 @@ def assign_airfoil_values(wt_opt, modeling_options, airfoils): "WARNING: Airfoil " + name[i] + " has the moment coefficient at Re " - + str(Re_j) + + str(Re_j[j]) + " different between + and - pi rad. This is fixed automatically, but please check the input data." ) @@ -1302,7 +1302,7 @@ def assign_airfoil_values(wt_opt, modeling_options, airfoils): wt_opt["airfoils.name"] = name wt_opt["airfoils.ac"] = ac wt_opt["airfoils.r_thick"] = r_thick - wt_opt["airfoils.Re"] = Re # Not yet implemented! + wt_opt["airfoils.Re"] = Re wt_opt["airfoils.cl"] = cl wt_opt["airfoils.cd"] = cd wt_opt["airfoils.cm"] = cm diff --git a/wisdem/rotorse/rotor_power.py b/wisdem/rotorse/rotor_power.py index 79c220524..bb771f966 100644 --- a/wisdem/rotorse/rotor_power.py +++ b/wisdem/rotorse/rotor_power.py @@ -9,6 +9,7 @@ from openmdao.api import Group, ExplicitComponent from scipy.optimize import brentq, minimize, minimize_scalar from scipy.interpolate import PchipInterpolator +from wisdem.ccblade.Polar import Polar from wisdem.ccblade.ccblade import CCBlade, CCAirfoil from wisdem.commonse.utilities import smooth_abs, smooth_min, linspace_with_deriv from wisdem.commonse.distribution import RayleighCDF, WeibullWithMeanCDF @@ -843,25 +844,20 @@ def eval_unsteady(alpha, cl, cd, cm): # calculate unsteady coefficients from polars for OpenFAST's Aerodyn unsteady = {} - - alpha_rad = np.radians(alpha) - cn = cl * np.cos(alpha_rad) + cd * np.sin(alpha_rad) - - # alpha0, Cd0, Cm0 - aoa_l = [-30.0] - aoa_h = [30.0] - idx_low = np.argmin(np.abs(alpha - aoa_l)) - idx_high = np.argmin(np.abs(alpha - aoa_h)) - - if np.abs(np.gradient(cl)).max() > 0.0: - unsteady["alpha0"] = np.interp(0.0, cl[idx_low:idx_high], alpha[idx_low:idx_high]) - unsteady["Cd0"] = np.interp(0.0, cl[idx_low:idx_high], cd[idx_low:idx_high]) - unsteady["Cm0"] = np.interp(0.0, cl[idx_low:idx_high], cm[idx_low:idx_high]) - else: - unsteady["alpha0"] = 0.0 - unsteady["Cd0"] = cd[np.argmin(np.abs(alpha - 0.0))] - unsteady["Cm0"] = 0.0 - + Re = 1e6 # Does not factor into any calculations + try: + mypolar = Polar(Re, alpha, cl, cd, cm, compute_params=True, radians=False) + (alpha0, alpha1, alpha2, cnSlope, cn1, cn2, cd0, cm0) = mypolar.unsteadyParams() + except: + alpha0 = alpha1 = alpha2 = cnSlope = cn1 = cn2 = cd0 = cm0 = 0.0 + unsteady["alpha0"] = alpha0 + unsteady["alpha1"] = alpha1 + unsteady["alpha2"] = alpha2 + unsteady["Cd0"] = cd0 + unsteady["Cm0"] = cm0 + unsteady["Cn1"] = cn1 + unsteady["Cn2"] = cn2 + unsteady["C_nalpha"] = cnSlope unsteady["eta_e"] = 1 unsteady["T_f0"] = "Default" unsteady["T_V0"] = "Default" @@ -877,97 +873,6 @@ def eval_unsteady(alpha, cl, cd, cm): unsteady["S2"] = 0 unsteady["S3"] = 0 unsteady["S4"] = 0 - - def find_breakpoint(x, y, idx0, idx1, multi=1.0): - lin_fit = np.interp(x[idx0:idx1], [x[idx0], x[idx1]], [y[idx0], y[idx1]]) - idx_break = 0 - lin_diff = 0 - # GB: Seems like this for loop can be replaced in two lines: - test_diff = np.abs(y[idx0:idx1] - lin_fit) if multi == 0.0 else multi * (y[idx0:idx1] - lin_fit) - idx_break2 = np.argmax(test_diff) + idx0 - for i, (fit, yi) in enumerate(zip(lin_fit, y[idx0:idx1])): - if multi == 0: - diff_i = np.abs(yi - fit) - else: - diff_i = multi * (yi - fit) - if diff_i > lin_diff: - lin_diff = diff_i - idx_break = i - idx_break += idx0 - # print(idx_break, idx_break2) - return idx_break - - # Cn1 - idx_alpha0 = np.argmin(np.abs(alpha - unsteady["alpha0"])) - - if np.abs(np.gradient(cm)).max() > 1.0e-10: - # print('aoa_h',aoa_h, alpha[idx_alpha0] + 35.0) - aoa_h = alpha[idx_alpha0] + 35.0 - idx_high = high0 = np.argmin(np.abs(alpha - aoa_h)) - - # GB: Don't really understand what this is doing. Also seems like idx_high will always be the last index? - cm_temp = cm[idx_low:idx_high] - idx_cm_min = [ - i - for i, local_min in enumerate( - np.r_[True, cm_temp[1:] < cm_temp[:-1]] & np.r_[cm_temp[:-1] < cm_temp[1:], True] - ) - if local_min - ] + idx_low - idx_high = idx_cm_min[-1] - # print('0', high0, idx_high) - idx_Cn1 = find_breakpoint(alpha, cm, idx_alpha0, idx_high) - unsteady["Cn1"] = cn[idx_Cn1] - else: - idx_Cn1 = np.argmin(np.abs(alpha - 0.0)) - unsteady["Cn1"] = 0.0 - - # Cn2 - if np.abs(np.gradient(cm)).max() > 1.0e-10: - # print('aoa_l',aoa_l, np.mean([alpha[idx_alpha0], alpha[idx_Cn1]]) - 30.0) - aoa_l = np.mean([alpha[idx_alpha0], alpha[idx_Cn1]]) - 30.0 - idx_low = np.argmin(np.abs(alpha - aoa_l)) - - # GB: Don't really understand what this is doing. Also seems like idx_high will always be the last index? - # GB: idx_high isn't even used here. Should this be idx_low? - # cm_temp = cm[idx_low:idx_high] - # idx_cm_min = [ - # i - # for i, local_min in enumerate( - # np.r_[True, cm_temp[1:] < cm_temp[:-1]] & np.r_[cm_temp[:-1] < cm_temp[1:], True] - # ) - # if local_min - # ] + idx_low - # idx_high = idx_cm_min[-1] - - idx_Cn2 = find_breakpoint(alpha, cm, idx_low, idx_alpha0, multi=0.0) - unsteady["Cn2"] = cn[idx_Cn2] - else: - idx_Cn2 = np.argmin(np.abs(alpha - 0.0)) - unsteady["Cn2"] = 0.0 - - # C_nalpha - # GB: Added index check to avoid backwards cases - if np.abs(np.gradient(cm)).max() > 1.0e-10 and (idx_Cn1 > idx_alpha0): - # unsteady['C_nalpha'] = np.gradient(cn, alpha_rad)[idx_alpha0] - unsteady["C_nalpha"] = np.gradient(cn[idx_alpha0:idx_Cn1], alpha_rad[idx_alpha0:idx_Cn1]).max() - else: - unsteady["C_nalpha"] = 0.0 - - # alpha1, alpha2 - # finding the break point in drag as a proxy for Trailing Edge separation, f=0.7 - # 3d stall corrections cause erroneous f calculations - # GB: Added index check to avoid backwards cases - if np.abs(np.gradient(cm)).max() > 1.0e-10 and (alpha[idx_Cn1] > 0.0): - aoa_l = [0.0] - idx_low = np.argmin(np.abs(alpha - aoa_l)) - idx_alpha1 = find_breakpoint(alpha, cd, idx_low, idx_Cn1, multi=-1.0) - unsteady["alpha1"] = alpha[idx_alpha1] - else: - idx_alpha1 = np.argmin(np.abs(alpha - 0.0)) - unsteady["alpha1"] = 0.0 - unsteady["alpha2"] = -1.0 * unsteady["alpha1"] - unsteady["St_sh"] = "Default" unsteady["k0"] = 0 unsteady["k1"] = 0 @@ -977,7 +882,6 @@ def find_breakpoint(x, y, idx0, idx1, multi=1.0): unsteady["x_cp_bar"] = "Default" unsteady["UACutout"] = "Default" unsteady["filtCutOff"] = "Default" - unsteady["Alpha"] = alpha unsteady["Cl"] = cl unsteady["Cd"] = cd From 2404158933de8e794a3adcf19b835f8464ff4da8 Mon Sep 17 00:00:00 2001 From: pibo Date: Tue, 16 Feb 2021 21:44:55 -0700 Subject: [PATCH 4/8] two files pushed by mistake while debugging --- examples/06_IEA-15-240-RWT/IEA-15-240-RWT.yaml | 11 ----------- examples/07_te_flaps/modeling_options.yaml | 6 +++--- 2 files changed, 3 insertions(+), 14 deletions(-) diff --git a/examples/06_IEA-15-240-RWT/IEA-15-240-RWT.yaml b/examples/06_IEA-15-240-RWT/IEA-15-240-RWT.yaml index 98fadf7bd..50a48e872 100644 --- a/examples/06_IEA-15-240-RWT/IEA-15-240-RWT.yaml +++ b/examples/06_IEA-15-240-RWT/IEA-15-240-RWT.yaml @@ -515,17 +515,6 @@ airfoils: c_m: grid: *grid005 values: [-0.0001, -0.0001] - - configuration: Default - re: 1.00E+07 - c_l: - grid: &grid004 [-3.14, -3.101699414, -3.061806173, -3.021912933, -2.98202, -2.94213, -2.902233213, -2.862339973, -2.82245, -2.78255, -2.74266, -2.70277, -2.662873773, -2.622980533, -2.583087293, -2.510780795, -2.438474298, -2.3661678, -2.293861303, -2.221554805, -2.149248307, -2.07694181, -2.004635312, -1.932328815, -1.860022317, -1.78771582, -1.715409322, -1.643102824, -1.570796327, -1.498489829, -1.426183332, -1.353876834, -1.281570336, -1.209263839, -1.136957341, -1.064650844, -0.992344346, -0.920037849, -0.847731351, -0.775424853, -0.703118356, -0.630811858, -0.558505361, -0.488692191, -0.41887902, -0.34906585, -0.314159265, -0.27925268, -0.244346095, -0.20943951, -0.174532925, -0.13962634, -0.104719755, -0.06981317, -0.034906585, -0.017453293, 0, 0.017453293, 0.034906585, 0.052359878, 0.06981317, 0.087266463, 0.104719755, 0.122173048, 0.13962634, 0.157079633, 0.174532925, 0.191986218, 0.20943951, 0.226892803, 0.244346095, 0.261799388, 0.27925268, 0.314159265, 0.34906585, 0.41887902, 0.488692191, 0.558505361, 0.630811858, 0.703118356, 0.775424853, 0.847731351, 0.920037849, 0.992344346, 1.064650844, 1.136957341, 1.209263839, 1.281570336, 1.353876834, 1.426183332, 1.498489829, 1.570796327, 1.643102824, 1.715409322, 1.78771582, 1.860022317, 1.932328815, 2.004635312, 2.07694181, 2.149248307, 2.221554805, 2.293861303, 2.3661678, 2.438474298, 2.510780795, 2.583087293, 2.622980533, 2.662873773, 2.702767013, 2.742660253, 2.782553493, 2.822446733, 2.862339973, 2.902233213, 2.942126453, 2.982019693, 3.021912933, 3.061806173, 3.101699414, 3.14] - values: [0.0, 0.05402504999999973, 0.1080501000000001, 0.1620751499999998, 0.2161002000000001, 0.2701252499999999, 0.3241502999999996, 0.3781753499999999, 0.4322003999999997, 0.4862254499999999, 0.5402504999999997, 0.5942755500000001, 0.6483005999999998, 0.70232565, 0.7563506999999998, 0.7318783269239915, 0.7065528355994307, 0.6776040044026928, 0.6433295384757597, 0.6027662380766498, 0.5555015408989838, 0.5015565175320579, 0.441306592466731, 0.3754225708324188, 0.3048226261816518, 0.2306301410703767, 0.1541346331849047, 0.0767543574378533, 6.938893903907228e-17, -0.07675435743785307, -0.1541346331849047, -0.2306301410703764, -0.3048226261816516, -0.3754225708324188, -0.4413065924667308, -0.5015565175320579, -0.5555015408989837, -0.6027662380766498, -0.6433295384757594, -0.6776040044026929, -0.7065528355994307, -0.7318783269239915, -0.7563507000000002, -0.85636, -1.18292, -1.23596, -1.22536, -1.20476, -1.18332, -1.10093, -0.882085, -0.62981, -0.376701, -0.121772, 0.128101, 0.25192, 0.375354, 0.498281, 0.6205240000000001, 0.742004, 0.862375, 0.98114, 1.09662, 1.20904, 1.3168, 1.42209, 1.52361, 1.61988, 1.70937, 1.78681, 1.8429, 1.85313, 1.80951, 1.66033, 1.56152, 1.43327, 1.29062, 1.080501, 1.045540467034274, 1.009361193713472, 0.9680057205752755, 0.9190421978225134, 0.8610946258237854, 0.7935736298556911, 0.7165093107600827, 0.6304379892381867, 0.5363179583320269, 0.4354608945452166, 0.3294716301005378, 0.2201923331212924, 0.1096490820540758, 9.71445146547012e-17, -0.07675435743785305, -0.1541346331849047, -0.2306301410703764, -0.3048226261816516, -0.3754225708324188, -0.4413065924667307, -0.5015565175320579, -0.5555015408989835, -0.6027662380766498, -0.6433295384757597, -0.6776040044026928, -0.7065528355994307, -0.7318783269239915, -0.7563507000000002, -0.70232565, -0.6483005999999998, -0.5942755500000001, -0.5402504999999997, -0.4862254499999999, -0.4322004000000002, -0.3781753499999999, -0.3241503000000002, -0.2701252499999999, -0.2161002000000001, -0.1620751499999998, -0.1080501000000001, -0.05402504999999973, 4.85722573273506e-18] - c_d: - grid: *grid004 - values: [0.02464146255885971, 0.0253381915760185, 0.02742386791262707, 0.03088494454883671, 0.03569894666004403, 0.05599104793704501, 0.08143456941199648, 0.111118119977472, 0.1448529823401942, 0.1824246843171338, 0.2235943631517934, 0.2681002849817088, 0.3156595097900088, 0.3659696912483095, 0.418711, 0.5194063216490634, 0.624878215320418, 0.7329268692419378, 0.8412988626197737, 0.9477341973794456, 1.050013466313862, 1.146004172998905, 1.233705236549658, 1.311288752188593, 1.37713813588963, 1.429881856853057, 1.468422053679695, 1.491957436925499, 1.5, 1.491957436925499, 1.468422053679695, 1.429881856853057, 1.37713813588963, 1.311288752188593, 1.233705236549658, 1.146004172998905, 1.050013466313863, 0.9477341973794456, 0.8412988626197743, 0.7329268692419378, 0.6248782153204183, 0.5194063216490632, 0.418711, 0.286909, 0.139597, 0.0834459, 0.0650916, 0.0488819, 0.0341723, 0.0213247, 0.0138586, 0.0107541, 0.008815799999999999, 0.00702184, 0.00663047, 0.00664363, 0.00670056, 0.00680819, 0.00697859, 0.00720311, 0.007514809999999999, 0.00795847, 0.00872169, 0.009683530000000001, 0.0109695, 0.0122748, 0.0136859, 0.0152881, 0.0171709, 0.0197355, 0.0236792, 0.0309403, 0.0430319, 0.0773041, 0.112017, 0.18408, 0.275892, 0.418711, 0.5194063216490632, 0.6248782153204185, 0.7329268692419378, 0.8412988626197743, 0.9477341973794456, 1.050013466313863, 1.146004172998905, 1.233705236549658, 1.311288752188593, 1.37713813588963, 1.429881856853057, 1.468422053679695, 1.491957436925499, 1.5, 1.491957436925499, 1.468422053679695, 1.429881856853057, 1.37713813588963, 1.311288752188593, 1.233705236549658, 1.146004172998905, 1.050013466313863, 0.9477341973794456, 0.8412988626197737, 0.7329268692419378, 0.624878215320418, 0.5194063216490634, 0.418711, 0.3659696912483095, 0.3156595097900088, 0.2681002849817088, 0.2235943631517934, 0.1824246843171338, 0.1448529823401946, 0.111118119977472, 0.08143456941199678, 0.05599104793704501, 0.03569894666004403, 0.03088494454883671, 0.02742386791262707, 0.0253381915760185, 0.02464146255885971] - c_m: - grid: *grid004 - values: [0.0, 0.09142857142857111, 0.1828571428571434, 0.2742857142857145, 0.3657142857142855, 0.3919171380083344, 0.3789845588216693, 0.3660519796350041, 0.353119400448339, 0.3476784059442646, 0.3647121654879618, 0.3817459250316594, 0.3987796845753567, 0.4158134441190544, 0.4195454592054533, 0.4228655348597155, 0.4263227290676669, 0.4316310237504245, 0.436939318433182, 0.4438932390944983, 0.4517132786918981, 0.458974087487912, 0.4644773137652843, 0.4699805400426567, 0.4709637155505512, 0.4710052138148045, 0.4682373893923625, 0.4614896911637687, 0.4547419929351749, 0.440261605201769, 0.4257812174683632, 0.4082106877197933, 0.3884588812546371, 0.3681533816888277, 0.3451901552398833, 0.322226928790939, 0.2986411272359326, 0.2748572336017246, 0.2512805789575005, 0.2280976783942457, 0.2049147778309909, 0.1541624777852183, 0.101368, 0.0652698, 0.01647420000000005, -0.0035156, -0.006716600000000001, -0.00881275, -0.0110092, -0.02268789999999999, -0.0439675, -0.0575595, -0.0674747, -0.07680390000000001, -0.08283, -0.08534420000000001, -0.0877721, -0.0901057, -0.0923415, -0.094469, -0.0964635, -0.0982801, -0.0997729, -0.100947, -0.1016336, -0.1020701, -0.1021297, -0.1017353, -0.100868, -0.09936350000000001, -0.0971987, -0.0940975, -0.0914393, -0.09242, -0.09870720000000001, -0.117702, -0.145658, -0.18266, -0.2091344193953699, -0.2353353726197231, -0.2578445325353481, -0.2803536924509731, -0.301631395515415, -0.3222609633950237, -0.3424694255055559, -0.3613544123418473, -0.3802393991781386, -0.3970410534414668, -0.4134086800854276, -0.4284443809438795, -0.4415931869395273, -0.4547419929351749, -0.4614896911637686, -0.4682373893923625, -0.4710052138148045, -0.4709637155505513, -0.4699805400426568, -0.4644773137652844, -0.458974087487912, -0.4517132786918981, -0.4438932390944983, -0.436939318433182, -0.4316310237504245, -0.4263227290676669, -0.4228655348597155, -0.4195454592054533, -0.4158134441190544, -0.3987796845753567, -0.3817459250316594, -0.3647121654879618, -0.3476784059442646, -0.3702622575911958, -0.4060519796350041, -0.4418417016788119, -0.4776314237226202, -0.457142857142857, -0.3428571428571431, -0.2285714285714291, -0.1142857142857139, 0.0] - name: SNL-FFA-W3-500 coordinates: x: [1.00000000, 0.99944304, 0.99812049, 0.99569352, 0.99230484, 0.98802844, 0.98281508, 0.97666422, 0.96964069, 0.96174313, 0.95297315, 0.94338928, 0.93301284, 0.92185147, 0.90995468, 0.89736121, 0.88408503, 0.87016290, 0.85565276, 0.84057695, 0.82497463, 0.80889455, 0.79236237, 0.77542101, 0.75812546, 0.74050180, 0.72259209, 0.70444539, 0.68608843, 0.66757021, 0.64892678, 0.63018643, 0.61140138, 0.59259673, 0.57380843, 0.55507570, 0.53641763, 0.51787958, 0.49948103, 0.48125155, 0.46322225, 0.44540666, 0.42784323, 0.41053864, 0.39352525, 0.37681123, 0.36041977, 0.34436494, 0.32865846, 0.31331898, 0.29834798, 0.28376580, 0.26956679, 0.25577362, 0.24237780, 0.22939648, 0.21681735, 0.20465763, 0.19290757, 0.18157496, 0.17065819, 0.16014896, 0.15005511, 0.14035465, 0.13106750, 0.12216148, 0.11365876, 0.10553619, 0.09779065, 0.09042902, 0.08341621, 0.07677403, 0.07046920, 0.06450016, 0.05888182, 0.05356799, 0.04857581, 0.04389793, 0.03949498, 0.03539484, 0.03157626, 0.02800644, 0.02471592, 0.02168071, 0.01886319, 0.01629514, 0.01396620, 0.01181764, 0.00988361, 0.00818368, 0.00663128, 0.00524853, 0.00408271, 0.00308998, 0.00219098, 0.00145967, 0.00096333, 0.00059878, 0.00028988, 0.00007804, 0.00000000, 0.00007807, 0.00029009, 0.00059937, 0.00096448, 0.00146264, 0.00219661, 0.00309879, 0.00409516, 0.00526774, 0.00665839, 0.00821941, 0.00993095, 0.01187982, 0.01404463, 0.01639219, 0.01898469, 0.02182867, 0.02489252, 0.02822001, 0.03182924, 0.03568998, 0.03984236, 0.04430035, 0.04903788, 0.05410025, 0.05948747, 0.06518787, 0.07124791, 0.07764648, 0.08439704, 0.09152340, 0.09900711, 0.10688721, 0.11514762, 0.12380644, 0.13287211, 0.14233176, 0.15221460, 0.16249918, 0.17321393, 0.18434125, 0.19590296, 0.20788328, 0.22029378, 0.23312344, 0.24637487, 0.26004146, 0.27412439, 0.28861129, 0.30349962, 0.31877410, 0.33443448, 0.35045732, 0.36684322, 0.38356093, 0.40060975, 0.41795607, 0.43559330, 0.45349250, 0.47163211, 0.48999236, 0.50853595, 0.52724867, 0.54608860, 0.56503090, 0.58404504, 0.60308800, 0.62213765, 0.64114752, 0.66008031, 0.67890619, 0.69757164, 0.71604492, 0.73429135, 0.75225234, 0.76989792, 0.78719153, 0.80407383, 0.82051349, 0.83646946, 0.85189026, 0.86674791, 0.88100970, 0.89461041, 0.90752456, 0.91973040, 0.93117530, 0.94182765, 0.95167536, 0.96067486, 0.96878747, 0.97601191, 0.98233053, 0.98768615, 0.99208631, 0.99557391, 0.99806302, 0.99942968, 1.00000000] diff --git a/examples/07_te_flaps/modeling_options.yaml b/examples/07_te_flaps/modeling_options.yaml index e56dfe5e6..df1f2a420 100644 --- a/examples/07_te_flaps/modeling_options.yaml +++ b/examples/07_te_flaps/modeling_options.yaml @@ -20,9 +20,9 @@ Level3: # Options for WEIS fidelity level 3 = nonlinear time domain flag: True simulation: DT: 0.01 - TMax: 10 - TStart: 0 - SttsTime: 1. + TMax: 720 + TStart: 120 + SttsTime: 100. ElastoDyn: flag: True FlapDOF1: True From b51f7c3b8565dfd5a5d50a16963fbecd14844a02 Mon Sep 17 00:00:00 2001 From: pibo Date: Tue, 16 Feb 2021 22:44:59 -0700 Subject: [PATCH 5/8] tsr opt is now dimensional --- examples/02_control_opt/analysis_options.yaml | 6 +++--- examples/03_NREL5MW_OC3_spar/analysis_options.yaml | 6 +++--- examples/04_NREL5MW_OC4_semi/analysis_options.yaml | 6 +++--- examples/05_IEA-3.4-130-RWT/analysis_options.yaml | 6 +++--- examples/06_IEA-15-240-RWT/analysis_options.yaml | 6 +++--- examples/07_te_flaps/analysis_options.yaml | 6 +++--- examples/09_design_of_experiments/analysis_options.yaml | 6 +++--- 7 files changed, 21 insertions(+), 21 deletions(-) diff --git a/examples/02_control_opt/analysis_options.yaml b/examples/02_control_opt/analysis_options.yaml index ee0706351..4d403526e 100644 --- a/examples/02_control_opt/analysis_options.yaml +++ b/examples/02_control_opt/analysis_options.yaml @@ -51,9 +51,9 @@ design_variables: max_end: 0.99 control: tsr: - flag: False # Flag to optimize the rotor tip speed ratio - min_gain: 0.9 # Nondimensional lower bound - max_gain: 1.1 # Nondimensional upper bound + flag: False + minimum: 7 + maximum: 13 servo: pitch_control: flag: True diff --git a/examples/03_NREL5MW_OC3_spar/analysis_options.yaml b/examples/03_NREL5MW_OC3_spar/analysis_options.yaml index 56d22ee1a..4e2ca0fc2 100644 --- a/examples/03_NREL5MW_OC3_spar/analysis_options.yaml +++ b/examples/03_NREL5MW_OC3_spar/analysis_options.yaml @@ -51,9 +51,9 @@ design_variables: max_end: 1.0 control: tsr: - flag: False # Flag to optimize the rotor tip speed ratio - min_gain: 0.9 # Nondimensional lower bound - max_gain: 1.1 # Nondimensional upper bound + flag: False + minimum: 7 + maximum: 13 servo: pitch_control: flag: False diff --git a/examples/04_NREL5MW_OC4_semi/analysis_options.yaml b/examples/04_NREL5MW_OC4_semi/analysis_options.yaml index 703dadff6..d0e14c77e 100644 --- a/examples/04_NREL5MW_OC4_semi/analysis_options.yaml +++ b/examples/04_NREL5MW_OC4_semi/analysis_options.yaml @@ -51,9 +51,9 @@ design_variables: max_end: 1.0 control: tsr: - flag: False # Flag to optimize the rotor tip speed ratio - min_gain: 0.9 # Nondimensional lower bound - max_gain: 1.1 # Nondimensional upper bound + flag: False + minimum: 7 + maximum: 13 servo: pitch_control: flag: False diff --git a/examples/05_IEA-3.4-130-RWT/analysis_options.yaml b/examples/05_IEA-3.4-130-RWT/analysis_options.yaml index 0c1cb4ed6..8818e756f 100644 --- a/examples/05_IEA-3.4-130-RWT/analysis_options.yaml +++ b/examples/05_IEA-3.4-130-RWT/analysis_options.yaml @@ -51,9 +51,9 @@ design_variables: max_end: 1.0 control: tsr: - flag: False # Flag to optimize the rotor tip speed ratio - min_gain: 0.9 # Nondimensional lower bound - max_gain: 1.1 # Nondimensional upper bound + flag: True + minimum: 7 + maximum: 13 servo: pitch_control: flag: False diff --git a/examples/06_IEA-15-240-RWT/analysis_options.yaml b/examples/06_IEA-15-240-RWT/analysis_options.yaml index 3707c82c2..fc8ef6916 100644 --- a/examples/06_IEA-15-240-RWT/analysis_options.yaml +++ b/examples/06_IEA-15-240-RWT/analysis_options.yaml @@ -51,9 +51,9 @@ design_variables: max_end: 1.0 control: tsr: - flag: False # Flag to optimize the rotor tip speed ratio - min_gain: 0.9 # Nondimensional lower bound - max_gain: 1.1 # Nondimensional upper bound + flag: True # Flag to optimize the rotor tip speed ratio + minimum: 7 + maximum: 13 servo: pitch_control: flag: False diff --git a/examples/07_te_flaps/analysis_options.yaml b/examples/07_te_flaps/analysis_options.yaml index 5bc6ee1ac..8f43ea4f4 100644 --- a/examples/07_te_flaps/analysis_options.yaml +++ b/examples/07_te_flaps/analysis_options.yaml @@ -41,9 +41,9 @@ design_variables: max_end: 0.99 control: tsr: - flag: False # Flag to optimize the rotor tip speed ratio - min_gain: 0.9 # Nondimensional lower bound - max_gain: 1.1 # Nondimensional upper bound + flag: False + minimum: 7 + maximum: 13 servo: pitch_control: flag: False diff --git a/examples/09_design_of_experiments/analysis_options.yaml b/examples/09_design_of_experiments/analysis_options.yaml index d97040ff0..b22cab1fc 100644 --- a/examples/09_design_of_experiments/analysis_options.yaml +++ b/examples/09_design_of_experiments/analysis_options.yaml @@ -51,9 +51,9 @@ design_variables: max_end: 1.0 control: tsr: - flag: False # Flag to optimize the rotor tip speed ratio - min_gain: 0.9 # Nondimensional lower bound - max_gain: 1.1 # Nondimensional upper bound + flag: False + minimum: 7 + maximum: 13 servo: pitch_control: flag: False From adc08fa714b6cb22543f4211efe941f7bbc11cad Mon Sep 17 00:00:00 2001 From: pibo Date: Tue, 16 Feb 2021 22:58:09 -0700 Subject: [PATCH 6/8] AFAeroMod must be specified in run_DLC --- examples/01_aeroelasticse/run_DLC.py | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/01_aeroelasticse/run_DLC.py b/examples/01_aeroelasticse/run_DLC.py index ad0f8007f..597c37e2a 100644 --- a/examples/01_aeroelasticse/run_DLC.py +++ b/examples/01_aeroelasticse/run_DLC.py @@ -150,6 +150,7 @@ path2dll = os.path.join(run_dir1, 'local/lib/libdiscon.so') case_inputs[("ServoDyn","DLL_FileName")] = {'vals':[path2dll], 'group':0} +case_inputs[("AeroDyn15","AFAeroMod")] = {'vals':[2], 'group':0} case_inputs[("AeroDyn15","TwrAero")] = {'vals':["True"], 'group':0} case_inputs[("AeroDyn15","TwrPotent")] = {'vals':[1], 'group':0} case_inputs[("AeroDyn15","TwrShadow")] = {'vals':[1], 'group':0} From 521af57510eea6092f9ed96edae62a1f18e25432 Mon Sep 17 00:00:00 2001 From: pibo Date: Tue, 16 Feb 2021 22:58:22 -0700 Subject: [PATCH 7/8] run examples 03 and 04 --- weis/test/run_examples.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weis/test/run_examples.py b/weis/test/run_examples.py index f1eb280a6..51821a4f0 100644 --- a/weis/test/run_examples.py +++ b/weis/test/run_examples.py @@ -18,9 +18,9 @@ # "02_control_opt/run_lin_turbine", # "02_control_opt/runOptimization", - # "03_NREL5MW_OC3_spar/weis_driver", + "03_NREL5MW_OC3_spar/weis_driver", - # "04_NREL5MW_OC4_semi/", # there appears to be no python file within this folder + "04_NREL5MW_OC4_semi/weis_driver", "05_IEA-3.4-130-RWT/weis_driver", From f508525bb50c6685d847af6425eb378fa27ea609 Mon Sep 17 00:00:00 2001 From: Garrett Barter Date: Wed, 17 Feb 2021 05:05:55 -0700 Subject: [PATCH 8/8] turning off optimization where it was accidently activated --- .../analysis_options_semi.yaml | 203 ------------------ .../05_IEA-3.4-130-RWT/analysis_options.yaml | 2 +- .../06_IEA-15-240-RWT/analysis_options.yaml | 2 +- examples/08_OLAF/analysis_options.yaml | 2 +- 4 files changed, 3 insertions(+), 206 deletions(-) delete mode 100644 examples/04_NREL5MW_OC4_semi/analysis_options_semi.yaml diff --git a/examples/04_NREL5MW_OC4_semi/analysis_options_semi.yaml b/examples/04_NREL5MW_OC4_semi/analysis_options_semi.yaml deleted file mode 100644 index 7b3b96f20..000000000 --- a/examples/04_NREL5MW_OC4_semi/analysis_options_semi.yaml +++ /dev/null @@ -1,203 +0,0 @@ -general: - folder_output: outputs_floating_example - fname_output: optimized_semi -design_variables: - floating: - joints: - z_coordinate: - # Adjusts the z-coordinate of the listed joints: Useful for draft, freeboard, fairlead - linked: - # This will set the same z-value for all of the joints listed in the same names entry - - names: [col1_keel, col2_keel, col3_keel] - flag: True - lower_bound = -100.0 - upper_bound = -5.0 - - names: [col1_freeboard, col2_freeboard, col3_freeboard] - flag: True - lower_bound = 5.0 - upper_bound = 30.0 - independent: - # This will adjust the z-coordinate of the joints separately - - name: main_keel - flag: True - lower_bound = -100.0 - upper_bound = -5.0 - - name: main_freeboard - flag: True - lower_bound = 5.0 - upper_bound = 30.0 - r_coordinate: - # Adjusts the r-coordinate of the listed joints to be a desired radius from (0,0). - linked: - # This will set the x,y-value for all of the joints listed in the same names entry at constant angle relative to (0,0) - - names: [col1_keel, col1_freeboard, col2_keel, col2_freeboard, col3_keel, col3_freeboard] - flag: True - lower_bound = 5.0 - upper_bound = 75.0 - members: - diameter: - linked_members: - # This will set the same diameter profile for all of the members listed in the same names entry - - names: [column1, column2, column3] - flag: True - lower_bound: 1.0 - upper_bound: 20.0 - - names: [delta_pontoon_lower12, delta_pontoon_lower23, delta_pontoon_lower31] - flag: True - lower_bound: 1.0 - upper_bound: 5.0 - - names: [delta_pontoon_upper12, delta_pontoon_upper23, delta_pontoon_upper31] - flag: True - lower_bound: 1.0 - upper_bound: 5.0 - - names: [Y_pontoon_lower12, Y_pontoon_lower23, Y_pontoon_lower31] - flag: True - lower_bound: 1.0 - upper_bound: 5.0 - - names: [Y_pontoon_upper12, Y_pontoon_upper23, Y_pontoon_upper31] - flag: True - lower_bound: 1.0 - upper_bound: 5.0 - - names: [cross_pontoon1, cross_pontoon2, cross_pontoon3] - flag: True - lower_bound: 1.0 - upper_bound: 5.0 - independent_members: - # This will set the same diameter for all of the members listed in the same names entry - - name: main_column - flag: True - lower_bound: 1.0 - upper_bound: 20.0 - thickness: - linked_members: - # This will set the same thickness profile for all of the members listed in the same names entry - - names: [column1, column2, column3] - flag: True - lower_bound: 0.001 - upper_bound: 0.1 - - names: [delta_pontoon_lower12, delta_pontoon_lower23, delta_pontoon_lower31] - flag: True - lower_bound: 0.001 - upper_bound: 0.1 - - names: [delta_pontoon_upper12, delta_pontoon_upper23, delta_pontoon_upper31] - flag: True - lower_bound: 0.001 - upper_bound: 0.1 - - names: [Y_pontoon_lower12, Y_pontoon_lower23, Y_pontoon_lower31] - flag: True - lower_bound: 0.001 - upper_bound: 0.1 - - names: [Y_pontoon_upper12, Y_pontoon_upper23, Y_pontoon_upper31] - flag: True - lower_bound: 0.001 - upper_bound: 0.1 - - names: [cross_pontoon1, cross_pontoon2, cross_pontoon3] - flag: True - lower_bound: 0.001 - upper_bound: 0.1 - independent_members: - # This will set the same thickness for all of the members listed in the same names entry - - name: main_column - flag: True - lower_bound: 0.001 - upper_bound: 0.1 - ballast: - linked: - # This will set the same ballast for all of the members listed in the same names entry. Permanent and variable ballast values will differ, but the same per group - - names: [column1, column2, column3] - flag: True - lower_bound: 1.0 - upper_bound: 1e6 - independent: - # This will set the same ballast for all of the members listed in the same names entry - - name: main_column - flag: True - lower_bound: 1.0 - upper_bound: 1e6 - axial_joints: - # Adjusts the "s-coordinate" (0..1 along the member axis) of the listed joints - # Instead of operating in absolute z-space, the coordinate value is non-dimensional along the member axis (0=joint1) - linked: - - names: [col1_lower_pontoon, col2_lower_pontoon, col3_lower_pontoon] - flag: True - lower_bound: 0.0 - upper_bound: 1.0 - - names: [col1_upper_pontoon, col2_upper_pontoon, col3_upper_pontoon] - flag: True - lower_bound: 0.0 - upper_bound: 1.0 - - names: [col1_cross_pontoon, col2_cross_pontoon, col3_cross_pontoon] - flag: True - lower_bound: 0.0 - upper_bound: 1.0 - - names: [col1_fairlead, col2_fairlead, col3_fairlead] - flag: True - lower_bound: 0.0 - upper_bound: 1.0 - stiffeners: - ring: - size: - flag: True - min_gain: 0.5 - max_gain: 3.0 - spacing: - flag: True - lower_bound: 0.1 - upper_bound: 1.0 - - longitudinal: - size: - flag: False - spacing: - flag: False - mooring: - anchor_radius: - # This adjusts the radius of all anchor nodes from (0,0) - flag: True - lower_bound: 10.0 - upper_bound: 1000.0 - line_length: - # Adjust the unstretched line length of the mooring segments - linked: - # This will set the same line length for all segments listed in the same names entry - - names: [line1, line2, line3] - flag: True - lower_bound: 100.0 - upper_bound: 2000.0 - line_diameter: - # Adjust the diameter of the mooring segments - linked: - # This will set the same diameter for all segments listed in the same names entry - - names: [line1, line2, line3] - flag: True - lower_bound: 0.1 - upper_bound: 2.0 - -merit_figure: LCOE # Merit figure of the optimization problem. The options are 'AEP' - 'LCOE' - 'Cp' - 'blade_mass' - 'blade_tip_deflection' - -constraints: - floating: - # TODO! - - control: - # TODO! - -driver: - optimization: - flag: True # Flag to enable optimization - tol: 1.e-2 # Optimality tolerance - max_major_iter: 10 # Maximum number of major design iterations (SNOPT) - max_minor_iter: 100 # Maximum number of minor design iterations (SNOPT) - max_iter: 100 # Maximum number of iterations (SLSQP) - solver: SLSQP # Optimization solver. Other options are 'SLSQP' - 'CONMIN' - step_size: 1.e-3 # Step size for finite differencing - form: central # Finite differencing mode, either forward or central - design_of_experiments: - flag: False # Flag to enable design of experiments - run_parallel: True # Flag to run using parallel processing - generator: Uniform # Type of input generator. (Uniform) - num_samples: 5 # number of samples for (Uniform only) - -recorder: - flag: True # Flag to activate OpenMDAO recorder - file_name: log_opt.sql # Name of OpenMDAO recorder diff --git a/examples/05_IEA-3.4-130-RWT/analysis_options.yaml b/examples/05_IEA-3.4-130-RWT/analysis_options.yaml index 8818e756f..770a72d68 100644 --- a/examples/05_IEA-3.4-130-RWT/analysis_options.yaml +++ b/examples/05_IEA-3.4-130-RWT/analysis_options.yaml @@ -51,7 +51,7 @@ design_variables: max_end: 1.0 control: tsr: - flag: True + flag: False minimum: 7 maximum: 13 servo: diff --git a/examples/06_IEA-15-240-RWT/analysis_options.yaml b/examples/06_IEA-15-240-RWT/analysis_options.yaml index fc8ef6916..63e8b2a18 100644 --- a/examples/06_IEA-15-240-RWT/analysis_options.yaml +++ b/examples/06_IEA-15-240-RWT/analysis_options.yaml @@ -51,7 +51,7 @@ design_variables: max_end: 1.0 control: tsr: - flag: True # Flag to optimize the rotor tip speed ratio + flag: False # Flag to optimize the rotor tip speed ratio minimum: 7 maximum: 13 servo: diff --git a/examples/08_OLAF/analysis_options.yaml b/examples/08_OLAF/analysis_options.yaml index 173a20387..0b4b90708 100644 --- a/examples/08_OLAF/analysis_options.yaml +++ b/examples/08_OLAF/analysis_options.yaml @@ -41,7 +41,7 @@ constraints: driver: optimization: - flag: True + flag: False tol: 1.e-3 # Optimality tolerance max_major_iter: 10 # Maximum number of major design iterations (SNOPT) max_minor_iter: 100 # Maximum number of minor design iterations (SNOPT)