File: blockMeshDict.m4

package info (click to toggle)
openfoam 4.1%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 163,028 kB
  • ctags: 58,990
  • sloc: cpp: 830,760; sh: 10,227; ansic: 8,215; xml: 745; lex: 437; awk: 194; sed: 91; makefile: 77; python: 18
file content (165 lines) | stat: -rw-r--r-- 4,430 bytes parent folder | download | duplicates (4)
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
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  4.x                                   |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    `format'      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// block definition for a porosity with an angled inlet/outlet
// the porosity is not aligned with the main axes
//
dnl> -----------------------------------------------------------------
dnl> <STANDARD DEFINTIONS>
dnl>
changecom(//)changequote([,]) dnl>
define(calc, [esyscmd(perl -e 'print ($1)')]) dnl>
define(VCOUNT, 0)  dnl>
define(vlabel, [[// ]pt VCOUNT ($1) define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))])  dnl>
dnl>
define(hex2D, hex ($1b $2b $3b $4b $1f $2f $3f $4f)) dnl>
define(quad2D, ($1f $1b $2b $2f))  dnl>
define(frontQuad, ($1f $2f $3f $4f)) dnl>
define(backQuad, ($4b $3b $2b $1b)) dnl>
dnl>
dnl> </STANDARD DEFINTIONS>
dnl> -----------------------------------------------------------------
dnl>
define(ncells, 20) dnl>
define(ninlet, 15) dnl>
define(nporo, 20) dnl>
define(noutlet, 20) dnl>
dnl>
define(x0,0) dnl>
define(y0,0) dnl>
define(y0,0) dnl>
define(Cos,0.7071067812) dnl>   == cos(45)
define(Sin,0.7071067812) dnl>   == sin(45)
dnl>
define(width,50) dnl>
define(zBack,calc(-width/2)) dnl>
define(zFront,calc(width/2)) dnl>
define(leninlet,150)dnl>
define(lenporo,100)dnl>
define(lenoutlet,100)dnl>
dnl>
define(xhyp,calc(Sin*width)) dnl>
define(yhyp,calc(Cos*width)) dnl>
define(xinlet,leninlet)dnl>
define(xporo,calc(Cos*lenporo)) dnl>
define(yporo,calc(Sin*lenporo)) dnl>
define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl>
define(youtlet,calc(yporo + Sin*lenoutlet)) dnl>
dnl>

convertToMeters 0.001;

vertices
(
    // inlet region
    ( -xinlet  y0  zBack )  vlabel(in1b)
    ( -xinlet yhyp  zBack ) vlabel(in2b)
    ( -xinlet  y0  zFront )  vlabel(in1f)
    ( -xinlet yhyp  zFront ) vlabel(in2f)

    // join inlet->outlet
    (  x0 y0  zBack )    vlabel(join1b)
    ( -xhyp   yhyp  zBack ) vlabel(join2b)
    (  x0 y0  zFront )    vlabel(join1f)
    ( -xhyp   yhyp  zFront ) vlabel(join2f)

    // porosity ends ->outlet
    ( xporo yporo  zBack )  vlabel(poro1b)
    ( calc(xporo - xhyp) calc(yporo + yhyp)  zBack )  vlabel(poro2b)
    ( xporo yporo  zFront )  vlabel(poro1f)
    ( calc(xporo - xhyp) calc(yporo + yhyp)  zFront )  vlabel(poro2f)

    // outlet
    ( xoutlet youtlet zBack ) vlabel(out1b)
    ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zBack ) vlabel(out2b)
    ( xoutlet youtlet zFront ) vlabel(out1f)
    ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zFront ) vlabel(out2f)
);

blocks
(
    // inlet block
    hex2D(in1, join1, join2, in2)
    inlet ( ninlet ncells ncells ) simpleGrading (1 1 1)

    // porosity block
    hex2D(join1, poro1, poro2, join2)
    porosity ( nporo ncells ncells ) simpleGrading (1 1 1)

    // outlet block
    hex2D(poro1, out1, out2, poro2)
    outlet ( noutlet ncells ncells )  simpleGrading (1 1 1)
);

edges
(
);

patches
(
    // is there no way of defining all my 'defaultFaces' to be 'wall'?
    wall front
    (
    // inlet block
    frontQuad(in1, join1, join2, in2)
    // outlet block
    frontQuad(poro1, out1, out2, poro2)
    )

    wall back
    (
    // inlet block
    backQuad(in1, join1, join2, in2)
    // outlet block
    backQuad(poro1, out1, out2, poro2)
    )

    wall walls
    (
    // inlet block
    quad2D(in1, join1)
    quad2D(join2, in2)
    // outlet block
    quad2D(poro1, out1)
    quad2D(out2, poro2)
    )

    wall porosityWall
    (
    // porosity block
    frontQuad(join1, poro1, poro2, join2)
    // porosity block
    backQuad(join1, poro1, poro2, join2)
    // porosity block
    quad2D(join1, poro1)
    quad2D(poro2, join2)
    )

    patch inlet
    (
    quad2D(in2, in1)
    )

    patch outlet
    (
    quad2D(out2, out1)
    )
);

mergePatchPairs
(
);

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