initial commit for version 1.6.x patch release
[OpenFOAM-1.6.x.git] / tutorials / multiphase / interDyMFoam / ras / sloshingTank3D / constant / polyMesh / blockMeshDict.m4
blob4060d827218afc9f062d6497beb2e5a68070624b
1 /*--------------------------------*- C++ -*----------------------------------*\
2 | =========                 |                                                 |
3 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
4 |  \\    /   O peration     | Version:  1.6                                   |
5 |   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
6 |    \\/     M anipulation  |                                                 |
7 \*---------------------------------------------------------------------------*/
8 FoamFile
10     version     2.0;
11     `format'      ascii;
12     class       dictionary;
13     object      blockMeshDict;
15 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
16 // General m4 macros
18 changecom(//)changequote([,]) dnl>
19 define(calc, [esyscmd(perl -e 'use Math::Trig; print ($1)')]) dnl>
20 define(VCOUNT, 0)
21 define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))])
23 define(hex2D, hex (b$1 b$2 b$3 b$4 f$1 f$2 f$3 f$4))
24 define(quad2D, (b$1 b$2 f$2 f$1))
25 define(frontQuad, (f$1 f$2 f$3 f$4))
26 define(backQuad, (b$1 b$4 b$3 b$2))
28 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
29 // User-defined parameters
31 convertToMeters 1;
33 define(l, 20)       // Length of tank (x-direction)
34 define(b, 40)       // Breadth of tank (y-direction)
35 define(h, 30)       // Depth of tank (z-direction)
37 define(hlc, 5)      // Depth to the top (height) of lower chamfer
38 define(huc, 10)     // Height of upper chamfer
40 define(thetalc, 45) // Angle of lower chamfer to the horizontal
41 define(thetauc, 45) // Angle of upper chamfer to the horizontal
43 define(CofGy, calc(b/2.0))  // Centre of gravity in y-direction
44 define(CofGz, 10.0)         // Centre of gravity in z-direction
46 define(Nl, 19)      // Number of cells in the length (1 for 2D)
47 define(Nb, 40)      // Number of cells in the breadth
48 define(Nhlc, 6)     // Number of cells in the height of the lower champfer
49 define(Nh, 16)      // Number of cells in the height between the chamfers
50 define(Nhuc, 12)    // Number of cells in the height of the upper champfer
52 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
53 // Derived parameters
55 define(blc, calc(hlc/tan(deg2rad(thetalc)))) // Breadth to the top (height) of lower chamfer
56 define(buc, calc(huc/tan(deg2rad(thetauc)))) // Breadth of upper chamfer
58 define(Yl, -CofGy)
59 define(Yllc, calc(Yl + blc))
60 define(Yluc, calc(Yl + buc))
62 define(Yr, calc(Yl + b))
63 define(Yrlc, calc(Yr - blc))
64 define(Yruc, calc(Yr - buc))
66 define(Zb, -CofGz)
67 define(Zlc, calc(Zb + hlc))
68 define(Zt, calc(Zb + h))
69 define(Zuc, calc(Zt - huc))
71 define(Xf, calc(l/2.0))
72 define(Xb, calc(Xf - l))
74 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
75 // Parametric description
77 vertices
79     (Xb Yllc Zb) vlabel(bllcb)
80     (Xb Yl Zlc)  vlabel(bllc)
81     (Xb Yl Zuc)  vlabel(bluc)
82     (Xb Yluc Zt) vlabel(bluct)
83     (Xb Yrlc Zb) vlabel(brlcb)
84     (Xb Yr Zlc)  vlabel(brlc)
85     (Xb Yr Zuc)  vlabel(bruc)
86     (Xb Yruc Zt) vlabel(bruct)
88     (Xf Yllc Zb) vlabel(fllcb)
89     (Xf Yl Zlc)  vlabel(fllc)
90     (Xf Yl Zuc)  vlabel(fluc)
91     (Xf Yluc Zt) vlabel(fluct)
92     (Xf Yrlc Zb) vlabel(frlcb)
93     (Xf Yr Zlc)  vlabel(frlc)
94     (Xf Yr Zuc)  vlabel(fruc)
95     (Xf Yruc Zt) vlabel(fruct)
98 blocks
100     // block0
101     hex2D(llcb, rlcb, rlc, llc)
102     (Nb Nhlc Nl)
103     simpleGrading (1 1 1)
105     // block1
106     hex2D(llc, rlc, ruc, luc)
107     (Nb Nh Nl)
108     simpleGrading (1 1 1)
110     // block2
111     hex2D(luc, ruc, ruct, luct)
112     (Nb Nhuc Nl)
113     simpleGrading (1 1 1)
116 patches
118     patch walls
119     (
120         quad2D(llcb, rlcb)
121         quad2D(rlcb, rlc)
122         quad2D(rlc, ruc)
123         quad2D(ruc, ruct)
124         quad2D(ruct, luct)
125         quad2D(luct, luc)
126         quad2D(luc, llc)
127         quad2D(llc, llcb)
128         frontQuad(llcb, rlcb, rlc, llc)
129         frontQuad(llc, rlc, ruc, luc)
130         frontQuad(luc, ruc, ruct, luct)
131         backQuad(llcb, rlcb, rlc, llc)
132         backQuad(llc, rlc, ruc, luc)
133         backQuad(luc, ruc, ruct, luct)
134     )
137 // ************************************************************************* //