网络书屋(Web Reading Room)

A blogging framework for hackers.

TurbSim 8个湍流模型的对比

TurbSim,是NREL提供的一个小的开源工具, 用于产生湍流风,设置的时候可能对于不同模型会有不同的参数,基于范本进行了一番分析。当然测试文件在TurbSim的Test文件下的inp文件夹下。

如果对那些湍流模型做一个对比,那样是否可以更加清晰的看出不同呢? 于是就有了下面的shell分析脚本。

TurbSim产生的风力机一圈的入流截面模型(仅仅一个截面,全场是因为捕捉了很多个截面)

Turbsim

Shell解析脚本

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
#!/bin/bash - 
#===============================================================================
#
#          FILE: a.sh
# 
#         USAGE: ./a.sh 
# 
#   DESCRIPTION: 
# 
#       OPTIONS: ---
#  REQUIREMENTS: ---
#          BUGS: ---
#         NOTES: ---
#        AUTHOR: Ye Zhaoliang (), zhaoturkkey@163.com
#  ORGANIZATION: YZL
#       CREATED: 2015年08月10日 00:26
#      REVISION:  ---
#===============================================================================

#---  FUNCTION  ----------------------------------------------------------------
#          NAME:  _repeat1
#   DESCRIPTION:  优化版本
#    PARAMETERS:  
#       RETURNS:  
#-------------------------------------------------------------------------------
_repeat1()
{
    #@ 使用方式: _repeat 要重复的字符串  重复次数
    #@  Usage : _repeat string number
    _REPEAT1=$1  #set and not empty, or unlimit recycle
    while [[ ${#_REPEAT1} -lt $2 ]]
    do
        _REPEAT1=$_REPEAT1$_REPEAT1$_REPEAT1 ## 3次优化
    done
    _REPEAT1=${_REPEAT1:0:$2} ##Trim到我们需要的长度
}

alert() #@ Description    产生一个方框的注释
{       #@ Usage    alert "话语"
    _repeat1 "${2:-#}" $(( ${#1} + 8 )) ## ${2:-#} 如果$2未定义则使用#
    printf '%s\n' "$_REPEAT1" ## \a=BEL
    printf '%2.2s %s %2.2s\n' "$_REPEAT1" "$1" "$_REPEAT1" ## \a=BEL
    printf '%s\n' "$_REPEAT1"
}


#alert "Do you really want to delete all the files?"


## RandSeed1 在不同湍流模型配置的不同
{
alert  "RandSeed1"
grep -n "RandSeed1" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "RandSeed2"
grep -n "RandSeed2" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "WrBHHTP"
grep -n "WrBHHTP" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "WrFHHTP"
grep -n "WrFHHTP" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "WrADHH"
grep -n "WrADHH" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "WrADFF"
grep -n "WrADFF" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "WrBLFF"
grep -n "WrBLFF" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "WrADTWR"
grep -n "WrADTWR" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "WrFMTFF"
grep -n "WrFMTFF" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "WrACT"
grep -n "WrACT" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "NumGrid_Z"
grep -n "NumGrid_Z" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "NumGrid_Y"
grep -n "NumGrid_Y" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "HubHt"
grep -n "HubHt" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "GridHeight"
grep -n "GridHeight" *.inp|awk -F: '{print $1,$3}'|sed '/HubHt/d'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "GridWidth"
grep -n "GridWidth" *.inp|awk -F: '{print $1,$3}'|sed '/HubHt/d'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "VFlowAng"
grep -n "VFlowAng" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "HFlowAng"
grep -n "HFlowAng" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "TurbModel"
grep -n "TurbModel" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "IECstandard"
grep -n "IECstandard" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "IECturbc"
grep -n "IECturbc" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "IEC_WindType"
grep -n "IEC_WindType" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "ETMc"
grep -n "ETMc" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "WindProfileType"
grep -n "WindProfileType" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "RefHt"
grep -n "RefHt" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "URef"
grep -n "URef" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "ZJetMax"
grep -n "ZJetMax" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "PLExp"
grep -n "PLExp" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "Z0"
grep -n "Z0" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "RICH_NO"
grep -n "RICH_NO" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "ZI"
grep -n "ZI" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "PC_UW"
grep -n "PC_UW" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "PC_UV"
grep -n "PC_UV" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "PC_VW"
grep -n "PC_VW" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "CohExp"
grep -n "CohExp" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "CTEventPath"
grep -n "CTEventPath" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "CTEventFile"
grep -n "CTEventFile" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "Randomize"
grep -n "Randomize" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "DistScl"
grep -n "DistScl" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "CTLy"
grep -n "CTLy" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "CTLz"
grep -n "CTLz" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
alert  "CTStartTime"
grep -n "CTStartTime" *.inp|awk -F: '{print $1,$3}'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
} > summary.out

改进

  1. 去除无用的Turbulence and Boundary
  2. 增加了对GridWidth and GridHeight的处理
1
2
grep -n "GridHeight" *.inp|awk -F: '{print $1,$3}'|sed '/HubHt/d'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
grep -n "GridWidth" *.inp|awk -F: '{print $1,$3}'|sed '/HubHt/d'|awk '{print substr($1,0,length($1)-4),"\t\t",$2}'|column -t
  1. shell产生的结果如下:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
#################
## RandSeed1 ##
#################
GPLLJ        234516
HYDRO_TIDAL  2318573
Kaimal_15    123456
Kaimal       123456
KHtest       123456
smooth       4433456
vonKarm_15   123456
vonKarm      123456
#################
## RandSeed2 ##
#################
GPLLJ        789012
HYDRO_TIDAL  RANLUX
Kaimal_15    789012
Kaimal       789012
KHtest       "RanLux"
smooth       "RanLux"
vonKarm_15   789012
vonKarm      789012
###############
## WrBHHTP ##
###############
GPLLJ        False
HYDRO_TIDAL  False
Kaimal_15    False
Kaimal       False
KHtest       False
smooth       True
vonKarm_15   False
vonKarm      False
###############
## WrFHHTP ##
###############
GPLLJ        True
HYDRO_TIDAL  True
Kaimal_15    False
Kaimal       False
KHtest       False
smooth       False
vonKarm_15   True
vonKarm      True
##############
## WrADHH ##
##############
GPLLJ        False
HYDRO_TIDAL  True
Kaimal_15    False
Kaimal       False
KHtest       False
smooth       False
vonKarm_15   True
vonKarm      True
##############
## WrADFF ##
##############
GPLLJ        True
HYDRO_TIDAL  False
Kaimal_15    False
Kaimal       False
KHtest       False
smooth       False
vonKarm_15   False
vonKarm      False
##############
## WrBLFF ##
##############
GPLLJ        False
HYDRO_TIDAL  True
Kaimal_15    False
Kaimal       False
KHtest       True
smooth       True
vonKarm_15   False
vonKarm      False
###############
## WrADTWR ##
###############
GPLLJ        False
HYDRO_TIDAL  False
Kaimal_15    False
Kaimal       False
KHtest       False
smooth       False
vonKarm_15   False
vonKarm      False
###############
## WrFMTFF ##
###############
GPLLJ        False
HYDRO_TIDAL  False
Kaimal_15    True
Kaimal       True
KHtest       False
smooth       False
vonKarm_15   False
vonKarm      False
#############
## WrACT ##
#############
GPLLJ        True
HYDRO_TIDAL  False
Kaimal_15    False
Kaimal       False
KHtest       True
smooth       True
vonKarm_15   False
vonKarm      False
#################
## NumGrid_Z ##
#################
GPLLJ        5
HYDRO_TIDAL  5
Kaimal_15    5
Kaimal       5
KHtest       5
smooth       5
vonKarm_15   5
vonKarm      5
#################
## NumGrid_Y ##
#################
GPLLJ        5
HYDRO_TIDAL  5
Kaimal_15    5
Kaimal       5
KHtest       5
smooth       5
vonKarm_15   5
vonKarm      5
#############
## HubHt ##
#############
GPLLJ        90.00
HYDRO_TIDAL  10
Kaimal_15    37.00
Kaimal       37.00
KHtest       37.00
smooth       84.00
vonKarm_15   37.00
vonKarm      37.00
##################
## GridHeight ##
##################
GPLLJ        80.00
HYDRO_TIDAL  9.00
Kaimal_15    30.00
Kaimal       30.00
KHtest       50.00
smooth       70.00
vonKarm_15   30.00
vonKarm      30.00
#################
## GridWidth ##
#################
GPLLJ        600.0
GPLLJ        90.0
GPLLJ        80.00
HYDRO_TIDAL  600
HYDRO_TIDAL  40
HYDRO_TIDAL  9.00
Kaimal_15    600.0
Kaimal_15    55.8
Kaimal_15    30.00
Kaimal       600.0
Kaimal       55.8
Kaimal       30.00
KHtest       600.0
KHtest       100.0
KHtest       50.00
smooth       600.0
smooth       100.0
smooth       70.00
vonKarm_15   600.0
vonKarm_15   55.8
vonKarm_15   30.00
vonKarm      600.0
vonKarm      55.8
vonKarm      30.00
################
## VFlowAng ##
################
GPLLJ        0
HYDRO_TIDAL  0
Kaimal_15    5
Kaimal       5
KHtest       0
smooth       0
vonKarm_15   5
vonKarm      0
################
## HFlowAng ##
################
GPLLJ        0
HYDRO_TIDAL  0
Kaimal_15    10
Kaimal       10
KHtest       0
smooth       0
vonKarm_15   10
vonKarm      0
#################
## TurbModel ##
#################
GPLLJ        "GP_LLJ"
HYDRO_TIDAL  "TIDAL"
Kaimal_15    "IECKAI"
Kaimal       "IECKAI"
KHtest       "NWTCUP"
smooth       "SMOOTH"
vonKarm_15   "IECVKM"
vonKarm      "IECVKM"
###################
## IECstandard ##
###################
GPLLJ        1
HYDRO_TIDAL  "1-ED3"
Kaimal_15    "1-ED2"
Kaimal       1
KHtest       1
smooth       1
vonKarm_15   1
vonKarm      1
################
## IECturbc ##
################
GPLLJ        "A"
HYDRO_TIDAL  "A"
Kaimal_15    "18.0"
Kaimal       "C"
KHtest       "KHtest"
smooth       "A"
vonKarm_15   16.0
vonKarm      "A"
####################
## IEC_WindType ##
####################
GPLLJ        NTM
HYDRO_TIDAL  "NTM"
Kaimal_15    NTM
Kaimal       NTM
KHtest       NTM
smooth       NTM
vonKarm_15   NTM
vonKarm      NTM
############
## ETMc ##
############
GPLLJ        default
HYDRO_TIDAL  default
Kaimal_15    default
Kaimal       default
KHtest       default
smooth       default
vonKarm_15   default
vonKarm      default
#######################
## WindProfileType ##
#######################
GPLLJ        default
HYDRO_TIDAL  "H2L"
Kaimal_15    default
Kaimal       default
KHtest       default
smooth       default
vonKarm_15   default
vonKarm      default
#############
## RefHt ##
#############
GPLLJ        85.00
HYDRO_TIDAL  18
Kaimal_15    10.00
Kaimal       10.00
KHtest       37.00
smooth       84.00
vonKarm_15   10.00
vonKarm      10.00
############
## URef ##
############
GPLLJ        12.0
HYDRO_TIDAL  18
HYDRO_TIDAL  1.2
Kaimal_15    15.0
Kaimal       6.0
KHtest       13.0
smooth       17.0
vonKarm_15   15.0
vonKarm      6.0
###############
## ZJetMax ##
###############
GPLLJ        350
HYDRO_TIDAL  default
Kaimal_15    350
Kaimal       350
KHtest       350
smooth       350
vonKarm_15   350
vonKarm      260
#############
## PLExp ##
#############
GPLLJ        default
HYDRO_TIDAL  default
Kaimal_15    default
Kaimal       default
KHtest       default
smooth       1.527
vonKarm_15   default
vonKarm      default
##########
## Z0 ##
##########
GPLLJ        default
HYDRO_TIDAL  default
Kaimal_15    default
Kaimal       default
KHtest       default
smooth       default
vonKarm_15   default
vonKarm      default
###############
## RICH_NO ##
###############
GPLLJ        0.05
HYDRO_TIDAL  0.05
Kaimal_15    0.05
Kaimal       0.05
KHtest       0.02
smooth       0.05
vonKarm_15   0.05
vonKarm      0.05
##########
## ZI ##
##########
GPLLJ        default
HYDRO_TIDAL  default
Kaimal_15    default
Kaimal       default
KHtest       default
smooth       default
vonKarm_15   default
vonKarm      default
#############
## PC_UW ##
#############
GPLLJ        default
HYDRO_TIDAL  default
Kaimal_15    default
Kaimal       default
KHtest       default
smooth       default
vonKarm_15   default
vonKarm      default
#############
## PC_UV ##
#############
GPLLJ        default
HYDRO_TIDAL  default
Kaimal_15    default
Kaimal       default
KHtest       default
smooth       default
vonKarm_15   default
vonKarm      default
#############
## PC_VW ##
#############
GPLLJ        default
HYDRO_TIDAL  default
Kaimal_15    default
Kaimal       default
KHtest       default
smooth       default
vonKarm_15   default
vonKarm      default
##############
## CohExp ##
##############
GPLLJ        default
HYDRO_TIDAL  default
Kaimal_15    default
Kaimal       default
KHtest       default
smooth       default
vonKarm_15   default
vonKarm      default
###################
## CTEventPath ##
###################
GPLLJ        ".\EventData"
HYDRO_TIDAL  "/home/lkilcher/work/nwtc/turbsim/trunk/Test/EventData/"
Kaimal_15    ".\EventData"
Kaimal       ".\EventData"
KHtest       ".\EventData"
smooth       ".\EventData"
vonKarm_15   ".\EventData"
vonKarm      ".\EventData"
###################
## CTEventFile ##
###################
GPLLJ        LES
HYDRO_TIDAL  "Random"
Kaimal_15    random
Kaimal       random
KHtest       "les"
smooth       "les"
vonKarm_15   random
vonKarm      random
#################
## Randomize ##
#################
GPLLJ        true
HYDRO_TIDAL  true
HYDRO_TIDAL  1.0
HYDRO_TIDAL  0.5
HYDRO_TIDAL  0.5
Kaimal_15    true
Kaimal       true
KHtest       true
smooth       true
vonKarm_15   true
vonKarm      true
###############
## DistScl ##
###############
GPLLJ        1.0
HYDRO_TIDAL  1.0
Kaimal_15    1.0
Kaimal       1.0
KHtest       1.0
smooth       1.0
vonKarm_15   1.0
vonKarm      1.0
############
## CTLy ##
############
GPLLJ        0.5
HYDRO_TIDAL  0.5
Kaimal_15    0.5
Kaimal       0.5
KHtest       0.5
smooth       0.5
vonKarm_15   0.5
vonKarm      0.5
############
## CTLz ##
############
GPLLJ        0.5
HYDRO_TIDAL  0.5
Kaimal_15    0.5
Kaimal       0.5
KHtest       0.5
smooth       0.5
vonKarm_15   0.5
vonKarm      0.5
###################
## CTStartTime ##
###################
GPLLJ        30.0
HYDRO_TIDAL  30.0
Kaimal_15    30.0
Kaimal       30.0
KHtest       0.0
smooth       10.0
vonKarm_15   30.0
vonKarm      30.0

进一步的细节可以参考Turbsim UserGuide