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

// Creating a 2D axi mesh for a cylinder

convertToMeters 0.001; // convert millimeters in meters

// Cylinder properties
radius 5; //  radius 5 mm
l_inlet 100; // inlet length 100 mm
//l_porous 15; // porous material length 15 mm
//l_outlet 30; // inlet length 100 mm
alphaDeg 2.5; // half angle of the wedge in degrees

alpha    	#calc "degToRad($alphaDeg)";
s               #calc "$radius*sin($alpha)";
s_neg		#calc "-1.0*$s";
c               #calc "$radius*cos($alpha)";


vertices
(
    (0 0 0) // 0
    ($l_inlet 0 0) // 1
    ($l_inlet $c $s_neg) // 2
    (0 $c $s_neg) // 3

    (0 0 0) // 4
    ($l_inlet 0 0) // 5
    ($l_inlet $c $s)// 6
    (0 $c $s) // 7



);

blocks
(
    // hex (0 1 2 3 4 5 6 7) tube (400 20 1) simpleGrading (1 1 1) // 0
    hex (0 1 2 3 4 5 6 7) tube (1000 40 1) simpleGrading (1 1 1) // 0, collapsed 7->3, 4-> 0

);

edges
(
);

patches
(
    wall tube_top
    (
        (3 7 6 2)
    )

    wall tube_inlet
    (
        (0 7 3 4)
    )




    wall tube_outlet
    (
        (1 2 6 5)
    )

    wedge tubewedge_pos
    (
        (4 5 6 7)
    )




    wedge tubewedge_neg
    (
        (0 3 2 1)
    )



    empty center
    (
        (0 5 4 1)
    )


);

mergePatchPairs
(
);

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