1 /*--------------------------------*- C++ -*----------------------------------*\
3 | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
4 | \\ / O peration | Version: 2.0.0 |
5 | \\ / A nd | Web: www.OpenFOAM.com |
6 | \\/ M anipulation | |
7 \*---------------------------------------------------------------------------*/
15 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
18 changecom(//)changequote([,]) dnl>
19 define(calc, [esyscmd(perl -e 'use Math::Trig; print ($1)')]) dnl>
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
33 define(l, 1.0) // 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, 1) // 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 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
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
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))
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
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)
101 hex2D(llcb, rlcb, rlc, llc)
103 simpleGrading (1 1 1)
106 hex2D(llc, rlc, ruc, luc)
108 simpleGrading (1 1 1)
111 hex2D(luc, ruc, ruct, luct)
113 simpleGrading (1 1 1)
132 frontQuad(llcb, rlcb, rlc, llc)
133 frontQuad(llc, rlc, ruc, luc)
134 frontQuad(luc, ruc, ruct, luct)
139 backQuad(llcb, rlcb, rlc, llc)
140 backQuad(llc, rlc, ruc, luc)
141 backQuad(luc, ruc, ruct, luct)
145 // ************************************************************************* //