/*--------------------------------*- C++ -*----------------------------------*\
  ==  == ====== ====   ====    |
                    \\     ||  | Multiphase Cases Repository by HZDR
  ======   //   ||  || ===//   | Website: https://doi.org/10.14278/rodare.811
  ||  ||  //    ||  // || \\   | License: Creative Commons Attribution 4.0
  ==  == ====== ====   ==  ==  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

xmin    -50;
xmax    250;

ymin    -100;

z0      -150;
z1      -30;
z2      5.64;
z3      7.32;

Nx      8;

Ny      4;

Nz1     13.0;
Nz2     20.0;
Nz3     3.0;

Nz      #calc "$Nz1 + $Nz2 + $Nz3";

PercLz1 #calc "($z1 - $z0)/($z3 - $z0)";
PercLz2 #calc "($z2 - $z1)/($z3 - $z0)";
PercLz3 #calc "($z3 - $z2)/($z3 - $z0)";

PercNz1 #calc "$Nz1 / $Nz";
PercNz2 #calc "$Nz2 / $Nz";
PercNz3 #calc "$Nz3 / $Nz";

vertices
(
    ($xmin $ymin $z0)   // 0
    ($xmax $ymin $z0)   // 1
    ($xmax     0 $z0)   // 2
    ($xmin     0 $z0)   // 3

    ($xmin $ymin $z3)   // 4
    ($xmax $ymin $z3)   // 5
    ($xmax     0 $z3)   // 6
    ($xmin     0 $z3)   // 7
);

blocks
(
    hex (0 1 2 3 4 5 6 7) ($Nx $Ny $Nz)
    simpleGrading
    (
        1
        1
        (
            ($PercLz1 $PercNz1 0.2)
            ($PercLz2 $PercNz2 0.2)
            ($PercLz3 $PercNz3 1  )
        )
    )
);

boundary
(
    atmosphere
    {
        type patch;
        faces
        (
            (4 5 6 7)
        );
    }

    inlet
    {
        type patch;
        faces
        (
            (1 2 6 5)
        );
    }

    outlet
    {
        type patch;
        faces
        (
            (0 4 7 3)
        );
    }

    bottom
    {
        type symmetryPlane;
        faces
        (
            (0 3 2 1)
        );
    }

    side
    {
        type symmetryPlane;
        faces
        (
            (0 1 5 4)
        );
    }

    midPlane
    {
        type symmetryPlane;
        faces
        (
            (3 7 6 2)
        );
    }
);

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