h2lib-tests 13.1.304__py3-none-any.whl → 13.1.502__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,732 @@
1
+ ;DTU_10MW_RWT, version 9, 25-09-2017, mhha
2
+ ;
3
+ begin simulation;
4
+ time_stop 1000.0;
5
+ solvertype 1 ; (newmark)
6
+ on_no_convergence continue ;
7
+ convergence_limits 1E3 1.0 1E-7 ;
8
+ logfile ./log/DTU_10MW_RWT.log ;
9
+ log_deltat .1;
10
+ begin newmark;
11
+ deltat 0.02;
12
+ end newmark;
13
+ ; visualization visu.hdf5 0 30;
14
+ end simulation;
15
+ ;
16
+ ;----------------------------------------------------------------------------------------------------------------------------------------------------------------
17
+ begin new_htc_structure;
18
+ ; beam_output_file_name ./log/DTU_10MW_RWT_beam.dat; Optional - Calculated beam properties of the bodies are written to file
19
+ ; body_output_file_name ./log/DTU_10MW_RWT_body.dat; Optional - Body initial position and orientation are written to file
20
+ ; body_eigenanalysis_file_name ./eig/DTU_10MW_RWT_body_eigen.dat;
21
+ ; structure_eigenanalysis_file_name ./eig/DTU_10MW_RWT_strc_eigen.dat ;
22
+ ;-------------------------------------------------------------------------------------------------------------------------------
23
+ ;-------------------------------------------------------------------------------------------------------------------------------
24
+ begin main_body; tower 115m
25
+ name tower ;
26
+ type timoschenko ;
27
+ nbodies 1 ;
28
+ node_distribution c2_def ;
29
+ damping_posdef 0.0 0.0 0.0 4.12E-03 4.12E-03 4.5E-04 ; Mx My Mz Kx Ky Kz , M´s raises overall level, K´s raises high freguency level "tuned by Larh"
30
+ begin timoschenko_input;
31
+ filename ./data/DTU_10MW_RWT_Tower_st.dat;
32
+ set 1 1 ;
33
+ end timoschenko_input;
34
+ begin c2_def; Definition of centerline (main_body coordinates)
35
+ nsec 11;
36
+ sec 1 0 0 0.00 0 ; x,y,z,twist
37
+ sec 2 0 0 -11.50 0 ;
38
+ sec 3 0 0 -23.00 0 ;
39
+ sec 4 0 0 -34.50 0 ;
40
+ sec 5 0 0 -46.00 0 ;
41
+ sec 6 0 0 -57.50 0 ;
42
+ sec 7 0 0 -69.00 0 ;
43
+ sec 8 0 0 -80.50 0 ;
44
+ sec 9 0 0 -92.00 0 ;
45
+ sec 10 0 0 -103.50 0 ;
46
+ sec 11 0 0 -115.63 0 ;
47
+ end c2_def ;
48
+ end main_body;
49
+ ;
50
+ begin main_body;
51
+ name towertop ;
52
+ type timoschenko ;
53
+ nbodies 1 ;
54
+ node_distribution c2_def ;
55
+ damping_posdef 0.0 0.0 0.0 7.00E-03 7.00E-03 7.00E-03 ; "changed by Larh"
56
+ concentrated_mass 2.0 0.0 2.6870E+00 3.0061E-01 4.4604E+05 4.1060E+06 4.1060E+05 4.1060E+06 ; Nacelle mass and inertia "corrected by Anyd 25/4/13"
57
+ begin timoschenko_input;
58
+ filename ./data/DTU_10MW_RWT_Towertop_st.dat ;
59
+ set 1 2 ;
60
+ end timoschenko_input;
61
+ begin c2_def; Definition of centerline (main_body coordinates)
62
+ nsec 2;
63
+ sec 1 0.0 0.0 0.0 0.0 ; x,y,z,twist
64
+ sec 2 0.0 0.0 -2.75 0.0 ;
65
+ end c2_def ;
66
+ end main_body;
67
+ ;
68
+ begin main_body;
69
+ name shaft ;
70
+ type timoschenko ;
71
+ nbodies 1 ;
72
+ node_distribution c2_def ;
73
+ damping_posdef 0.0 0.0 0.0 4.65E-04 4.65E-04 3.983E-03 ; "tuned by Anyd 23/5/13 to 31.45 log decr. damping for free free with stiff rotor and tower"
74
+ concentrated_mass 1.0 0.0 0.0 0.0 0.0 0.0 0.0 3.751E+06 ; generator equivalent slow shaft "re_tuned by Anyd 20/2/13"
75
+ concentrated_mass 5.0 0.0 0.0 0.0 1.0552E+05 0.0 0.0 3.257E+05 ; hub mass and inertia; "re_tuned by Anyd 20/2/13"
76
+ begin timoschenko_input;
77
+ filename ./data/DTU_10MW_RWT_Shaft_st.dat ;
78
+ set 1 1 ;
79
+ end timoschenko_input;
80
+ begin c2_def; Definition of centerline (main_body coordinates)
81
+ nsec 5;
82
+ sec 1 0.0 0.0 0.0 0.0 ; Tower top x,y,z,twist
83
+ sec 2 0.0 0.0 1.5 0.0 ;
84
+ sec 3 0.0 0.0 3.0 0.0 ;
85
+ sec 4 0.0 0.0 4.4 0.0 ; Main bearing
86
+ sec 5 0.0 0.0 7.1 0.0 ; Rotor centre
87
+ end c2_def ;
88
+ end main_body;
89
+ ;
90
+ begin main_body;
91
+ name hub1 ;
92
+ type timoschenko ;
93
+ nbodies 1 ;
94
+ node_distribution c2_def ;
95
+ damping_posdef 0.0 0.0 0.0 3.00E-06 3.00E-06 2.00E-05; "changed by Larh"
96
+ begin timoschenko_input;
97
+ filename ./data/DTU_10MW_RWT_Hub_st.dat ;
98
+ set 1 2 ;
99
+ end timoschenko_input;
100
+ begin c2_def; Definition of centerline (main_body coordinates)
101
+ nsec 2;
102
+ sec 1 0.0 0.0 0.0 0.0 ; x,y,z,twist
103
+ sec 2 0.0 0.0 2.8 0.0 ;
104
+ end c2_def ;
105
+ end main_body;
106
+ ;
107
+ begin main_body;
108
+ name hub2 ;
109
+ copy_main_body hub1;
110
+ end main_body;
111
+ ;
112
+ begin main_body;
113
+ name hub3 ;
114
+ copy_main_body hub1 ;
115
+ end main_body;
116
+ ;
117
+ begin main_body;
118
+ name blade1 ;
119
+ type timoschenko ;
120
+ nbodies 10 ;
121
+ node_distribution c2_def;
122
+ damping_posdef 0.0 0.0 0.0 1.53e-3 2.55e-3 3.3e-4 ; " 3% damping tuned by tkim 23/03/13 unable to fit 3rd and higher mode"
123
+ begin timoschenko_input ;
124
+ filename ./data/DTU_10MW_RWT_Blade_st.dat;
125
+ set 1 1 ; set subset
126
+ end timoschenko_input;
127
+ begin c2_def; Definition of centerline (main_body coordinates)
128
+ nsec 27 ;
129
+ sec 1 0.00000E+00 7.00600E-05 4.44089E-16 -1.45000E+01 ;
130
+ sec 2 -2.06477E-05 -1.22119E-02 3.00000E+00 -1.45000E+01 ;
131
+ sec 3 -7.28810E-03 -2.49251E-02 6.00000E+00 -1.44851E+01 ;
132
+ sec 4 -1.89235E-02 -2.73351E-02 7.00004E+00 -1.44610E+01 ;
133
+ sec 5 -5.41282E-02 -2.82163E-02 8.70051E+00 -1.43388E+01 ;
134
+ sec 6 -1.26633E-01 -2.13210E-02 1.04020E+01 -1.40201E+01 ;
135
+ sec 7 -2.25666E-01 -1.28378E-02 1.22046E+01 -1.33904E+01 ;
136
+ sec 8 -2.88563E-01 -7.70659E-03 1.32065E+01 -1.29371E+01 ;
137
+ sec 9 -3.99194E-01 -4.88317E-03 1.50100E+01 -1.19445E+01 ;
138
+ sec 10 -5.76634E-01 -1.80296E-02 1.82151E+01 -9.98243E+00 ;
139
+ sec 11 -7.07136E-01 -5.01772E-02 2.14178E+01 -8.45147E+00 ;
140
+ sec 12 -7.91081E-01 -9.41228E-02 2.46189E+01 -7.46417E+00 ;
141
+ sec 13 -8.37195E-01 -1.48880E-01 2.78193E+01 -6.72916E+00 ;
142
+ sec 14 -8.53948E-01 -2.14514E-01 3.10194E+01 -6.08842E+00 ;
143
+ sec 15 -8.49367E-01 -2.90618E-01 3.42197E+01 -5.49322E+00 ;
144
+ sec 16 -7.93920E-01 -4.62574E-01 4.02204E+01 -4.39222E+00 ;
145
+ sec 17 -7.16284E-01 -6.88437E-01 4.66217E+01 -3.09315E+00 ;
146
+ sec 18 -6.34358E-01 -9.60017E-01 5.30232E+01 -1.75629E+00 ;
147
+ sec 19 -5.53179E-01 -1.28424E+00 5.94245E+01 -5.00650E-01 ;
148
+ sec 20 -4.75422E-01 -1.66402E+00 6.58255E+01 6.01964E-01 ;
149
+ sec 21 -4.03180E-01 -2.10743E+00 7.22261E+01 1.55560E+00 ;
150
+ sec 22 -3.30085E-01 -2.65630E+00 7.90266E+01 2.51935E+00 ;
151
+ sec 23 -3.10140E-01 -2.78882E+00 8.05267E+01 2.72950E+00 ;
152
+ sec 24 -2.86719E-01 -2.92517E+00 8.20271E+01 2.93201E+00 ;
153
+ sec 25 -2.55823E-01 -3.06577E+00 8.35274E+01 3.11874E+00 ;
154
+ sec 26 -2.07891E-01 -3.20952E+00 8.50277E+01 3.28847E+00 ;
155
+ sec 27 -8.98940E-02 -3.33685E+00 8.63655E+01 3.42796E+00 ;
156
+ end c2_def ;
157
+ end main_body;
158
+ ;
159
+ begin main_body;
160
+ name blade2 ;
161
+ copy_main_body blade1;
162
+ end main_body;
163
+ ;
164
+ begin main_body;
165
+ name blade3 ;
166
+ copy_main_body blade1 ;
167
+ end main_body;
168
+ ;-------------------------------------------------------------------------------------------------------------------------------
169
+ ;
170
+ begin orientation;
171
+ begin base;
172
+ body tower;
173
+ inipos 0.0 0.0 0.0 ; initial position of node 1
174
+ body_eulerang 0.0 0.0 0.0;
175
+ end base;
176
+ ;
177
+ begin relative;
178
+ body1 tower last;
179
+ body2 towertop 1;
180
+ body2_eulerang 0.0 0.0 0.0;
181
+ end relative;
182
+ ;
183
+ begin relative;
184
+ body1 towertop last;
185
+ body2 shaft 1;
186
+ body2_eulerang 90.0 0.0 0.0;
187
+ body2_eulerang 5.0 0.0 0.0; 5 deg tilt angle
188
+ mbdy2_ini_rotvec_d1 0.0 0.0 -1.0 0.2 ; mbdy2_ini_rotvec_d1 0.0 0.0 -1.0 [init_wr];
189
+ end relative;
190
+ ;
191
+ begin relative;
192
+ body1 shaft last;
193
+ body2 hub1 1;
194
+ body2_eulerang -90.0 0.0 0.0;
195
+ body2_eulerang 0.0 180.0 0.0;
196
+ body2_eulerang 2.5 0.0 0.0; 2.5deg cone angle
197
+ end relative;
198
+ ;
199
+ begin relative;
200
+ body1 shaft last;
201
+ body2 hub2 1;
202
+ body2_eulerang -90.0 0.0 0.0;
203
+ body2_eulerang 0.0 60.0 0.0;
204
+ body2_eulerang 2.5 0.0 0.0; 2.5deg cone angle
205
+ end relative;
206
+ ;
207
+ begin relative;
208
+ body1 shaft last;
209
+ body2 hub3 1;
210
+ body2_eulerang -90.0 0.0 0.0;
211
+ body2_eulerang 0.0 -60.0 0.0;
212
+ body2_eulerang 2.5 0.0 0.0; 2.5deg cone angle
213
+ end relative;
214
+ ;
215
+ begin relative;
216
+ body1 hub1 last;
217
+ body2 blade1 1;
218
+ body2_eulerang 0.0 0.0 0;
219
+ end relative;
220
+ ;
221
+ begin relative;
222
+ body1 hub2 last;
223
+ body2 blade2 1;
224
+ body2_eulerang 0.0 0.0 0.0;
225
+ end relative;
226
+ ;
227
+ begin relative;
228
+ body1 hub3 last;
229
+ body2 blade3 1;
230
+ body2_eulerang 0.0 0.0 0.0;
231
+ end relative;
232
+ ;
233
+ end orientation;
234
+ ;-------------------------------------------------------------------------------------------------------------------------------
235
+ begin constraint;
236
+ ;
237
+ begin fix0; fixed to ground in translation and rotation of node 1
238
+ body tower;
239
+ end fix0;
240
+ ;
241
+ ; begin fix1;
242
+ ; body1 tower last ;
243
+ ; body2 towertop 1;
244
+ ; end fix1;
245
+ ;
246
+ begin bearing2;
247
+ name yaw_rot;
248
+ mbdy1 tower last;
249
+ mbdy2 towertop 1;
250
+ bearing_vector 2 0 0 -1;
251
+ end bearing2;
252
+ begin bearing1; free bearing
253
+ name shaft_rot;
254
+ body1 towertop last;
255
+ body2 shaft 1;
256
+ bearing_vector 2 0.0 0.0 -1.0; x=coo (0=global.1=body1.2=body2) vector in body2 coordinates where the free rotation is present
257
+ end bearing1;
258
+ ;
259
+ begin fix1;
260
+ body1 shaft last ;
261
+ body2 hub1 1;
262
+ end fix1;
263
+ ;
264
+ begin fix1;
265
+ body1 shaft last ;
266
+ body2 hub2 1;
267
+ end fix1;
268
+ ;
269
+ begin fix1;
270
+ body1 shaft last ;
271
+ body2 hub3 1;
272
+ end fix1;
273
+ ;
274
+ begin bearing2;
275
+ name pitch1;
276
+ body1 hub1 last;
277
+ body2 blade1 1;
278
+ bearing_vector 2 0.0 0.0 -1.0;
279
+ end bearing2;
280
+ ;
281
+ begin bearing2;
282
+ name pitch2;
283
+ body1 hub2 last;
284
+ body2 blade2 1;
285
+ bearing_vector 2 0.0 0.0 -1.0;
286
+ end bearing2;
287
+ ;
288
+ begin bearing2;
289
+ name pitch3;
290
+ body1 hub3 last;
291
+ body2 blade3 1;
292
+ bearing_vector 2 0.0 0.0 -1.0;
293
+ end bearing2;
294
+ end constraint;
295
+ ;
296
+ end new_htc_structure;
297
+ ;----------------------------------------------------------------------------------------------------------------------------------------------------------------
298
+ begin wind ;
299
+ density 1.225 ;
300
+ wsp 6.0 ;
301
+ tint 0.1 ;
302
+ horizontal_input 1 ;
303
+ windfield_rotations 0.0 0.0 0.0 ; yaw, tilt, rotation
304
+ center_pos0 0.0 0.0 -119 ; hub heigth
305
+ shear_format 1 0.2 ;
306
+ turb_format 0 ; 0=none, 1=mann,2=flex
307
+ tower_shadow_method 0 ; 0=none, 1=potential flow, 2=jet
308
+ scale_time_start 0.0 ;
309
+ ;wind_ramp_factor 0.0 40.0 0.6 1.0 ;
310
+ ;
311
+ begin mann;
312
+ create_turb_parameters 33.6 .1 3.9 1 0;
313
+ filename_u /turb/turb_u.bin;
314
+ filename_v /turb/turb_v.bin;
315
+ filename_w /turb/turb_w.bin;
316
+ box_dim_u 4096 2;
317
+ box_dim_v 32 3;
318
+ box_dim_w 16 4;
319
+ dont_scale 1;
320
+ end mann;
321
+ ;
322
+ begin tower_shadow_potential_2;
323
+ tower_mbdy_link tower;
324
+ nsec 2;
325
+ radius 0.0 4.15 ;
326
+ radius 115.63 2.75 ;
327
+ end tower_shadow_potential_2;
328
+ end wind;
329
+ ;
330
+ begin aerodrag ;
331
+ begin aerodrag_element ;
332
+ mbdy_name tower;
333
+ aerodrag_sections uniform 10 ;
334
+ nsec 2 ;
335
+ sec 0.0 0.6 8.3 ; tower bottom
336
+ sec 115.63 0.6 5.5 ; tower top
337
+ end aerodrag_element;
338
+ ;
339
+ begin aerodrag_element ; Nacelle drag side
340
+ mbdy_name shaft;
341
+ aerodrag_sections uniform 2 ;
342
+ nsec 2 ;
343
+ sec 0.0 0.8 10.0 ;
344
+ sec 7.01 0.8 10.0 ;
345
+ end aerodrag_element;
346
+ end aerodrag;
347
+ ;
348
+ begin aero ;
349
+ nblades 3;
350
+ hub_vec shaft -3 ; rotor rotation vector (normally shaft composant directed from pressure to sustion side)
351
+ link 1 mbdy_c2_def blade1;
352
+ link 2 mbdy_c2_def blade2;
353
+ link 3 mbdy_c2_def blade3;
354
+ ae_filename ./data/DTU_10MW_RWT_ae.dat ;
355
+ pc_filename ./data/DTU_10MW_RWT_pc.dat ;
356
+ induction_method 1 ; 0=none, 1=normal
357
+ aerocalc_method 1 ; 0=ingen aerodynamic, 1=med aerodynamic
358
+ aerosections 50 ; def. 50
359
+ ae_sets 1 1 1;
360
+ tiploss_method 1 ; 0=none, 1=prandtl
361
+ dynstall_method 2; 0=none, 1=stig øye method,2=mhh method
362
+ ;
363
+ end aero ;
364
+ ;-------------------------------------------------------------------------------------------------
365
+ begin dll;
366
+ ;
367
+ begin type2_dll;
368
+ name dtu_we_controller ;
369
+ filename ./control/dtu_we_controller.dll ;
370
+ dll_subroutine_init init_regulation_advanced ;
371
+ dll_subroutine_update update_regulation ;
372
+ arraysizes_init 100 1 ;
373
+ arraysizes_update 100 100 ;
374
+ begin init ;
375
+ ; Overall parameters
376
+ constant 1 10000.0 ; Rated power [kW]
377
+ constant 2 0.628 ; Minimum rotor (LSS) speed [rad/s]
378
+ constant 3 1.005 ; Rated rotor (LSS) speed [rad/s]
379
+ constant 4 15.6E+06 ; Maximum allowable generator torque [Nm]
380
+ constant 5 100.0 ; Minimum pitch angle, theta_min [deg],
381
+ ; if |theta_min|>90, then a table of <wsp,theta_min> is read ;
382
+ ; from a file named 'wptable.n', where n=int(theta_min)
383
+ constant 6 82.0 ; Maximum pitch angle [deg]
384
+ constant 7 10.0 ; Maximum pitch velocity operation [deg/s]
385
+ constant 8 0.4 ; Frequency of generator speed filter [Hz]
386
+ constant 9 0.7 ; Damping ratio of speed filter [-]
387
+ constant 10 1.80 ; Frequency of free-free DT torsion mode [Hz], if zero no notch filter used
388
+ ; Partial load control parameters
389
+ constant 11 13013100.0 ; Optimal Cp tracking K factor [Nm/(rad/s)^2], ;
390
+ ; Qg=K*Omega^2, K=eta*0.5*rho*A*Cp_opt*R^3/lambda_opt^3
391
+ constant 12 0.683456e8 ; Proportional gain of torque controller [Nm/(rad/s)]
392
+ constant 13 0.153367e8 ; Integral gain of torque controller [Nm/rad]
393
+ constant 14 0.0 ; Differential gain of torque controller [Nm/(rad/s^2)]
394
+ ; Full load control parameters
395
+ constant 15 1 ; Generator control switch [1=constant power, 0=constant torque]
396
+ constant 16 1.06713 ; Proportional gain of pitch controller [rad/(rad/s)]
397
+ constant 17 0.242445 ; Integral gain of pitch controller [rad/rad]
398
+ constant 18 0.0 ; Differential gain of pitch controller [rad/(rad/s^2)]
399
+ constant 19 0.4e-8 ; Proportional power error gain [rad/W]
400
+ constant 20 0.4e-8 ; Integral power error gain [rad/(Ws)]
401
+ constant 21 11.4 ; Coefficient of linear term in aerodynamic gain scheduling, KK1 [deg]
402
+ constant 22 402.9 ; Coefficient of quadratic term in aerodynamic gain scheduling, KK2 [deg^2] &
403
+ ; (if zero, KK1 = pitch angle at double gain)
404
+ constant 23 1.3 ; Relative speed for double nonlinear gain [-]
405
+ ; Cut-in simulation parameters
406
+ constant 24 -1 ; Cut-in time [s], no cut-in is simulated if zero or negative
407
+ constant 25 1.0 ; Time delay for soft start of torque [1/1P]
408
+ ; Cut-out simulation parameters
409
+ constant 26 -1 ; Shut-down time [s], no shut-down is simulated if zero or negative
410
+ constant 27 5.0 ; Time of linear torque cut-out during a generator assisted stop [s]
411
+ constant 28 1 ; Stop type [1=normal, 2=emergency]
412
+ constant 29 1.0 ; Time delay for pitch stop after shut-down signal [s]
413
+ constant 30 3 ; Maximum pitch velocity during initial period of stop [deg/s]
414
+ constant 31 3.0 ; Time period of initial pitch stop phase [s] (maintains pitch speed specified in constant 30)
415
+ constant 32 4 ; Maximum pitch velocity during final phase of stop [deg/s]
416
+ ; Expert parameters (keep default values unless otherwise given)
417
+ constant 33 2.0 ; Time for the maximum torque rate = Maximum allowable generator torque/(constant 33 + 0.01s) [s]
418
+ constant 34 2.0 ; Upper angle above lowest minimum pitch angle for switch [deg], if equal then hard switch
419
+ constant 35 95.0 ; Percentage of the rated speed when the torque limits are fully opened [%]
420
+ constant 36 2.0 ; Time constant of 1st order filter on wind speed used for minimum pitch [1/1P]
421
+ constant 37 1.0 ; Time constant of 1st order filter on pitch angle used for gain scheduling [1/1P]
422
+ ; Drivetrain damper
423
+ constant 38 0.0 ; Proportional gain of active DT damper [Nm/(rad/s)], requires frequency in input 10
424
+ ; Over speed
425
+ constant 39 25.0 ; Overspeed percentage before initiating turbine controller alarm (shut-down) [%]
426
+ ; Additional non-linear pitch control term (not used when all zero)
427
+ constant 40 0.0 ; Rotor speed error scaling factor [rad/s]
428
+ constant 41 0.0 ; Rotor acceleration error scaling factor [rad/s^2]
429
+ constant 42 0.0 ; Pitch rate gain [rad/s]
430
+ ; Storm control command
431
+ constant 43 28.0 ; Wind speed 'Vstorm' above which derating of rotor speed is used [m/s]
432
+ constant 44 28.0 ; Cut-out wind speed (only used for derating of rotor speed in storm) [m/s]
433
+ ; Safety system parameters
434
+ constant 45 30.0 ; Overspeed percentage before initiating safety system alarm (shut-down) [%]
435
+ constant 46 1.5 ; Max low-pass filtered tower top acceleration level [m/s^2]
436
+ ; Turbine parameter
437
+ constant 47 178.0 ; Nominal rotor diameter [m]
438
+ ; Parameters for rotor inertia reduction in variable speed region
439
+ constant 48 0.0 ; Proportional gain on rotor acceleration in variable speed region [Nm/(rad/s^2)] (not used when zero)
440
+ ; Parameters for alternative partial load controller with PI regulated TSR tracking
441
+ constant 49 7.8 ; Optimal tip speed ratio [-] (only used when K=constant 11 = 0 otherwise Qg=K*Omega^2 is used)
442
+ ; Parameters for adding aerodynamic drivetrain damping on gain scheduling
443
+ constant 50 0.0 ; Aerodynamic DT damping coefficient at the operational point of zero pitch angle [Nm/(rad/s)] (not used when zero)
444
+ constant 51 0.0 ; Coefficient of linear term in aerodynamic DT damping scheduling, KK1 [deg]
445
+ constant 52 0.0 ; Coefficient of quadratic term in aerodynamic DT damping scheduling, KK2 [deg^2]
446
+ ; Torque exclusion zone
447
+ constant 53 0.0 ; Exclusion zone: Lower speed limit [rad/s] (Default 0 used if zero)
448
+ constant 54 0.0 ; Exclusion zone: Generator torque at lower limit [Nm] (Default 0 used if zero)
449
+ constant 55 0.0 ; Exclusion zone: Upper speed limit [rad/s] (if =< 0 then exclusion zone functionality is inactive)
450
+ constant 56 0.0 ; Exclusion zone: Generator torque at upper limit [Nm] (Default 0 used if zero)
451
+ constant 57 0.0 ; Time constant of reference switching at exclusion zone [s] (Default 0 used if zero)
452
+ ; DT torsion mode damper
453
+ constant 58 0.0 ; Frequency of notch filter [Hz] (Default 10 x input 10 used if zero)
454
+ constant 59 0.0 ; Damping of BP filter [-] (Default 0.02 used if zero)
455
+ constant 60 0.0 ; Damping of notch filter [-] (Default 0.01 used if zero)
456
+ constant 61 0.0 ; Phase lag of damper [s] => max 40*dt (Default 0 used if zero)
457
+ ; Fore-aft Tower mode damper
458
+ constant 62 0.0 ; Frequency of BP filter [Hz] (Default 10 used if zero)\\
459
+ constant 63 0.0 ; Frequency of notch fiter [Hz] (Default 10 used if zero)\\
460
+ constant 64 0.0 ; Damping of BP filter [-] (Default 0.02 used if zero)\\
461
+ constant 65 0.0 ; Damping of notch filter [-] (Default 0.01 used if zero)\\
462
+ constant 66 0.0 ; Gain of damper [-] (Default 0 used if zero)\\
463
+ constant 67 0.0 ; Phase lag of damper [s] => max 40*dt (Default 0 used if zero)\\
464
+ constant 68 0.0 ; Time constant of 1st order filter on PWR used for fore-aft Tower mode damper GS [Hz] (Default 10 used if zero)
465
+ constant 69 0.0 ; Lower PWR limit used for fore-aft Tower mode damper GS [-] (Default 0 used if zero)
466
+ constant 70 0.0 ; Upper PWR limit used for fore-aft Tower mode damper GS [-] (Default 0 used if zero)
467
+ ; Side-to-side Tower mode filter
468
+ constant 71 0.0 ; Frequency of Tower side-to-sede notch filter [Hz] (Default 100 used if zero)
469
+ constant 72 0.0 ; Damping of notch filter [-] (Default 0.01 used if zero)
470
+ constant 73 0.0 ; Max low-pass filtered tower top acceleration level before initiating safety system alarm (shut-down) [m/s^2] (Default 1.1 x input 46 used if zero)
471
+ constant 74 0.0 ; Time constant of 1st order filter on tower top acceleration [1/1P] (Default 1 used if zero)
472
+ ; Pitch deviation monitor parameters
473
+ constant 75 1005020 ; Parameters for pitch deviation monitoring. The format is 1,nnn,mmm
474
+ ; where 'nnn' [s] is the period of the moving average and 'mmm' is threshold of the deviation [0.1 deg] (functionality is inactive if value $<$ 1,000,000)
475
+ ; Gear ratio
476
+ constant 76 0.0 ; Gear ratio used for the calculation of the LSS rotational speeds and the HSS generator torque reference [-] (Default 1 if zero)
477
+ end init ;
478
+ ;
479
+ begin output ;
480
+ general time ; [s]
481
+ constraint bearing1 shaft_rot 1 only 2 ; Drivetrain speed [rad/s]
482
+ constraint bearing2 pitch1 1 only 1; [rad]
483
+ constraint bearing2 pitch2 1 only 1; [rad]
484
+ constraint bearing2 pitch3 1 only 1; [rad]
485
+ wind free_wind 1 0.0 0.0 -119 ; Global coordinates at hub height
486
+ dll inpvec 2 2 ; Elec. power from generator servo .dll
487
+ dll inpvec 2 8 ; Grid state flag from generator servo .dll
488
+ mbdy state acc towertop 1 1.0 global only 1 ; Tower top x-acceleration [m/s^2]
489
+ mbdy state acc towertop 1 1.0 global only 2 ; Tower top y-acceleration [m/s^2]
490
+ end output;
491
+ end type2_dll;
492
+ ;
493
+ begin type2_dll;
494
+ name generator_servo ;
495
+ filename ./control/generator_servo.dll ;
496
+ dll_subroutine_init init_generator_servo ;
497
+ dll_subroutine_update update_generator_servo ;
498
+ arraysizes_init 100 1 ;
499
+ arraysizes_update 100 100 ;
500
+ begin init ;
501
+ constant 1 20.0 ; Frequency of 2nd order servo model of generator-converter system [Hz]
502
+ constant 2 0.9 ; Damping ratio 2nd order servo model of generator-converter system [-]
503
+ constant 3 15.6E+06 ; Maximum allowable LSS torque (pull-out torque) [Nm]
504
+ constant 4 0.94 ; Generator efficiency [-]
505
+ constant 5 1.0 ; Gearratio [-]
506
+ constant 6 0.0 ; Time for half value in softstart of torque [s]
507
+ constant 7 -1 ; Time for grid loss [s] (never if lower than zero)
508
+ end init ;
509
+ ;
510
+ begin output;
511
+ general time ; Time [s]
512
+ dll inpvec 1 1 ; Electrical torque reference [Nm]
513
+ constraint bearing1 shaft_rot 1 only 2; Generator LSS speed [rad/s]
514
+ mbdy momentvec shaft 1 1 shaft only 3 ; Shaft moment [kNm] (Qshaft)
515
+ end output;
516
+ ;
517
+ begin actions;
518
+ mbdy moment_int shaft 1 -3 shaft towertop 2 ; Generator LSS torque [Nm]
519
+ end actions;
520
+ end type2_dll;
521
+ ;
522
+ begin type2_dll;
523
+ name mech_brake ;
524
+ filename ./control/mech_brake.dll ;
525
+ dll_subroutine_init init_mech_brake ;
526
+ dll_subroutine_update update_mech_brake ;
527
+ arraysizes_init 100 1 ;
528
+ arraysizes_update 100 100 ;
529
+ begin init ;
530
+ constant 1 9.36E+06 ; Fully deployed maximum brake torque [Nm] (0.6*max torque)
531
+ constant 2 100.0 ; Parameter alpha used in Q = tanh(omega*alpha), typically 1e2/Omega_nom
532
+ constant 3 0.5 ; Delay time for before brake starts to deploy [s]
533
+ constant 4 0.6 ; Time for brake to become fully deployed [s]
534
+ end init ;
535
+ ;
536
+ begin output;
537
+ general time ; Time [s]
538
+ constraint bearing1 shaft_rot 1 only 2 ; Generator LSS speed [rad/s]
539
+ dll inpvec 1 25 ; Command to deploy mechanical disc brake [0,1]
540
+ end output;
541
+ ;
542
+ begin actions;
543
+ mbdy moment_int shaft 1 -3 shaft towertop 2 ; Brake LSS torque [Nm]
544
+ end actions;
545
+ end type2_dll;
546
+ ;
547
+ begin type2_dll;
548
+ name servo_with_limits ;
549
+ filename ./control/servo_with_limits.dll ;
550
+ dll_subroutine_init init_servo_with_limits ;
551
+ dll_subroutine_update update_servo_with_limits ;
552
+ arraysizes_init 100 1 ;
553
+ arraysizes_update 100 100 ;
554
+ begin init ;
555
+ constant 1 3 ; Number of blades [-]
556
+ constant 2 1.0 ; Frequency of 2nd order servo model of pitch system [Hz]
557
+ constant 3 0.7 ; Damping ratio 2nd order servo model of pitch system [-]
558
+ constant 4 10.0 ; Max. pitch speed [deg/s]
559
+ constant 5 15.0 ; Max. pitch acceleration [deg/s^2]
560
+ constant 6 -5.0 ; Min. pitch angle [deg]
561
+ constant 7 90.0 ; Max. pitch angle [deg]
562
+ constant 8 -1 ; Time for pitch runaway [s]
563
+ constant 9 -1 ; Time for stuck blade 1 [s]
564
+ constant 10 0.0 ; Angle of stuck blade 1 [deg] (if > 90 deg then blade is stuck at instantaneous angle)
565
+ end init ;
566
+ begin output;
567
+ general time ; Time [s]
568
+ dll inpvec 1 2 ; Pitch1 demand angle [rad]
569
+ dll inpvec 1 3 ; Pitch2 demand angle [rad]
570
+ dll inpvec 1 4 ; Pitch3 demand angle [rad]
571
+ dll inpvec 1 26 ; Flag for emergency pitch stop [0=off/1=on]
572
+ end output;
573
+ ;
574
+ begin actions;
575
+ constraint bearing2 angle pitch1 ; Angle pitch1 bearing [rad]
576
+ constraint bearing2 angle pitch2 ; Angle pitch2 bearing [rad]
577
+ constraint bearing2 angle pitch3 ; Angle pitch3 bearing [rad]
578
+ end actions;
579
+ end type2_dll;
580
+ ;
581
+ begin type2_dll;
582
+ name yaw_servo;
583
+ deltat 0.01;
584
+ filename ./control/servo_with_limits2.dll;
585
+ dll_subroutine_init init_servo_with_limits;
586
+ dll_subroutine_update update_servo_with_limits;
587
+ arraysizes_init 100 1;
588
+ arraysizes_update 100 100;
589
+ begin init;
590
+ constant 1 1; Number of bearings [-]
591
+ constant 2 0.5; Frequency of 2nd order servo model of yaw system [Hz]
592
+ constant 3 0.7; Damping ratio 2nd order servo model of yaw system [-]
593
+ constant 4 1; Max. yaw speed [deg/s]
594
+ constant 5 1; Max. yaw acceleration [deg/s^2]
595
+ constant 6 -100000000000000000000; Min. yaw angle [deg]
596
+ constant 7 100000000000000000000; Max. yaw angle [deg]
597
+ constant 8 100000000000000000000; Time for yaw runaway [s]
598
+ constant 9 -1; Time for stuck yaw [s]
599
+ constant 10 0; Angle of stuck yaw [deg]
600
+ end init;
601
+ begin output;
602
+ general time; Time [s]
603
+ general variable 1 0 yaw_setpoint rad; Demanded nacelle yaw angle [rad]
604
+ end output;
605
+ begin actions;
606
+ constraint bearing2 angle yaw_rot; Yaw bearing angle [rad];
607
+ end actions;
608
+ end type2_dll;
609
+ ;
610
+ ; --- DLL for tower-blade tip distance -- ;
611
+ ;-------------------------------------------
612
+ begin type2_dll;
613
+ name towerclearance_mblade ;
614
+ filename ./control/towerclearance_mblade.dll ;
615
+ dll_subroutine_init initialize ;
616
+ dll_subroutine_update update ;
617
+ arraysizes_init 3 1 ;
618
+ arraysizes_update 15 6 ;
619
+ begin init ; Variables passed into initialization function
620
+ constant 1 4.15 ; Tower radius at tower bottom [m]
621
+ constant 2 2.75 ; Tower radius at tower top [m]
622
+ constant 3 3 ; Number of points to check [-]
623
+ end init ;
624
+ begin output; Variables passed into update function
625
+ mbdy state pos tower 1 0.0 global ; [1,2,3] global coordinates of tower base
626
+ mbdy state pos tower 10 1.0 global ; [4,5,6] global coordinates of tower top
627
+ mbdy state pos blade1 26 1.0 global ; [7,8,9] global coordinates of point 1 (blade 1 tip)
628
+ mbdy state pos blade2 26 1.0 global ; [10,11,12] global coordinates of point 2 (blade 2 tip)
629
+ mbdy state pos blade3 26 1.0 global ; [13,14,15] global coordinates of point 3 (blade 3 tip)
630
+ end output;
631
+ end type2_dll;
632
+ ;
633
+ end dll;
634
+ ;----------------------------------------------------------------------------------------------------------------------------------------------------------------
635
+ ;
636
+ begin output;
637
+ filename ./res/DTU_10MW_RWT_ver09 ;
638
+ data_format gtsdf;
639
+ buffer 250 ;
640
+ ;
641
+ general time;
642
+ constraint bearing1 shaft_rot 2; angle and angle velocity
643
+ constraint bearing2 pitch1 5; angle and angle velocity
644
+ constraint bearing2 pitch2 5; angle and angle velocity
645
+ constraint bearing2 pitch3 5; angle and angle velocity
646
+ aero omega ;
647
+ aero torque;
648
+ aero power;
649
+ aero thrust;
650
+ wind free_wind 1 0.0 0.0 -119; local wind at fixed position: coo (1=global,2=non-rotation rotor coo.), pos x, pos y, pos z
651
+ mbdy state pos shaft 4 1 global # rotor position;
652
+ ; Moments:
653
+ mbdy momentvec tower 1 1 tower # tower base ;
654
+ mbdy momentvec tower 10 2 tower # tower yaw bearing ;
655
+ mbdy momentvec shaft 4 1 shaft # main bearing ;
656
+ mbdy momentvec blade1 2 2 blade1 # blade 1 root ;
657
+ mbdy momentvec blade2 2 2 blade2 # blade 2 root ;
658
+ mbdy momentvec blade3 2 2 blade3 # blade 3 root ;
659
+ mbdy momentvec blade1 13 1 local # blade 1 50% local e coo ;
660
+ mbdy momentvec blade2 13 1 local # blade 2 50% local e coo ;
661
+ mbdy momentvec blade3 13 1 local # blade 3 50% local e coo ;
662
+ ; Displacements and accellerations
663
+ mbdy state pos tower 10 1.0 global only 1 # Tower top FA displ;
664
+ mbdy state pos tower 10 1.0 global only 2 # Tower top SS displ;
665
+ mbdy state acc tower 10 1.0 global only 1 # Tower top FA acc;
666
+ mbdy state acc tower 10 1.0 global only 2 # Tower top SS acc;
667
+ ;
668
+ mbdy state pos blade1 26 1.0 blade1 # blade 1 tip pos ;
669
+ mbdy state pos blade2 26 1.0 blade2 # blade 2 tip pos ;
670
+ mbdy state pos blade3 26 1.0 blade3 # blade 3 tip pos ;
671
+ mbdy state pos blade1 26 1.0 global # gl blade 1 tip pos ;
672
+ ; - Monitor Aerodynamics - ;
673
+ aero windspeed 3 1 1 72.5;
674
+ aero alfa 1 72.5;
675
+ aero alfa 2 72.5;
676
+ aero alfa 3 72.5;
677
+ aero cl 1 72.5;
678
+ aero cl 2 72.5;
679
+ aero cl 3 72.5;
680
+ aero cd 1 72.5;
681
+ aero cd 2 72.5;
682
+ aero cd 3 72.5;
683
+ ; DLL outputs and into HAWC2
684
+ dll inpvec 1 1 # Generator torque reference [Nm] ;
685
+ dll inpvec 1 2 # Pitch angle reference of blade 1 [rad] ;
686
+ dll inpvec 1 3 # Pitch angle reference of blade 2 [rad] ;
687
+ dll inpvec 1 4 # Pitch angle reference of blade 3 [rad] ;
688
+ dll inpvec 1 5 # Power reference [W] ;
689
+ dll inpvec 1 6 # Filtered wind speed [m/s] ;
690
+ dll inpvec 1 7 # Filtered rotor speed [rad/s];
691
+ dll inpvec 1 8 # Filtered rotor speed error for torque [rad/s];
692
+ dll inpvec 1 9 # Bandpass filtered rotor speed [rad/s];
693
+ dll inpvec 1 10 # Proportional term of torque contr. [Nm] ;
694
+ dll inpvec 1 11 # Integral term of torque controller [Nm] ;
695
+ dll inpvec 1 12 # Minimum limit of torque [Nm] ;
696
+ dll inpvec 1 13 # Maximum limit of torque [Nm] ;
697
+ dll inpvec 1 14 # Torque limit switch based on pitch [-] ;
698
+ dll inpvec 1 15 # Filtered rotor speed error for pitch [rad/s];
699
+ dll inpvec 1 16 # Power error for pitch [W] ;
700
+ dll inpvec 1 17 # Proportional term of pitch controller [rad] ;
701
+ dll inpvec 1 18 # Integral term of pitch controller [rad] ;
702
+ dll inpvec 1 19 # Minimum limit of pitch [rad] ;
703
+ dll inpvec 1 20 # Maximum limit of pitch [rad] ;
704
+ dll inpvec 1 21 # Torque reference from DT dammper [Nm] ;
705
+ dll inpvec 1 22 # Status signal [-] ;
706
+ dll inpvec 1 23 # Total added pitch rate [rad/s] ;
707
+ dll inpvec 1 24 # Filtered Mean pitch for gain sch [rad] ;
708
+ dll inpvec 1 25 # Flag for mechnical brake [0=off/1=on] ;
709
+ dll inpvec 1 26 # Flag for emergency pitch stop [0=off/1=on] ;
710
+ dll inpvec 1 27 # LP filtered acceleration level [m/s^2] ;
711
+ dll inpvec 1 31 # Monitored average of reference pitch [rad] ;
712
+ dll inpvec 1 32 # Monitored ave. of actual pitch (blade 1) [rad] ;
713
+ ; Input from generator model
714
+ dll inpvec 2 1 # Mgen LSS [Nm] ;
715
+ dll inpvec 2 2 # Pelec [W] ;
716
+ dll inpvec 2 3 # Mframe [Nm] ;
717
+ dll inpvec 2 4 # Mgen HSS [Nm] ;
718
+ dll inpvec 2 8 # Grid flag [0=run/1=stop];
719
+ ; Input from mechanical brake
720
+ dll inpvec 3 1 # Brake torque [Nm] ;
721
+ ; Input from pitch servo
722
+ dll inpvec 4 1 # pitch 1 [rad];
723
+ dll inpvec 4 2 # pitch 2 [rad];
724
+ dll inpvec 4 3 # pitch 3 [rad];
725
+ ; yaw set point
726
+ general variable 1 0 yaw_setpoint rad;
727
+ dll inpvec 5 1 # yaw angle [rad];
728
+ ; Check tower clearence
729
+ dll inpvec 6 1 # Bltip tow min d [m];
730
+ end output;
731
+ ;
732
+ exit;
@@ -3,6 +3,7 @@ begin simulation;
3
3
  solvertype 1 ; (newmark)
4
4
  on_no_convergence continue ;
5
5
  convergence_limits 1E3 1.0 1E-7 ;
6
+ logfile log.log;
6
7
  log_deltat 1;
7
8
  begin newmark;
8
9
  deltat 0.1;
@@ -0,0 +1,20 @@
1
+ import pytest
2
+
3
+ from h2lib._h2lib import H2Lib
4
+ from h2lib_tests.test_files import tfp
5
+
6
+ from .test_write_htc import write_dtu10mw_only_tower
7
+
8
+
9
+ def test_init_static_solver(write_dtu10mw_only_tower):
10
+ with H2Lib() as h2:
11
+ # Load a basic model.
12
+ model_path = tfp + "DTU_10_MW/"
13
+ h2.init("htc/DTU_10MW_RWT_only_tower.htc", model_path)
14
+
15
+ # First execution is fine.
16
+ h2.init_static_solver()
17
+
18
+ # The next should give an error.
19
+ with pytest.raises(RuntimeError, match="STATIC_SOLVER_ALREADY_INITIALIZED"):
20
+ h2.init_static_solver()
@@ -0,0 +1,143 @@
1
+ from h2lib._h2lib import H2Lib
2
+
3
+ from numpy import testing as npt
4
+ from h2lib_tests.test_files import tfp
5
+ import numpy as np
6
+ import pytest
7
+ from .test_write_htc import (
8
+ write_dtu10mw_only_tower,
9
+ write_dtu10mw_only_tower_rotated,
10
+ write_dtu10mw_only_tower_encrypted
11
+ )
12
+
13
+
14
+ @pytest.fixture(scope="module")
15
+ def h2_dtu_10mw_only_tower(write_dtu10mw_only_tower):
16
+ h2 = H2Lib(suppress_output=True)
17
+ model_path = f"{tfp}DTU_10_MW/"
18
+ htc_path = "htc/DTU_10MW_RWT_only_tower.htc"
19
+ h2.init(htc_path=htc_path, model_path=model_path)
20
+ yield h2
21
+ h2.close()
22
+
23
+
24
+ @pytest.fixture(scope="module")
25
+ def h2_dtu_10mw_only_tower_rotated(write_dtu10mw_only_tower_rotated):
26
+ h2 = H2Lib(suppress_output=True)
27
+ model_path = f"{tfp}DTU_10_MW/"
28
+ htc_path = "htc/DTU_10MW_RWT_only_tower_rotated.htc"
29
+ h2.init(htc_path=htc_path, model_path=model_path)
30
+ yield h2
31
+ h2.close()
32
+
33
+
34
+ @pytest.fixture(scope="module")
35
+ def h2_dtu_10mw_only_tower_encrypted(write_dtu10mw_only_tower_encrypted):
36
+ h2 = H2Lib(suppress_output=True)
37
+ model_path = f"{tfp}DTU_10_MW/"
38
+ htc_path = "htc/DTU_10MW_RWT_only_tower_encrypted.htc"
39
+ h2.init(htc_path=htc_path, model_path=model_path)
40
+ yield h2
41
+ h2.close()
42
+
43
+
44
+ def test_number_of_bodies_and_constraints(
45
+ h2_dtu_10mw_only_tower,
46
+ ):
47
+ nbdy, ncst = h2_dtu_10mw_only_tower.get_number_of_bodies_and_constraints()
48
+ assert nbdy == 3
49
+ assert ncst == 9
50
+
51
+
52
+ def test_number_of_bodies_and_constraints_encrypted(
53
+ h2_dtu_10mw_only_tower_encrypted,
54
+ ):
55
+ with pytest.raises(RuntimeError, match="STRUCTURE_IS_CONFIDENTIAL"):
56
+ h2_dtu_10mw_only_tower_encrypted.get_number_of_bodies_and_constraints()
57
+
58
+
59
+ def test_get_number_of_elements(h2_dtu_10mw_only_tower):
60
+ nelem = h2_dtu_10mw_only_tower.get_number_of_elements()
61
+ npt.assert_array_equal(nelem, np.array([3, 3, 4]))
62
+
63
+
64
+ def test_get_number_of_elements_encrypted(
65
+ h2_dtu_10mw_only_tower_encrypted,
66
+ ):
67
+ # This test is not really needed, since the check for confidential structure
68
+ # is already done by test_number_of_bodies_and_constraints_encrypted().
69
+ with pytest.raises(RuntimeError, match="STRUCTURE_IS_CONFIDENTIAL"):
70
+ h2_dtu_10mw_only_tower_encrypted.get_number_of_elements()
71
+
72
+
73
+ def test_get_timoshenko_location(
74
+ h2_dtu_10mw_only_tower,
75
+ ):
76
+ # Test first element.
77
+ l, r1, r12, tes = h2_dtu_10mw_only_tower.get_timoshenko_location(ibdy=0, ielem=0)
78
+ assert l - 11.5 < 1e-14
79
+ npt.assert_array_equal(r1, np.array([0.0, 0.0, 0]))
80
+ npt.assert_array_almost_equal_nulp(r12, np.array([0.0, 0.0, -11.5]))
81
+ npt.assert_array_equal(
82
+ tes,
83
+ np.array([[-1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, -1.0]]),
84
+ )
85
+
86
+ # Test last element.
87
+ l, r1, r12, tes = h2_dtu_10mw_only_tower.get_timoshenko_location(ibdy=2, ielem=3)
88
+ assert l - 12.13 < 1e-14
89
+ npt.assert_array_almost_equal_nulp(r1, np.array([0.0, 0.0, -34.5]))
90
+ npt.assert_array_almost_equal_nulp(r12, np.array([0.0, 0.0, -12.13]), nulp=3)
91
+ npt.assert_array_equal(
92
+ tes,
93
+ np.array([[-1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, -1.0]]),
94
+ )
95
+
96
+
97
+ def test_get_timoshenko_location_body_does_not_exist(
98
+ h2_dtu_10mw_only_tower,
99
+ ):
100
+ with pytest.raises(IndexError, match="BODY_DOES_NOT_EXIST"):
101
+ h2_dtu_10mw_only_tower.get_timoshenko_location(ibdy=1000, ielem=0)
102
+
103
+
104
+ def test_get_timoshenko_location_element_does_not_exist(
105
+ h2_dtu_10mw_only_tower,
106
+ ):
107
+ with pytest.raises(IndexError, match="ELEMENT_DOES_NOT_EXIST"):
108
+ h2_dtu_10mw_only_tower.get_timoshenko_location(ibdy=0, ielem=1000)
109
+
110
+
111
+ def test_get_timoshenko_location_encrypted(
112
+ h2_dtu_10mw_only_tower_encrypted,
113
+ ):
114
+ with pytest.raises(RuntimeError, match="STRUCTURE_IS_CONFIDENTIAL"):
115
+ h2_dtu_10mw_only_tower_encrypted.get_timoshenko_location(ibdy=0, ielem=0)
116
+
117
+
118
+ def test_get_body_rotation_tensor_1(h2_dtu_10mw_only_tower):
119
+ amat = h2_dtu_10mw_only_tower.get_body_rotation_tensor(ibdy=0)
120
+ npt.assert_array_equal(amat, np.eye(3))
121
+
122
+
123
+ def test_get_body_rotation_tensor_2(
124
+ h2_dtu_10mw_only_tower_rotated, write_dtu10mw_only_tower_rotated
125
+ ):
126
+ amat = h2_dtu_10mw_only_tower_rotated.get_body_rotation_tensor(ibdy=0)
127
+ _, alpha = write_dtu10mw_only_tower_rotated
128
+ alpha_rad = np.deg2rad(alpha)
129
+ sa = np.sin(alpha_rad)
130
+ ca = np.cos(alpha_rad)
131
+ npt.assert_array_almost_equal_nulp(
132
+ amat, np.array([[1.0, 0.0, 0.0], [0.0, ca, -sa], [0.0, sa, ca]])
133
+ )
134
+
135
+
136
+ def test_get_body_rotation_tensor_body_does_not_exist(h2_dtu_10mw_only_tower):
137
+ with pytest.raises(IndexError, match="BODY_DOES_NOT_EXIST"):
138
+ h2_dtu_10mw_only_tower.get_body_rotation_tensor(ibdy=1000)
139
+
140
+
141
+ def test_get_body_rotation_tensor_encrypted(h2_dtu_10mw_only_tower_encrypted):
142
+ with pytest.raises(RuntimeError, match="STRUCTURE_IS_CONFIDENTIAL"):
143
+ h2_dtu_10mw_only_tower_encrypted.get_body_rotation_tensor(ibdy=0)
@@ -0,0 +1,59 @@
1
+ import pytest
2
+ from wetb.hawc2.htc_file import HTCFile
3
+ from h2lib_tests.test_files import tfp
4
+
5
+
6
+ @pytest.fixture(scope="module")
7
+ def write_dtu10mw_only_tower():
8
+ # Start from DTU_10MW_RWT and delete everything except the tower.
9
+ htc = HTCFile(tfp + "DTU_10_MW/htc/DTU_10MW_RWT.htc")
10
+ htc.set_name("DTU_10MW_RWT_only_tower")
11
+ for key1 in htc["new_htc_structure"].keys():
12
+ if key1.startswith("main_body"):
13
+ if "tower" not in htc["new_htc_structure"][key1]["name"].values:
14
+ htc["new_htc_structure"][key1].delete()
15
+ if key1 == "orientation":
16
+ for key2 in htc["new_htc_structure"]["orientation"].keys():
17
+ if key2.startswith("relative"):
18
+ htc["new_htc_structure"]["orientation"][key2].delete()
19
+ if key1 == "constraint":
20
+ for key2 in htc["new_htc_structure"]["constraint"].keys():
21
+ if key2 != "fix0":
22
+ htc["new_htc_structure"]["constraint"][key2].delete()
23
+ htc["wind"].delete()
24
+ htc["aerodrag"].delete()
25
+ htc["aero"].delete()
26
+ htc["dll"].delete()
27
+ htc["output"].delete()
28
+ # Reduce simulation time.
29
+ htc.simulation.time_stop = 10.0
30
+ # Change number of bodies in the tower.
31
+ htc.new_htc_structure.main_body.nbodies = 3
32
+ # Save the new file.
33
+ htc.save()
34
+ return htc
35
+
36
+
37
+ @pytest.fixture(scope="module")
38
+ def write_dtu10mw_only_tower_rotated(write_dtu10mw_only_tower):
39
+ # Start from the DTU_10MW_RWT_only_tower and rotate the tower.
40
+ htc = write_dtu10mw_only_tower.copy()
41
+ htc.set_name("DTU_10MW_RWT_only_tower_rotated")
42
+ alpha = 30.0
43
+ htc.new_htc_structure.orientation.base.body_eulerang = [
44
+ alpha,
45
+ 0.0,
46
+ 0.0,
47
+ ]
48
+ htc.save()
49
+ return (htc, alpha)
50
+
51
+
52
+ @pytest.fixture(scope="module")
53
+ def write_dtu10mw_only_tower_encrypted(write_dtu10mw_only_tower):
54
+ # Start from the DTU_10MW_RWT_only_tower and then encrypt the tower.
55
+ htc = write_dtu10mw_only_tower.copy()
56
+ htc.set_name("DTU_10MW_RWT_only_tower_encrypted")
57
+ # Only the tower is left.
58
+ htc.new_htc_structure.main_body.timoschenko_input.filename = "./data/DTU_10MW_RWT_Tower_st.dat.v3.enc"
59
+ htc.save()
@@ -1,7 +1,7 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: h2lib-tests
3
- Version: 13.1.304
4
- Summary: Tests and test_files for test h2lib (13.1.3)
3
+ Version: 13.1.502
4
+ Summary: Tests and test_files for test h2lib (13.1.5+4-g20eca1a)
5
5
  Download-URL:
6
6
  Author: Mads M Pedersen
7
7
  Author-email:
@@ -6,6 +6,9 @@ h2lib_tests/test_h2lib.py,sha256=ZKp8pfQQpCUQ7IBXypTmvewbJwTQowSiCEt6t4R9TgY,133
6
6
  h2lib_tests/test_h2rotor.py,sha256=kaE9AFDYSPaMFSgBAbeegd7-l6Z_4_BsQaWie0k32q4,6210
7
7
  h2lib_tests/test_mpi.py,sha256=emBgXRAvvFFOsVrAziiQCUZvEF9HS5Wc-x4KqqltQP0,6835
8
8
  h2lib_tests/test_multiprocessinterface.py,sha256=h2o4havtK6IuMXsplNjGUa3VxOnbpEYGxdrrAKQilj0,1470
9
+ h2lib_tests/test_static_solver_wrapper.py,sha256=xCWDkxtW8K2kD6l6MRgyPS1kz91IpbRA0Cc3BG7o3Es,604
10
+ h2lib_tests/test_topology_h2lib.py,sha256=cClNtAIc1wR_gZa7eDO4ZySvhScqCEIHVMKZEhk29QE,4980
11
+ h2lib_tests/test_write_htc.py,sha256=t78STsVoQ2qR5WB-jkYhaMOy0jWHHsDfuO2nfyPj4ag,2242
9
12
  h2lib_tests/test_files/__init__.py,sha256=9e6ZUPb42e0wf2E1rutdcTM8hROcWFRVPXtZriU3ySw,50
10
13
  h2lib_tests/test_files/my_test_cls.py,sha256=7ZDsFkxrLfOY6q00U5Y-daxfuhATK-K5H04RP-VmQdE,850
11
14
  h2lib_tests/test_files/DTU_10_MW/control/dtu_we_controller.dll,sha256=C5T_CuAFtIuDgCXSYAoNu24yKPwj2nWOeORacJbLN9s,1134592
@@ -19,6 +22,9 @@ h2lib_tests/test_files/DTU_10_MW/control/mech_brake.so,sha256=YG-cTEp83x2J2jpRMg
19
22
  h2lib_tests/test_files/DTU_10_MW/control/mech_brake_64.dll,sha256=kG5SEM0A6M1eCSjSZb2LBIbI-Gi4gWfqLGZZ2PxUfjY,893952
20
23
  h2lib_tests/test_files/DTU_10_MW/control/servo_with_limits.dll,sha256=RsYVurATKF1-1mVKiMDoORSUGEU3Th8qBAl-a0BNrZg,839680
21
24
  h2lib_tests/test_files/DTU_10_MW/control/servo_with_limits.so,sha256=6nERT3HsDZPrxfisn8T6dOFGf0U4PF4t8pJlrOPg8Hk,174824
25
+ h2lib_tests/test_files/DTU_10_MW/control/servo_with_limits2.dll,sha256=RsYVurATKF1-1mVKiMDoORSUGEU3Th8qBAl-a0BNrZg,839680
26
+ h2lib_tests/test_files/DTU_10_MW/control/servo_with_limits2.so,sha256=6nERT3HsDZPrxfisn8T6dOFGf0U4PF4t8pJlrOPg8Hk,174824
27
+ h2lib_tests/test_files/DTU_10_MW/control/servo_with_limits2_64.dll,sha256=tz0G4nfYQjXdskVU0Cv2nMN2eNPtZlBglgBZr2xrRcU,1055232
22
28
  h2lib_tests/test_files/DTU_10_MW/control/servo_with_limits_64.dll,sha256=tz0G4nfYQjXdskVU0Cv2nMN2eNPtZlBglgBZr2xrRcU,1055232
23
29
  h2lib_tests/test_files/DTU_10_MW/control/towerclearance_mblade.dll,sha256=T7LoFiQ9AYIaO-P9OMmM5NC1XmHEWj1lThDLlJHO1ys,141312
24
30
  h2lib_tests/test_files/DTU_10_MW/control/towerclearance_mblade.so,sha256=bfgcVPyw7YegMW2g5nOGpseNjspaZHk8qEKNeJ-tPL8,138032
@@ -28,6 +34,7 @@ h2lib_tests/test_files/DTU_10_MW/data/DTU_10MW_RWT_Blade_st.dat,sha256=7stkwSf7R
28
34
  h2lib_tests/test_files/DTU_10_MW/data/DTU_10MW_RWT_Hub_st.dat,sha256=UPIVkaThyxRsEeMIyjhXIr_n9kr1SAGQYudgj_ofJ04,916
29
35
  h2lib_tests/test_files/DTU_10_MW/data/DTU_10MW_RWT_Shaft_st.dat,sha256=Jz_QA1hJUY6ZG4re1oFj0_7MkXu8az9jn2-WLGb0jY0,905
30
36
  h2lib_tests/test_files/DTU_10_MW/data/DTU_10MW_RWT_Tower_st.dat,sha256=0asFvlyhL1CZltWve-PNGgjfpfdMGRCCwMf3U0K_x_c,8367
37
+ h2lib_tests/test_files/DTU_10_MW/data/DTU_10MW_RWT_Tower_st.dat.v3.enc,sha256=2MIV4QV0Y5XZ6hHsUdO95pG4b1HVlNWeuIzSM6n-88A,8422
31
38
  h2lib_tests/test_files/DTU_10_MW/data/DTU_10MW_RWT_Towertop_st.dat,sha256=iW8RzjgQe7D3y9DEQMD74e0PWqJ4d7meYGTT6Fsl4D0,955
32
39
  h2lib_tests/test_files/DTU_10_MW/data/DTU_10MW_RWT_ae.dat,sha256=LkAlElRW_Fl1V4GD8hQZIgLD4IW0o3uxXL2olnEU3dI,1531
33
40
  h2lib_tests/test_files/DTU_10_MW/data/DTU_10MW_RWT_pc.dat,sha256=2Nc_ofcqfCB3iu8dSFRj8Ub6AhaQADdW0O8BXBWj5Uk,26888
@@ -35,6 +42,7 @@ h2lib_tests/test_files/DTU_10_MW/data/operation.dat,sha256=QH3ULApoKiZJfT4Z65aGN
35
42
  h2lib_tests/test_files/DTU_10_MW/htc/DTU_10MW_RWT.htc,sha256=80y88seN4BL_gAiM-RYaTlZxKCYJMr27IBdCX38O6DE,32313
36
43
  h2lib_tests/test_files/DTU_10_MW/htc/DTU_10MW_RWT_mann_turb.htc,sha256=-jFK-ra64GeY3fQrP8FxeZ25DkQMdS8yQ9sO78SS9G8,32006
37
44
  h2lib_tests/test_files/DTU_10_MW/htc/DTU_10MW_RWT_no_output.htc,sha256=PxkaacH8iVp0ewk6x8fIjkITPUkiVar5bxZCWqZSoP4,25887
45
+ h2lib_tests/test_files/DTU_10_MW/htc/DTU_10MW_RWT_yaw_acturator.htc,sha256=FET165Hd3w6r0hwOeMU1WKARiBToIWL_tXPjYsjIatQ,33776
38
46
  h2lib_tests/test_files/IEA-15-240-RWT/IEA_15MW_RWT_Blade_st_FPM.st,sha256=ytwFSx1cFSF25vZ8WZpYFiV2aL3DTvetPrR7oEqFYpc,16605
39
47
  h2lib_tests/test_files/IEA-15-240-RWT/IEA_15MW_RWT_Blade_st_noFPM.st,sha256=Pdb8rfJoV7zOAmbPn_xUyGgQk-xIjQ5fCZPRzsu9Q-M,20945
40
48
  h2lib_tests/test_files/IEA-15-240-RWT/IEA_15MW_RWT_Dummy_st.dat,sha256=fJGn9bFdMwCV1ceoxT2SUbuDMuNJGCaeqHWUqFlyfKE,532
@@ -74,12 +82,12 @@ h2lib_tests/test_files/minimal/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5
74
82
  h2lib_tests/test_files/minimal/htc/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
75
83
  h2lib_tests/test_files/minimal/htc/minimal.htc,sha256=qdtxlFNczVxmH3h7RDefUHUSuDESeWgj1uSf_rQjjT4,985
76
84
  h2lib_tests/test_files/minimal/htc/minimal_mann_turb.htc,sha256=hT5e9AQ7orN1dBwdNlJIwHaj9wuj_DRALTOb4EfhQw4,1432
77
- h2lib_tests/test_files/minimal/htc/minimal_nooutput.htc,sha256=qdtxlFNczVxmH3h7RDefUHUSuDESeWgj1uSf_rQjjT4,985
85
+ h2lib_tests/test_files/minimal/htc/minimal_nooutput.htc,sha256=z5KPGWjjryBA2uWe0WQ17W6g6Q21tWi-QjEAQtERhPo,1005
78
86
  h2lib_tests/test_files/minimal/res/minimal_mann_turb.hdf5,sha256=Q3cs3bZyplZjBponctO2EARIaP6TpSWP7KI8SfXWRAY,41400
79
87
  h2lib_tests/test_files/minimal/turb/hawc2_mann_l33.6_ae0.1000_g3.9_h0_512xd32xd16_2.000x3.00x4.00_s0001_u,sha256=byiorJmXDL6uKFbyfXthHTjJdm6ELvLR2lS202KrhRI,1048576
80
88
  h2lib_tests/test_files/minimal/turb/hawc2_mann_l33.6_ae0.1000_g3.9_h0_512xd32xd16_2.000x3.00x4.00_s0001_v,sha256=cxK5Rfgfm3gyJsEYi_KlmYY8DIIl_G0aizN2jt18Glc,1048576
81
89
  h2lib_tests/test_files/minimal/turb/hawc2_mann_l33.6_ae0.1000_g3.9_h0_512xd32xd16_2.000x3.00x4.00_s0001_w,sha256=xs61jAwhP3fIR1P5Oa8ovEt2baLoF8uCNs6pKIT8L4o,1048576
82
- h2lib_tests-13.1.304.dist-info/METADATA,sha256=On7mnogtZ5MNXvUszTaV95PSOZdV1i7YS0RPbHzSRAs,349
83
- h2lib_tests-13.1.304.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
84
- h2lib_tests-13.1.304.dist-info/top_level.txt,sha256=WufAL3LO35YJBhWg1AfgTjSld-6l_WuRkXAkNKczUrM,12
85
- h2lib_tests-13.1.304.dist-info/RECORD,,
90
+ h2lib_tests-13.1.502.dist-info/METADATA,sha256=VlhajO_jSvh6Ff37KcgGpcJmCCRapAnmN8NGeCq17RY,360
91
+ h2lib_tests-13.1.502.dist-info/WHEEL,sha256=GV9aMThwP_4oNCtvEC2ec3qUYutgWeAzklro_0m4WJQ,91
92
+ h2lib_tests-13.1.502.dist-info/top_level.txt,sha256=WufAL3LO35YJBhWg1AfgTjSld-6l_WuRkXAkNKczUrM,12
93
+ h2lib_tests-13.1.502.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (72.1.0)
2
+ Generator: setuptools (75.1.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5