/*--------------------------------*- 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;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// User input

convertToMeters 1;

radius 0.015875;
length 1.01;
angle  1.0;

// Axis origin
x0 -0.41;
y0  0.0;
z0  0.0;

// Number of cells
radialCells 16;
axialCells  505;

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

// Derived parameters

zr  #calc "$z0 + ($radius*cos(degToRad($angle*0.5)))";
yp  #calc "$y0 + ($radius*sin(degToRad($angle*0.5)))";
ym  #calc "$y0 - ($radius*sin(degToRad($angle*0.5)))";
xl  #calc "$x0 + $length";

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

vertices
(
    ($x0 $y0 $z0) // pt 0
    ($xl $y0 $z0) // pt 1
    ($xl $y0 $z0) // pt 2
    ($x0 $y0 $z0) // pt 3
    ($x0 $ym $zr) // pt 4
    ($xl $ym $zr) // pt 5
    ($xl $yp $zr) // pt 6
    ($x0 $yp $zr) // pt 7
);

blocks
(
    hex (0 1 1 0 4 5 6 7) ($axialCells 1 $radialCells) simpleGrading (1 1 1)
);

boundary
(
    walls
    {
        type wall;
        faces
        (
            (0 4 7 0)
            (1 1 6 5)
            (4 5 6 7)
        );
    }
    front
    {
        type wedge;
        faces
        (
            (0 1 5 4)
        );
    }
    back
    {
        type wedge;
        faces
        (
            (0 7 6 1)
        );
    }
    axis
    {
        type empty;
        faces
        (
            (0 0 1 1)
        );
    }
);

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