FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

x0 0.;
x1 0.5;
x2 0.57;
x3 1.8;

y0 0.;
y1 0.35;
y2 0.6;

z0 -0.6;
z1 -0.3;
z2 0.3;
z3 0.6;

vertices
(
// Left z-layer
    ($x0 $y0 $z0 )         // 0
    ($x1 $y0 $z0 )         // 1
    ($x2 $y0 $z0 )         // 2
    ($x3 $y0 $z0 )         // 3
    ($x0 $y1 $z0 )         // 4
    ($x1 $y1 $z0 )         // 5
    ($x2 $y1 $z0 )         // 6
    ($x3 $y1 $z0 )         // 7
    ($x0 $y2 $z0 )         // 8
    ($x1 $y2 $z0 )         // 9
    ($x2 $y2 $z0 )         // 10
    ($x3 $y2 $z0 )         // 11

// Beginning flap
    ($x0 $y0 $z1 )         // 12
    ($x1 $y0 $z1 )         // 13
    ($x2 $y0 $z1 )         // 14
    ($x3 $y0 $z1 )         // 15
    ($x0 $y1 $z1 )         // 16
    ($x1 $y1 $z1 )         // 17
    ($x2 $y1 $z1 )         // 18
    ($x3 $y1 $z1 )         // 19
    ($x0 $y2 $z1 )         // 20
    ($x1 $y2 $z1 )         // 21
    ($x2 $y2 $z1 )         // 22
    ($x3 $y2 $z1 )         // 23

// End flap
    ($x0 $y0 $z2 )         // 24
    ($x1 $y0 $z2 )         // 25
    ($x2 $y0 $z2 )         // 26
    ($x3 $y0 $z2 )         // 27
    ($x0 $y1 $z2 )         // 28
    ($x1 $y1 $z2 )         // 29
    ($x2 $y1 $z2 )         // 30
    ($x3 $y1 $z2 )         // 31
    ($x0 $y2 $z2 )         // 32
    ($x1 $y2 $z2 )         // 33
    ($x2 $y2 $z2 )         // 34
    ($x3 $y2 $z2 )         // 35

// End domain
    ($x0 $y0 $z3 )         // 36
    ($x1 $y0 $z3 )         // 37
    ($x2 $y0 $z3 )         // 38
    ($x3 $y0 $z3 )         // 39
    ($x0 $y1 $z3 )         // 40
    ($x1 $y1 $z3 )         // 41
    ($x2 $y1 $z3 )         // 42
    ($x3 $y1 $z3 )         // 43
    ($x0 $y2 $z3 )         // 44
    ($x1 $y2 $z3 )         // 45
    ($x2 $y2 $z3 )         // 46
    ($x3 $y2 $z3 )         // 47


);

// x direction
h1 16;
h2 4;
h3 40;

// x grading
hx1 0.3;
hx3 4;

// y direction
v1 17;
v2 13;

// y grading
vy1 1;
vy2 1;

// z direction
w1 15;
w2 30;
w3 15;


blocks
(
// Left z-layer

  // Bottom y layer
    hex (   0   1   5   4   12  13  17  16  )
    ($h1 $v1 $w1 )
    simpleGrading ($hx1 $vy1 1)

    hex (   1   2   6   5   13  14  18  17  )
    ($h2 $v1 $w1)
    simpleGrading (1 $vy1 1)

    hex (   2   3   7   6   14  15  19  18  )
    ($h3 $v1 $w1)
    simpleGrading ($hx3 $vy1 1)

  // top y layer
    hex (   4   5   9   8   16  17  21  20  )
    ($h1 $v2 $w1)
    simpleGrading ($hx1 $vy2 1)

    hex (   5   6   10  9   17  18  22  21  )
    ($h2 $v2 $w1)
    simpleGrading (1 $vy2 1)

    hex (   6   7   11  10  18  19  23  22  )
    ($h3 $v2 $w1)
    simpleGrading ($hx3 $vy2 1)

// Middle z-layer

  // Bottom y layer
    hex (   12   13   17   16   24  25  29  28  )
    ($h1 $v1 $w2 )
    simpleGrading ($hx1 $vy1 1)

    hex (   14   15   19   18   26  27  31  30  )
    ($h3 $v1 $w2)
    simpleGrading ($hx3 $vy1 1)

  // top y layer
    hex (   16   17   21   20   28  29  33  32  )
    ($h1 $v2 $w2)
    simpleGrading ($hx1 $vy2 1)

    hex (   17   18   22   21   29  30  34  33  )
    ($h2 $v2 $w2)
    simpleGrading (1 $vy2 1)

    hex (   18   19   23   22   30  31  35  34  )
    ($h3 $v2 $w2)
    simpleGrading ($hx3 $vy2 1)

// End z-layer

  // Bottom y layer
    hex (   24   25   29   28   36  37  41  40  )
    ($h1 $v1 $w3 )
    simpleGrading ($hx1 $vy1 1)

    hex (   25   26   30   29   37  38  42  41  )
    ($h2 $v1 $w3)
    simpleGrading (1 $vy1 1)

    hex (   26   27   31   30   38  39  43  42  )
    ($h3 $v1 $w3)
    simpleGrading ($hx3 $vy1 1)

  // top y layer
    hex (   28   29   33   32   40  41  45  44  )
    ($h1 $v2 $w3)
    simpleGrading ($hx1 $vy2 1)

    hex (   29   30   34   33   41  42  46  45  )
    ($h2 $v2 $w3)
    simpleGrading (1 $vy2 1)

    hex (   30   31   35   34   42  43  47  46  )
    ($h3 $v2 $w3)
    simpleGrading ($hx3 $vy2 1)
);

edges
(
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
          (  0   4   16  12  )
          (  4   8   20  16  )
          (  12  16  28  24  )
          (  16  20  32  28  )
          (  24  28  40  36  )
          (  28  32  44  40  )
        );
    }
    outlet
    {
        type patch;
        faces
        (
          (   3   7   19  15  )
          (   7   11  23  19  )
          (   15  19  31  27  )
          (   19  23  35  31  )
          (   27  31  43  39  )
          (   31  35  47  43  )
        );
    }
    flap
    {
        type wall;
        faces
        (
            (   13  17  29  25  )
            (   17  18  30  29  )
            (   18  14  26  30  )
            (   13  17  18  14  )
            (   25  29  30  26  )
        );
    }
    upperWall
    {
        type wall;
        faces
        (
            (   8   9   21  20  )
            (   9   10  22  21  )
            (   10  11  23  22  )

            (   20  21  33  32  )
            (   21  22  34  33  )
            (   22  23  35  34  )

            (   32  33  45  44  )
            (   33  34  46  45  )
            (   34  35  47  46  )
        );
    }
    lowerWall
    {
        type wall;
        faces
        (
          (   0   1   13  12  )
          (   1   2   14  13  )
          (   2   3   15  14  )

          (   12  13  25  24  )
          (   14  15  27  26  )

          (   24  25  37  36  )
          (   25  26  38  37  )
          (   26  27  39  38  )
        );
    }
    frontAndBack
    {
        type wall;
        faces
        (
            (   0   1   5   4   )
            (   1   5   6   2   )
            (   2   3   7   6   )
            (   4   5   9   8   )
            (   5   6   10  9   )
            (   6   7   11  10  )

            (   36  37  41  40  )
            (   37  41  42  38  )
            (   38  39  43  42  )
            (   40  41  45  44  )
            (   41  42  46  45  )
            (   42  43  47  46  )
        );
    }
);

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