背景
采用cfl3d进行流场计算时,为了较为准确地描述声场,需要将网格做的很密。然而,当计算完壁面压力后计算壁板结构响应的时候,常常不需要那么多网格单元上的作用力,此外,流场变量一般是压强。所以,需要对壁面进行重新划分,目的是得到少量单元上的作用力。下面图中黑色线为流体计算网格,红色线为重新划分的等距粗网格,绿色线组成的单元为最后需要积分的单元。最后得到即是绿色单元中心坐标及绿色单元上的压力。
整体思路
一开始是想要自己写代码,根据间距将边界重新划分。然后针对每个绿色的单元,搜索所有在单元内部的流体网格(红色),理论上不难,实现上麻烦。流体计算采用的多块结构化网格求解器cfl3d,对边界的划分并不是特别详细,我需要搜索所有的block判断网格点位置,然后根据网格位置计算单元的面积、中心坐标及其压强。再加上这个也是一次性的工作,后面应该也用不着了,就算后面需要用到重新划分边界积力的功能,平板这种几何适用性也不广。没有错,我又偷懒了!
计划:
- 重新划分均匀的多块网格,然后分别导出plot3d格式的各个壁面的表面网格
- 在tecplot中,将流场变量插值到新的网格上
- 在新的均匀网格上进行积分,得到各个block对应壁面(即绿色单元)的面积和力,同时可以计算中心点坐标
- 录制tecplot宏文件处理单个结果
- 在Matlab中编程,实现对非定常结果文件的批量处理,并将结果处理成需要的格式
tecplot宏文件
tecplot宏文件的主要功能就是读取流场的网格、解文件和重新划分过后的网格文件,然后将重新划分后的网格的block单元对应壁面的中心坐标、面积和力输出,以下宏文件只是处理一个壁面的。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
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580#!MC 1410
$!VarSet |MFBD| = 'D:\Program Files\Tecplot\Tecplot 360 EX 2017 R1'
$!READDATASET '"STANDARDSYNTAX" "1.0" "APPEND" "No" "FILELIST_GRIDFILES" "1" "|MACROFILEPATH|\plot3d_grid.xyz" "FILELIST_SOLUTIONFILES" "1" "|MACROFILEPATH|\plot3d_sol.q" "IINDEXRANGE" "1,,1" "JINDEXRANGE" "1,,1" "KINDEXRANGE" "1,,1" "AUTODETECT" "Yes" "LOADBOUNDARY" "No" "ASCIIISDOUBLE" "No" "ASCIIHASIBLANK" "No" "SOLUTIONSSHARESTRUCTURE" "Yes" "ASSIGNSTRANDIDS" "Yes" "ADDTOEXISTINGSTRANDS" "No" "UNIFORMGRIDSTRUCTURE" "Yes" "ASSIGNNEWSTRANDIDFOREACHTIMESTEP" "Yes" "EXTRACTTIMEFROMSOLFILENAMES" "No"'
DATASETREADER = 'PLOT3D Loader'
$!EXTENDEDCOMMAND
COMMANDPROCESSORID = 'CFDAnalyzer4'
COMMAND = 'Calculate Function=\'PRESSURE\' Normalization=\'None\' ValueLocation=\'Nodal\' CalculateOnDemand=\'T\' UseMorePointsForFEGradientCalculations=\'F\''
$!THREEDVIEW PSIANGLE = 53.807200000000002
$!THREEDVIEW THETAANGLE = -102.30500000000001
$!THREEDVIEW ALPHAANGLE = -29.021100000000001
$!THREEDVIEW VIEWERPOSITION{X = 91.281895526524366}
$!THREEDVIEW VIEWERPOSITION{Y = 14.75501733399904}
$!THREEDVIEW VIEWERPOSITION{Z = 50.417221986605703}
$!THREEDVIEW VIEWWIDTH = 10.7112
$!THREEDVIEW PSIANGLE = 58.068600000000004
$!THREEDVIEW THETAANGLE = -49.576300000000003
$!THREEDVIEW ALPHAANGLE = -155.89599999999999
$!THREEDVIEW VIEWERPOSITION{X = 79.122162688993541}
$!THREEDVIEW VIEWERPOSITION{Y = -46.914996330055473}
$!THREEDVIEW VIEWERPOSITION{Z = 45.157750714352701}
$!THREEDVIEW PSIANGLE = 52.471499999999999
$!THREEDVIEW THETAANGLE = 27.57
$!THREEDVIEW ALPHAANGLE = 166.59999999999999
$!THREEDVIEW VIEWERPOSITION{X = -7.378309297397962}
$!THREEDVIEW VIEWERPOSITION{Y = -59.950935584126142}
$!THREEDVIEW VIEWERPOSITION{Z = 52.009661890827751}
$!THREEDVIEW VIEWWIDTH = 17.7302
$!THREEDVIEW PSIANGLE = 41.619199999999999
$!THREEDVIEW THETAANGLE = 48.075800000000001
$!THREEDVIEW ALPHAANGLE = 138.52199999999999
$!THREEDVIEW VIEWERPOSITION{X = -18.23166990978434}
$!THREEDVIEW VIEWERPOSITION{Y = -37.817973498926072}
$!THREEDVIEW VIEWERPOSITION{Z = 63.827907197085402}
$!ALTERDATA
EQUATION = 'v11=v10'
$!READDATASET '"STANDARDSYNTAX" "1.0" "APPEND" "Yes" "FILELIST_GRIDFILES" "1" "|MACROFILEPATH|\bottom.xyz" "IINDEXRANGE" "1,,1" "JINDEXRANGE" "1,,1" "KINDEXRANGE" "1,,1" "AUTODETECT" "Yes" "LOADBOUNDARY" "No" "ASCIIISDOUBLE" "No" "ASCIIHASIBLANK" "No" "SOLUTIONSSHARESTRUCTURE" "No" "ASSIGNSTRANDIDS" "Yes" "ADDTOEXISTINGSTRANDS" "No" "UNIFORMGRIDSTRUCTURE" "Yes" "ASSIGNNEWSTRANDIDFOREACHTIMESTEP" "Yes" "EXTRACTTIMEFROMSOLFILENAMES" "No"'
DATASETREADER = 'PLOT3D Loader'
$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!PICK SETMOUSEMODE
MOUSEMODE = SELECT
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 65
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!GLOBALRGB REDCHANNELVAR = 5
$!GLOBALRGB GREENCHANNELVAR = 4
$!GLOBALRGB BLUECHANNELVAR = 4
$!SETCONTOURVAR
VAR = 5
CONTOURGROUP = 1
LEVELINITMODE = RESETTONICE
$!SETCONTOURVAR
VAR = 6
CONTOURGROUP = 2
LEVELINITMODE = RESETTONICE
$!SETCONTOURVAR
VAR = 7
CONTOURGROUP = 3
LEVELINITMODE = RESETTONICE
$!SETCONTOURVAR
VAR = 8
CONTOURGROUP = 4
LEVELINITMODE = RESETTONICE
$!SETCONTOURVAR
VAR = 9
CONTOURGROUP = 5
LEVELINITMODE = RESETTONICE
$!SETCONTOURVAR
VAR = 10
CONTOURGROUP = 6
LEVELINITMODE = RESETTONICE
$!SETCONTOURVAR
VAR = 11
CONTOURGROUP = 7
LEVELINITMODE = RESETTONICE
$!SETCONTOURVAR
VAR = 5
CONTOURGROUP = 8
LEVELINITMODE = RESETTONICE
$!FIELDLAYERS SHOWCONTOUR = YES
$!SETCONTOURVAR
VAR = 11
CONTOURGROUP = 1
LEVELINITMODE = RESETTONICE
$!VIEW FITSURFACES
CONSIDERBLANKING = YES
$!THREEDVIEW PSIANGLE = 72.805199999999999
$!THREEDVIEW THETAANGLE = 52.359499999999997
$!THREEDVIEW ALPHAANGLE = 137.845
$!THREEDVIEW VIEWERPOSITION{X = -24.589849343375509}
$!THREEDVIEW VIEWERPOSITION{Y = -37.372498690741047}
$!THREEDVIEW VIEWERPOSITION{Z = 18.97307185030439}
$!THREEDVIEW VIEWWIDTH = 15.5207
$!THREEDVIEW VIEWWIDTH = 13.850099999999999
$!THREEDVIEW PSIANGLE = 92.814999999999998
$!THREEDVIEW THETAANGLE = 97.962999999999994
$!THREEDVIEW ALPHAANGLE = 120.812
$!THREEDVIEW VIEWERPOSITION{X = -39.524345101992907}
$!THREEDVIEW VIEWERPOSITION{Y = 8.9512255213340701}
$!THREEDVIEW VIEWERPOSITION{Z = -3.1519490908170038}
$!THREEDVIEW PSIANGLE = 145.14400000000001
$!THREEDVIEW THETAANGLE = 65.914299999999997
$!THREEDVIEW ALPHAANGLE = 67.960899999999995
$!THREEDVIEW VIEWERPOSITION{X = -9.5262906519793376}
$!THREEDVIEW VIEWERPOSITION{Y = -14.898406471951491}
$!THREEDVIEW VIEWERPOSITION{Z = -52.665604284005923}
$!THREEDVIEW PSIANGLE = 107.17
$!THREEDVIEW THETAANGLE = 57.3658
$!THREEDVIEW ALPHAANGLE = 66.9512
$!THREEDVIEW VIEWERPOSITION{X = -27.6790547262434}
$!THREEDVIEW VIEWERPOSITION{Y = -32.997374479869677}
$!THREEDVIEW VIEWERPOSITION{Z = -18.946452998205149}
$!THREEDVIEW VIEWWIDTH = 12.0924
$!THREEDVIEW VIEWERPOSITION{X = -28.61740720879089}
$!THREEDVIEW VIEWERPOSITION{Y = -32.167790659402591}
$!THREEDVIEW VIEWERPOSITION{Z = -17.836848977589391}
$!THREEDVIEW PSIANGLE = 97.334699999999998
$!THREEDVIEW THETAANGLE = 55.998800000000003
$!THREEDVIEW ALPHAANGLE = 74.124099999999999
$!THREEDVIEW VIEWERPOSITION{X = -29.536544408097338}
$!THREEDVIEW VIEWERPOSITION{Y = -34.748029607278148}
$!THREEDVIEW VIEWERPOSITION{Z = -6.9015908021360124}
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 66
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 67
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 68
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 69
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 70
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 71
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 72
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 73
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 74
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 75
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 76
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 77
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 78
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 79
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 80
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 81
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 82
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 83
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 84
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 85
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 86
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 87
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 88
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 89
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 90
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 91
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 92
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 93
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 94
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 95
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 96
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 97
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 98
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 99
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 100
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 101
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 102
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 103
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 104
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 105
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 106
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 107
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 108
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 109
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 110
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 111
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 112
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 113
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!INVERSEDISTINTERPOLATE
SOURCEZONES = [1-64]
DESTINATIONZONE = 114
VARLIST = [11]
INVDISTEXPONENT = 3.5
INVDISTMINRADIUS = 0
INTERPPTSELECTION = NEARESTNPOINTS
INTERPNPOINTS = 4
$!REDRAWALL
$!EXTENDEDCOMMAND
COMMANDPROCESSORID = 'CFDAnalyzer4'
COMMAND = 'Integrate [65-114] VariableOption=\'Average\' XOrigin=0 YOrigin=0 ZOrigin=0 ScalarVar=1 Absolute=\'F\' ExcludeBlanked=\'F\' XVariable=1 YVariable=2 ZVariable=3 IntegrateOver=\'Cells\' IntegrateBy=\'Zones\' IRange={MIN =1 MAX = 0 SKIP = 1} JRange={MIN =1 MAX = 0 SKIP = 1} KRange={MIN =1 MAX = 0 SKIP = 1} PlotResults=\'F\' PlotAs=\'Result\''
$!EXTENDEDCOMMAND
COMMANDPROCESSORID = 'CFDAnalyzer4'
COMMAND = 'SaveIntegrationResults FileName=\'.\\Outx.txt\''
$!EXTENDEDCOMMAND
COMMANDPROCESSORID = 'CFDAnalyzer4'
COMMAND = 'Integrate [65-114] VariableOption=\'Average\' XOrigin=0 YOrigin=0 ZOrigin=0 ScalarVar=2 Absolute=\'F\' ExcludeBlanked=\'F\' XVariable=1 YVariable=2 ZVariable=3 IntegrateOver=\'Cells\' IntegrateBy=\'Zones\' IRange={MIN =1 MAX = 0 SKIP = 1} JRange={MIN =1 MAX = 0 SKIP = 1} KRange={MIN =1 MAX = 0 SKIP = 1} PlotResults=\'F\' PlotAs=\'Result\''
$!EXTENDEDCOMMAND
COMMANDPROCESSORID = 'CFDAnalyzer4'
COMMAND = 'SaveIntegrationResults FileName=\'.\\Outy.txt\''
$!EXTENDEDCOMMAND
COMMANDPROCESSORID = 'CFDAnalyzer4'
COMMAND = 'Integrate [65-114] VariableOption=\'Average\' XOrigin=0 YOrigin=0 ZOrigin=0 ScalarVar=3 Absolute=\'F\' ExcludeBlanked=\'F\' XVariable=1 YVariable=2 ZVariable=3 IntegrateOver=\'Cells\' IntegrateBy=\'Zones\' IRange={MIN =1 MAX = 0 SKIP = 1} JRange={MIN =1 MAX = 0 SKIP = 1} KRange={MIN =1 MAX = 0 SKIP = 1} PlotResults=\'F\' PlotAs=\'Result\''
$!EXTENDEDCOMMAND
COMMANDPROCESSORID = 'CFDAnalyzer4'
COMMAND = 'SaveIntegrationResults FileName=\'.\\Outz.txt\''
$!EXTENDEDCOMMAND
COMMANDPROCESSORID = 'CFDAnalyzer4'
COMMAND = 'Integrate [65-114] VariableOption=\'Average\' XOrigin=0 YOrigin=0 ZOrigin=0 ScalarVar=11 Absolute=\'F\' ExcludeBlanked=\'F\' XVariable=1 YVariable=2 ZVariable=3 IntegrateOver=\'Cells\' IntegrateBy=\'Zones\' IRange={MIN =1 MAX = 0 SKIP = 1} JRange={MIN =1 MAX = 0 SKIP = 1} KRange={MIN =1 MAX = 0 SKIP = 1} PlotResults=\'F\' PlotAs=\'Result\''
$!EXTENDEDCOMMAND
COMMANDPROCESSORID = 'CFDAnalyzer4'
COMMAND = 'SaveIntegrationResults FileName=\'.\\Outp.txt\''
$!EXTENDEDCOMMAND
COMMANDPROCESSORID = 'CFDAnalyzer4'
COMMAND = 'Integrate [65-114] VariableOption=\'LengthAreaVolume\' XOrigin=0 YOrigin=0 ZOrigin=0 ScalarVar=11 Absolute=\'F\' ExcludeBlanked=\'F\' XVariable=1 YVariable=2 ZVariable=3 IntegrateOver=\'Cells\' IntegrateBy=\'Zones\' IRange={MIN =1 MAX = 0 SKIP = 1} JRange={MIN =1 MAX = 0 SKIP = 1} KRange={MIN =1 MAX = 0 SKIP = 1} PlotResults=\'F\' PlotAs=\'Result\''
$!EXTENDEDCOMMAND
COMMANDPROCESSORID = 'CFDAnalyzer4'
COMMAND = 'SaveIntegrationResults FileName=\'.\\Outs.txt\''
$!RemoveVar |MFBD|
$!Quit
Matlab代码
Matlab代码是为了实行所有的操作自动化,便于批量处理文件,该代码只处理了一个几何部件(即一个平面)。如果需要处理多个平面,只要准备对应的plot3d网格和宏文件,并添加循环即可。这个接下来还是要做的,但目前工作已经基本实现了且重点问题已经解决了。为了不使这个文档显得太过冗杂,后续就不再赘述了。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
50ntime=5000;
filecount=5;
fid=zeros(filecount,0);
onetime=0.01/303.848;
pref=0.467063*303.848*303.848;
filepath="E:\zhoulaoshi\cavity\getforce\UnSteady";
tecpath="D:\Program Files\Tecplot\Tecplot 360 EX 2017 R1\bin";
partname='bottom';
geofile='geo.dat';
for j=1:ntime
jstr=num2str(j,'%06d');
solbin=strcat('plot3d_sol.bin_',jstr);
dos1=strcat("copy ",filepath,"\",solbin," .\plot3d_sol.q");
system(dos1);
dos2=strcat('"',tecpath,"\",'tec360.exe"'," -b -p ", partname ,".mcr");
system(dos2);
fid(1)=fopen('Outx.txt','r');
fid(2)=fopen('Outy.txt','r');
fid(3)=fopen('Outz.txt','r');
fid(4)=fopen('Outs.txt','r');
fid(5)=fopen('Outp.txt','r');
varcell=cell(filecount,1);
for i=1:filecount
fgets(fid(i));
varcell(i,1) =textscan(fid(i),'%*s %*s %f');
end
len=length(varcell{1,1});
var=zeros(len,filecount);
for i=1:5
var(:,i)=varcell{i,1};
end
var(end,:)=[];
for pointnum=1:len-1
outname=strcat(partname,"f",num2str(pointnum),".dat");
fod1=fopen(outname,'a');
fprintf(fod1,'%f %f\n',(j-1)*onetime,pref*var(pointnum,5));
fclose(fod1);
if j==1
outname=strcat(partname,geofile,".dat");
fod1=fopen(outname,'a');
fprintf(fod1,'%f %f %f %f\n',var(pointnum,1),var(pointnum,2),var(pointnum,3),var(pointnum,4));
fclose(fod1);
end
end
fclose('all');
end