/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.1.x | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object blockMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // convertToMeters 1; // # this blockMeshDict was generated by m4 define(H1, 0.10) // # enter heights (z coordinates) define(H2, 0.30) define(H3, 0.50) define(x1,0.085) // # enter x coordinates define(x2,0.115) define(x3,0.20) define(y1,0.0175) // # enter y coordinates define(y2,0.0325) define(y3,0.05) define(dx,0.005) // # enter discretization length define(dy,0.005) // # note: the mesh size is calculated using this values define(dz,0.005) // # due to truncation errors the final discretization length may differ // # relDiff: ($1 - $2) / $3 # decimal places truncated (done by format %.0f) define(relDiff,`format(`%.0f', esyscmd(echo "scale=2; a=$1-$2; a/$3" | bc))') define(sR,`eval($1+16)') define(tR,`eval($1+32)') // # calculate the mesh size define(N1x,`relDiff(x1,0,dx)') define(N2x,`relDiff(x2,x1,dx)') define(N3x,`relDiff(x3,x2,dx)') define(N1y,`relDiff(y1,0,dy)') define(N2y,`relDiff(y2,y1,dy)') define(N3y,`relDiff(y3,y2,dy)') define(N1z,`relDiff(H1,0,dz)') define(N2z,`relDiff(H2,H1,dz)') define(N3z,`relDiff(H3,H2,dz)') // # vertex coordinates were generated using pre-defined symbols vertices ( // first row - N1x (0 0 0) // 0 (x1 0 0) // 1 (x2 0 0) // 2 (x3 0 0) // 3 (0 y1 0) // 4 (x1 y1 0) // 5 (x2 y1 0) // 6 (x3 y1 0) // 7 (0 y2 0) // 8 (x1 y2 0) // 9 (x2 y2 0) // 10 (x3 y2 0) // 11 (0 y3 0) // 12 (x1 y3 0) // 13 (x2 y3 0) // 14 (x3 y3 0) // 15 // second row (0 0 H1) // 16 (x1 0 H1) // 17 (x2 0 H1) // 18 (x3 0 H1) // 19 (0 y1 H1) // 20 (x1 y1 H1) // 21 (x2 y1 H1) // 22 (x3 y1 H1) // 23 (0 y2 H1) // 24 (x1 y2 H1) // 25 (x2 y2 H1) // 26 (x3 y2 H1) // 27 (0 y3 H1) // 28 (x1 y3 H1) // 29 (x2 y3 H1) // 30 (x3 y3 H1) // 31 // third row (0 0 H2) // 32 (x1 0 H2) // 33 (x2 0 H2) // 34 (x3 0 H2) // 35 (0 y1 H2) // 36 (x1 y1 H2) // 37 (x2 y1 H2) // 38 (x3 y1 H2) // 39 (0 y2 H2) // 40 (x1 y2 H2) // 41 (x2 y2 H2) // 42 (x3 y2 H2) // 43 (0 y3 H2) // 44 (x1 y3 H2) // 45 (x2 y3 H2) // 46 (x3 y3 H2) // 47 // forth row (0 0 H3) // 48 (x1 0 H3) // 49 (x2 0 H3) // 50 (x3 0 H3) // 51 (0 y1 H3) // 52 (x1 y1 H3) // 53 (x2 y1 H3) // 54 (x3 y1 H3) // 55 (0 y2 H3) // 56 (x1 y2 H3) // 57 (x2 y2 H3) // 58 (x3 y2 H3) // 59 (0 y3 H3) // 60 (x1 y3 H3) // 61 (x2 y3 H3) // 62 (x3 y3 H3) // 63 ); // # mesh size was calculated blocks ( // first row hex (0 1 5 4 16 17 21 20) (N1x N1y N1z) simpleGrading (1 1 1) // 1 hex (1 2 6 5 17 18 22 21) (N2x N1y N1z) simpleGrading (1 1 1) // 2 hex (2 3 7 6 18 19 23 22) (N3x N1y N1z) simpleGrading (1 1 1) // 3 hex (4 5 9 8 20 21 25 24) (N1x N2y N1z) simpleGrading (1 1 1) // 4 hex (5 6 10 9 21 22 26 25) (N2x N2y N1z) simpleGrading (1 1 1) // 5 hex (6 7 11 10 22 23 27 26) (N3x N2y N1z) simpleGrading (1 1 1) // 6 hex (8 9 13 12 24 25 29 28) (N1x N3y N1z) simpleGrading (1 1 1) // 7 hex (9 10 14 13 25 26 30 29) (N2x N3y N1z) simpleGrading (1 1 1) // 8 hex (10 11 15 14 26 27 31 30) (N3x N3y N1z) simpleGrading (1 1 1) // 9 // second row hex (sR(0) sR(1) sR(5) sR(4) sR(16) sR(17) sR(21) sR(20)) (N1x N1y N2z) simpleGrading (1 1 1) // 10 hex (sR(1) sR(2) sR(6) sR(5) sR(17) sR(18) sR(22) sR(21)) (N2x N1y N2z) simpleGrading (1 1 1) // 11 hex (sR(2) sR(3) sR(7) sR(6) sR(18) sR(19) sR(23) sR(22)) (N3x N1y N2z) simpleGrading (1 1 1) // 12 hex (sR(4) sR(5) sR(9) sR(8) sR(20) sR(21) sR(25) sR(24)) (N1x N2y N2z) simpleGrading (1 1 1) // 13 hex (sR(5) sR(6) sR(10) sR(9) sR(21) sR(22) sR(26) sR(25)) (N2x N2y N2z) simpleGrading (1 1 1) // 14 hex (sR(6) sR(7) sR(11) sR(10) sR(22) sR(23) sR(27) sR(26)) (N3x N2y N2z) simpleGrading (1 1 1) // 15 hex (sR(8) sR(9) sR(13) sR(12) sR(24) sR(25) sR(29) sR(28)) (N1x N3y N2z) simpleGrading (1 1 1) // 16 hex (sR(9) sR(10) sR(14) sR(13) sR(25) sR(26) sR(30) sR(29)) (N2x N3y N2z) simpleGrading (1 1 1) // 17 hex (sR(10) sR(11) sR(15) sR(14) sR(26) sR(27) sR(31) sR(30)) (N3x N3y N2z) simpleGrading (1 1 1) // 18 // third row hex (tR(0) tR(1) tR(5) tR(4) tR(16) tR(17) tR(21) tR(20)) (N1x N1y N3z) simpleGrading (1 1 1) // 19 hex (tR(1) tR(2) tR(6) tR(5) tR(17) tR(18) tR(22) tR(21)) (N2x N1y N3z) simpleGrading (1 1 1) // 20 hex (tR(2) tR(3) tR(7) tR(6) tR(18) tR(19) tR(23) tR(22)) (N3x N1y N3z) simpleGrading (1 1 1) // 21 hex (tR(4) tR(5) tR(9) tR(8) tR(20) tR(21) tR(25) tR(24)) (N1x N2y N3z) simpleGrading (1 1 1) // 22 hex (tR(5) tR(6) tR(10) tR(9) tR(21) tR(22) tR(26) tR(25)) (N2x N2y N3z) simpleGrading (1 1 1) // 23 hex (tR(6) tR(7) tR(11) tR(10) tR(22) tR(23) tR(27) tR(26)) (N3x N2y N3z) simpleGrading (1 1 1) // 24 hex (tR(8) tR(9) tR(13) tR(12) tR(24) tR(25) tR(29) tR(28)) (N1x N3y N3z) simpleGrading (1 1 1) // 25 hex (tR(9) tR(10) tR(14) tR(13) tR(25) tR(26) tR(30) tR(29)) (N2x N3y N3z) simpleGrading (1 1 1) // 26 hex (tR(10) tR(11) tR(15) tR(14) tR(26) tR(27) tR(31) tR(30)) (N3x N3y N3z) simpleGrading (1 1 1) // 27 ); edges ( ); boundary ( inlet { type patch; faces ( (9 10 6 5) ); } outlet { type patch; faces ( (tR(16) tR(17) tR(21) tR(20)) (tR(17) tR(18) tR(22) tR(21)) (tR(18) tR(19) tR(23) tR(22)) (tR(20) tR(21) tR(25) tR(24)) (tR(21) tR(22) tR(26) tR(25)) (tR(22) tR(23) tR(27) tR(26)) (tR(24) tR(25) tR(29) tR(28)) (tR(25) tR(26) tR(30) tR(29)) (tR(26) tR(27) tR(31) tR(30)) ); } walls { type wall; faces ( // bottom (4 5 1 0) (5 6 2 1) (6 7 3 2) (8 9 5 4) (10 11 7 6) (12 13 9 8) (13 14 10 9) (14 15 11 10) // walls - first row (0 1 17 16) (1 2 18 17) (2 3 19 18) // (3 7 23 19) (7 11 27 23) (11 15 31 27) // (15 14 30 31) (14 13 29 30) (13 12 28 29) // (12 8 24 28) (8 4 20 24) (4 0 16 20) // walls - second row (sR(0) sR(1) sR(17) sR(16)) (sR(1) sR(2) sR(18) sR(17)) (sR(2) sR(3) sR(19) sR(18)) // (sR(3) sR(7) sR(23) sR(19)) (sR(7) sR(11) sR(27) sR(23)) (sR(11) sR(15) sR(31) sR(27)) // (sR(15) sR(14) sR(30) sR(31)) (sR(14) sR(13) sR(29) sR(30)) (sR(13) sR(12) sR(28) sR(29)) // (sR(12) sR(8) sR(24) sR(28)) (sR(8) sR(4) sR(20) sR(24)) (sR(4) sR(0) sR(16) sR(20)) // walls - third row (tR(0) tR(1) tR(17) tR(16)) (tR(1) tR(2) tR(18) tR(17)) (tR(2) tR(3) tR(19) tR(18)) // (tR(3) tR(7) tR(23) tR(19)) (tR(7) tR(11) tR(27) tR(23)) (tR(11) tR(15) tR(31) tR(27)) // (tR(15) tR(14) tR(30) tR(31)) (tR(14) tR(13) tR(29) tR(30)) (tR(13) tR(12) tR(28) tR(29)) // (tR(12) tR(8) tR(24) tR(28)) (tR(8) tR(4) tR(20) tR(24)) (tR(4) tR(0) tR(16) tR(20)) ); } ); mergePatchPairs ( ); // ************************************************************************* //