/*--------------------------------*- C++ -*----------------------------------*\
  =========                 |
  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
   \\    /   O peration     | Website:  https://openfoam.org
    \\  /    A nd           | Version:  7
     \\/     M anipulation  |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      blockMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

convertToMeters 1;

cx 0; //origin x
cy 0; //origin y
cz 0; //origin z

r 0.00172; //radius of pipe (dia 3.44mm)
l 0.1; //length of pipe
a 4; //angle in degree

rada  #calc "degToRad($a)";
y1    #calc "$r*sin($rada)";
y2    #calc "-1*$y1";
z1    #calc "$r*cos($rada)";


vertices
(
    ($cx $cy $cz)      
    ($l $cy $cz)
    ($cx $y2 $z1)   
    ($l $y2 $z1)
    ($l $y1 $z1)     
    ($cx $y1 $z1)
);

blocks
(
    hex (0 1 1 0 2 3 4 5) (50 1 10) simpleGrading (1 1 0.2)
);

edges
(
    arc 2 5 ($cx $cy $r)
    arc 3 4 ($l $cy $r)
);


boundary
(
    inlet
    {
        type patch;
        faces
        (
            (5 2 0 0)
        );
    }
    outlet
    {
        type patch;
        faces
        (
            (3 4 1 1)
        );
    }
    top
    {
        type symmetryPlane;
        faces
        (
          (1 0 0 1)
        );
    }
    front
    {
        type wedge;
        faces
        (
            (2 3 1 0)
        );
    }

    back
    {
        type wedge;
        faces
        (
            (4 5 0 1)
        );
    }
   bottom
    {
        type wall;
        faces
        (
            (5 4 3 2)
        );
    }
);

mergePatchPairs
(
);

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