1 /*--------------------------------*- C++ -*----------------------------------*\
3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4 | \\ / O peration | Version: 1.7.1 |
5 | \\ / A nd | Web: www.OpenFOAM.com |
6 | \\/ M anipulation | |
7 \*---------------------------------------------------------------------------*/
15 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
16 // block definition for a porosity with an angled inlet/outlet
17 // the porosity is not aligned with the main axes
19 dnl> -----------------------------------------------------------------
20 dnl> <STANDARD DEFINTIONS>
22 changecom(//)changequote([,]) dnl>
23 define(calc, [esyscmd(perl -e 'print ($1)')]) dnl>
24 define(VCOUNT, 0) dnl>
25 define(vlabel, [[// ]pt VCOUNT ($1) define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))]) dnl>
27 define(hex2D, hex ($1b $2b $3b $4b $1f $2f $3f $4f)) dnl>
28 define(quad2D, ($1f $1b $2b $2f)) dnl>
29 define(frontQuad, ($1f $2f $3f $4f)) dnl>
30 define(backQuad, ($4b $3b $2b $1b)) dnl>
32 dnl> </STANDARD DEFINTIONS>
33 dnl> -----------------------------------------------------------------
35 define(ncells, 20) dnl>
36 define(ninlet, 15) dnl>
37 define(nporo, 20) dnl>
38 define(noutlet, 20) dnl>
43 define(Cos,0.7071067812) dnl> == cos(45)
44 define(Sin,0.7071067812) dnl> == sin(45)
47 define(zBack,calc(-width/2)) dnl>
48 define(zFront,calc(width/2)) dnl>
49 define(leninlet,150)dnl>
50 define(lenporo,100)dnl>
51 define(lenoutlet,100)dnl>
53 define(xhyp,calc(Sin*width)) dnl>
54 define(yhyp,calc(Cos*width)) dnl>
55 define(xinlet,leninlet)dnl>
56 define(xporo,calc(Cos*lenporo)) dnl>
57 define(yporo,calc(Sin*lenporo)) dnl>
58 define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl>
59 define(youtlet,calc(yporo + Sin*lenoutlet)) dnl>
62 convertToMeters 0.001;
67 ( -xinlet y0 zBack ) vlabel(in1b)
68 ( -xinlet yhyp zBack ) vlabel(in2b)
69 ( -xinlet y0 zFront ) vlabel(in1f)
70 ( -xinlet yhyp zFront ) vlabel(in2f)
73 ( x0 y0 zBack ) vlabel(join1b)
74 ( -xhyp yhyp zBack ) vlabel(join2b)
75 ( x0 y0 zFront ) vlabel(join1f)
76 ( -xhyp yhyp zFront ) vlabel(join2f)
78 // porosity ends ->outlet
79 ( xporo yporo zBack ) vlabel(poro1b)
80 ( calc(xporo - xhyp) calc(yporo + yhyp) zBack ) vlabel(poro2b)
81 ( xporo yporo zFront ) vlabel(poro1f)
82 ( calc(xporo - xhyp) calc(yporo + yhyp) zFront ) vlabel(poro2f)
85 ( xoutlet youtlet zBack ) vlabel(out1b)
86 ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zBack ) vlabel(out2b)
87 ( xoutlet youtlet zFront ) vlabel(out1f)
88 ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zFront ) vlabel(out2f)
94 hex2D(in1, join1, join2, in2)
95 inlet ( ninlet ncells ncells ) simpleGrading (1 1 1)
98 hex2D(join1, poro1, poro2, join2)
99 porosity ( nporo ncells ncells ) simpleGrading (1 1 1)
102 hex2D(poro1, out1, out2, poro2)
103 outlet ( noutlet ncells ncells ) simpleGrading (1 1 1)
112 // is there no way of defining all my 'defaultFaces' to be 'wall'?
116 frontQuad(in1, join1, join2, in2)
118 frontQuad(poro1, out1, out2, poro2)
124 backQuad(in1, join1, join2, in2)
126 backQuad(poro1, out1, out2, poro2)
142 frontQuad(join1, poro1, poro2, join2)
144 backQuad(join1, poro1, poro2, join2)
165 // ************************************************************************* //