File: blockMeshDict

package info (click to toggle)
openfoam 1912.200626-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye
  • size: 238,940 kB
  • sloc: cpp: 1,159,638; sh: 15,902; ansic: 5,195; lex: 660; xml: 387; python: 282; awk: 212; makefile: 103; sed: 88; csh: 3
file content (346 lines) | stat: -rw-r--r-- 11,972 bytes parent folder | download | duplicates (2)
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
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM Extend Project: Open Source CFD        |
|  \\    /   O peration     | Version:  v1912                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

scale   1;

// Domain
axisLevel               0.0;  // x-coord of axis (right boundary of domain)
bottomLevel             -1.0; // y-coord of bottom of domain
topLevel                1.0;  // y-coord of top of domain
farFieldWall            -0.572; // x-coord of far field wall
wedgeAngle              5.0;  // Wedge angle in degrees
// Size of block moving with sphere (no cell deformation), in sphere radii
// above and below centre of sphere
upperSphereBlock        5.0;
lowerSphereBlock        5.0;
sphereLayerThickness    2.0; // Total layer thickness in sphere radii

// Sphere
sphereRadius            0.028;
sphereCentreHeight      0.147; // y-coord of sphere centre

// Calculated positions
sphereRadiusPosition    #eval{ -1.0*(1.0 + $sphereLayerThickness)*$sphereRadius };
AMIBlockPosition        #eval{ 2.0*$sphereRadiusPosition + $sphereRadius };
// Centre plane is z=0, so use half of wedge angle to calculate pos and neg
// z-positions
tanAlpha                #eval{ tan(0.5*degToRad($wedgeAngle)) };
// Multiply by -1 because tan give negative value
firstBlockPosDepth      #eval{ -1.0*$tanAlpha*$sphereRadiusPosition };
firstBlockNegDepth      #eval{ -1.0*$firstBlockPosDepth };
AMIBlockPosDepth        #eval{ -1.0*$tanAlpha*$AMIBlockPosition };
AMIBlockNegDepth        #eval{ -1.0*$AMIBlockPosDepth };
farFieldPosDepth        #eval{ -1.0*$tanAlpha*$farFieldWall };
farFieldNegDepth        #eval{ -1.0*$farFieldPosDepth };

bottomBlockTopHeight    #eval{ $sphereCentreHeight - $lowerSphereBlock*$sphereRadius };
topBlockBottomHeight    #eval{ $sphereCentreHeight + $upperSphereBlock*$sphereRadius };

topSphere               #eval{ $sphereCentreHeight + $sphereRadius };
bottomSphere            #eval{ $sphereCentreHeight - $sphereRadius };
topSphereLayer          #eval{ $sphereCentreHeight + (1.0 + $sphereLayerThickness)*$sphereRadius };
bottomSphereLayer       #eval{ $sphereCentreHeight - (1.0 + $sphereLayerThickness)*$sphereRadius };

// Layer block below sphere
innerBottomLayerX       #eval{ -1.0*cos(degToRad(45.0))*$sphereRadius };
innerBottomLayerY       #eval{ $sphereCentreHeight - cos(degToRad(45.0))*$sphereRadius };
innerBottomLayerZPos    #eval{ -1.0*$tanAlpha*$innerBottomLayerX };
innerBottomLayerZNeg    #eval{ -1.0*$innerBottomLayerZPos };

innerBottomArcX1        #eval{ -1.0*sin(degToRad(22.5))*$sphereRadius };
innerBottomArcY1        #eval{ $sphereCentreHeight - cos(degToRad(22.5))*$sphereRadius };
innerBottomArcZ1Pos     #eval{ $innerBottomArcX1*$tanAlpha };
innerBottomArcZ1Neg     #eval{ -1.0*$innerBottomArcZ1Pos };

outerBottomArcX1        #eval{ -1.0*sin(degToRad(22.5))*$sphereRadius*(1.0 + $sphereLayerThickness) };
outerBottomArcY1        #eval{ $sphereCentreHeight - cos(degToRad(22.5))*$sphereRadius*(1.0 + $sphereLayerThickness) };
outerBottomArcZ1Pos     #eval{ $outerBottomArcX1*$tanAlpha };
outerBottomArcZ1Neg     #eval{ -1.0*$outerBottomArcZ1Pos };

outerBottomLayerX       #eval{ -1.0*cos(degToRad(45.0))*(1.0 + $sphereLayerThickness)*$sphereRadius };
outerBottomLayerY       #eval{ $sphereCentreHeight - cos(degToRad(45.0))*(1.0 + $sphereLayerThickness)*$sphereRadius };
outerBottomLayerZPos    #eval{ -1.0*$tanAlpha*$outerBottomLayerX };
outerBottomLayerZNeg    #eval{ -1.0*$outerBottomLayerZPos };

// Layer block above sphere
innerTopLayerX          #eval{ cos(degToRad(135.0))*$sphereRadius };
innerTopLayerY          #eval{ $sphereCentreHeight - cos(degToRad(135.0))*$sphereRadius };
innerTopLayerZPos       #eval{ -1.0*$tanAlpha*$innerBottomLayerX };
innerTopLayerZNeg       #eval{ -1.0*$innerBottomLayerZPos };

innerTopArcX1           #eval{ -1.0*sin(degToRad(157.5))*$sphereRadius };
innerTopArcY1           #eval{ $sphereCentreHeight - cos(degToRad(157.5))*$sphereRadius };
innerTopArcZ1Pos        #eval{ $innerTopArcX1*$tanAlpha };
innerTopArcZ1Neg        #eval{ -1.0*$innerTopArcZ1Pos };

outerTopArcX1           #eval{ -1.0*sin(degToRad(157.5))*$sphereRadius*(1.0 + $sphereLayerThickness) };
outerTopArcY1           #eval{ $sphereCentreHeight - cos(degToRad(157.5))*$sphereRadius*(1.0 + $sphereLayerThickness) };
outerTopArcZ1Pos        #eval{ $outerTopArcX1*$tanAlpha };
outerTopArcZ1Neg        #eval{ -1.0*$outerTopArcZ1Pos };

outerTopLayerX          #eval{ cos(degToRad(135.0))*(1.0 + $sphereLayerThickness)*$sphereRadius };
outerTopLayerY          #eval{ $sphereCentreHeight - cos(degToRad(135.0))*(1.0 + $sphereLayerThickness)*$sphereRadius };
outerTopLayerZPos       #eval{ -1.0*$tanAlpha*$outerTopLayerX };
outerTopLayerZNeg       #eval{ -1.0*$outerTopLayerZPos };

// Layer block left of sphere
innerLeftArcX           #eval{ -1.0*$sphereRadius };
innerLeftArcY           #eval{ $sphereCentreHeight };
innerLeftArcZPos        #eval{ -1.0*$tanAlpha*$innerLeftArcX };
innerLeftArcZNeg        #eval{ -1.0*$innerLeftArcZPos };

outerLeftArcX           #eval{ -1.0*(1.0 + $sphereLayerThickness)*$sphereRadius };
outerLeftArcZPos        #eval{ -1.0*$tanAlpha*$outerLeftArcX };
outerLeftArcZNeg        #eval{ -1.0*$outerLeftArcZPos };


vertices
(
    // Lower moving block
    ($axisLevel            $bottomLevel 0) //  0
    ($axisLevel            $bottomBlockTopHeight 0) // 1
    ($AMIBlockPosition $bottomLevel $AMIBlockPosDepth) //  2
    ($AMIBlockPosition $bottomLevel $AMIBlockNegDepth) //  3
    ($AMIBlockPosition $bottomBlockTopHeight $AMIBlockNegDepth) //  4
    ($AMIBlockPosition $bottomBlockTopHeight $AMIBlockPosDepth) //  5

    // Upper moving block
    ($AMIBlockPosition $topBlockBottomHeight $AMIBlockPosDepth) //  6
    ($AMIBlockPosition $topBlockBottomHeight $AMIBlockNegDepth) //  7
    ($axisLevel            $topBlockBottomHeight 0) //  8
    ($AMIBlockPosition     $topLevel $AMIBlockPosDepth) //  9
    ($AMIBlockPosition     $topLevel $AMIBlockNegDepth) //  10
    ($axisLevel            $topLevel 0) // 11

    // Farfield block
    ($farFieldWall $bottomLevel $farFieldPosDepth) // 12
    ($AMIBlockPosition $bottomLevel $AMIBlockPosDepth) // 13
    ($AMIBlockPosition $topLevel $AMIBlockPosDepth) // 14
    ($farFieldWall $topLevel $farFieldPosDepth) // 15

    ($farFieldWall $bottomLevel $farFieldNegDepth) // 16
    ($AMIBlockPosition $bottomLevel $AMIBlockNegDepth) // 17
    ($AMIBlockPosition $topLevel $AMIBlockNegDepth) // 18
    ($farFieldWall $topLevel $farFieldNegDepth) // 19

    //  Sphere block
    ($axisLevel $bottomSphere 0) // 20
    ($innerBottomLayerX $innerBottomLayerY $innerBottomLayerZPos) // 21
    ($innerBottomLayerX $innerBottomLayerY $innerBottomLayerZNeg) // 22
    ($axisLevel $bottomSphereLayer 0) // 23
    ($outerBottomLayerX $outerBottomLayerY $outerBottomLayerZPos) // 24
    ($outerBottomLayerX $outerBottomLayerY $outerBottomLayerZNeg) // 25

    ($axisLevel $topSphere 0) // 26
    ($axisLevel $topSphereLayer 0) // 27
    ($innerTopLayerX $innerTopLayerY $innerTopLayerZNeg) // 28
    ($outerTopLayerX $outerTopLayerY $outerTopLayerZNeg) // 29
    ($innerTopLayerX $innerTopLayerY $innerTopLayerZPos) // 30
    ($outerTopLayerX $outerTopLayerY $outerTopLayerZPos) // 31
);

edgeNumber 1; // 0.707;

layerGrading 0.5;
invLayerGrading #eval{ 1.0/$layerGrading };

blockGrading 0.3;
invBlockGrading #eval{ 1.0/$blockGrading };

blocks
(
    hex (16 17 18 19 12 13 14 15) farField (25 100 1) simpleGrading (1 1 1)

    hex (3 0 1 4 2 0 1 5) bottomBlock (10 50 1) simpleGrading ($edgeNumber 1 1)

    hex (7 8 11 10 6 8 11 9) topBlock (10 35 1) simpleGrading ($edgeNumber 1 1)

    hex (25 23 20 22 24 23 20 21)
    centralBlock (10 20 1)
    edgeGrading
    (
        1 1 1 1
        $layerGrading $layerGrading $layerGrading $layerGrading
        1 1 1 1
    ) // bottom layer

    hex (25 22 28 29 24 21 30 31)
    centralBlock (20 20 1)
    edgeGrading
    (
        $layerGrading $layerGrading $layerGrading $layerGrading
        1 1 1 1
        1 1 1 1
    ) // middle layer

    hex (28 26 27 29 30 26 27 31)
    centralBlock (10 20 1)
    edgeGrading
    (
        1 1 1 1
        $invLayerGrading $invLayerGrading $invLayerGrading $invLayerGrading
        1 1 1 1
    ) // top layer

    hex (4 1 23 25 5 1 23 24)
    centralBlock (10 10 1)
    edgeGrading
    (
        $edgeNumber 1 1 $edgeNumber
        $blockGrading $edgeNumber $edgeNumber $blockGrading
        1 $edgeNumber $edgeNumber 1
    ) // bottom

    hex (4 25 29 7 5 24 31 6)
    centralBlock (10 20 1)
    edgeGrading
    (
        $blockGrading $blockGrading $blockGrading $blockGrading
        1 1 1 1
        1 1 1 1
    ) // middle

    hex (29 27 8 7 31 27 8 6)
    centralBlock (10 10 1)
    edgeGrading
    (
        1 $edgeNumber $edgeNumber 1
        $invBlockGrading $invBlockGrading $invBlockGrading $invBlockGrading
        1 1 1 1
    ) // top
);

edges
(
    // Layer block below sphere
    arc 20 22 ($innerBottomArcX1 $innerBottomArcY1 $innerBottomArcZ1Pos)
    arc 20 21 ($innerBottomArcX1 $innerBottomArcY1 $innerBottomArcZ1Neg)
    arc 23 25 ($outerBottomArcX1 $outerBottomArcY1 $outerBottomArcZ1Pos)
    arc 23 24 ($outerBottomArcX1 $outerBottomArcY1 $outerBottomArcZ1Neg)

    // Layer block above sphere
    arc 26 28 ($innerTopArcX1 $innerTopArcY1 $innerTopArcZ1Pos)
    arc 26 30 ($innerTopArcX1 $innerTopArcY1 $innerTopArcZ1Neg)
    arc 27 29 ($outerTopArcX1 $outerTopArcY1 $outerTopArcZ1Pos)
    arc 27 31 ($outerTopArcX1 $outerTopArcY1 $outerTopArcZ1Neg)

    // Layer block left of sphere
    arc 22 28 ($innerLeftArcX $innerLeftArcY $innerLeftArcZNeg)
    arc 21 30 ($innerLeftArcX $innerLeftArcY $innerLeftArcZPos)
    arc 24 31 ($outerLeftArcX $innerLeftArcY $outerLeftArcZPos)
    arc 25 29 ($outerLeftArcX $innerLeftArcY $outerLeftArcZNeg)
);

boundary
(
    front
    {
        type wedge;
        faces
        (
            (0 1 5 2)
            (5 1 23 24)
            (23 20 21 24)
            (24 21 30 31)
            (5 24 31 6)
            (31 27 8 6)
            (6 8 11 9)
            (31 30 26 27)
            (12 13 14 15)
        );
    }
    back
    {
        type wedge;
        faces
        (
            (0 3 4 1)
            (1 4 25 23)
            (4 7 29 25)
            (23 25 22 20)
            (25 29 28 22)
            (29 7 8 27)
            (28 29 27 26)
            (7 10 11 8)
            (16 17 18 19)
        );
    }
    innerAMI
    {
        type cyclicAMI;
        neighbourPatch outerAMI;
        faces
        (
            (4 5 6 7)
            (6 9 10 7)
            (2 5 4 3)
        );
        transform noOrdering;
    }
    outerAMI
    {
        type cyclicAMI;
        neighbourPatch innerAMI;
        faces
        (
            (14 13 17 18)
        );
        transform noOrdering;
    }
    top
    {
        type wall;
        faces
        (
            (15 14 18 19)
            (9 11 11 10)
        );
    }
    bottom
    {
        type wall;
        faces
        (
            (12 16 17 13)
            (0 2 3 0)
        );
    }
    farFieldWall
    {
        type wall;
        faces
        (
            (12 15 19 16)
        );
    }
    sphere
    {
        type wall;
        faces
        (
            (20 22 21 20)
            (21 22 28 30)
            (30 26 26 28)
        );
    }
);

mergePatchPairs
(
);


// ************************************************************************* //