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

scale   1;

H 1.0;

xout     #eval{ -$H*12 };
xin    #eval{ -$H*50 };
rad0    #eval{  $H/2 };;
rad1    #eval{  3*$H/2 };;
zmax    1;

nxin    200;
nxout   40;
nxbend  50;
ny      350;
nz      1;



zmin    #eval{ -$zmax };

vertices
(
    // back-plane:
    // outlet region
    (  $xout   $rad0  $zmin)     // pt 0
    (     0   $rad0  $zmin)     // pt 1
    (     0   $rad1  $zmin)     // pt 2
    (  $xout   $rad1  $zmin)     // pt 3
    // inlet region
    ( $xin  -$rad1  $zmin)     // pt 4
    (     0  -$rad1  $zmin)     // pt 5
    (     0  -$rad0  $zmin)     // pt 6
    ( $xin  -$rad0  $zmin)     // pt 7
    // bend mid-points
    ( $rad0       0  $zmin)     // pt 8
    ( $rad1       0  $zmin)     // pt 9
    // front-plane:
    // outlet region
    (  $xout   $rad0  $zmax)     // pt 0 + 10
    (     0   $rad0  $zmax)     // pt 1 + 10
    (     0   $rad1  $zmax)     // pt 2 + 10
    (  $xout   $rad1  $zmax)     // pt 3 + 10
    // inlet region
    ( $xin  -$rad1  $zmax)     // pt 4 + 10
    (     0  -$rad1  $zmax)     // pt 5 + 10
    (     0  -$rad0  $zmax)     // pt 6 + 10
    ( $xin  -$rad0  $zmax)     // pt 7 + 10
    // bend mid-points
    ( $rad0       0  $zmax)     // pt 8 + 10
    ( $rad1       0  $zmax)     // pt 9 + 10
);

blocks
(
    hex (0 1 2 3  10 11 12 13) outlet  ( $nxout   $ny $nz)  simpleGrading (0.05 
    (
       ( 0.5 0.5 1000 )
       ( 0.5 0.5 0.001)
    ) 
    
    1)
    hex (4 5 6 7  14 15 16 17) inlet   ( $nxin  $ny $nz)  simpleGrading (0.05     
    (
       ( 0.5 0.5 1000 )
       ( 0.5 0.5 0.001)
    )  
    
    1)
    hex (1 8 9 2  11 18 19 12) bend1  ( $nxbend $ny $nz)  simpleGrading (1     
    (
       ( 0.5 0.5 1000 )
       ( 0.5 0.5 0.001)
    )  
    
    1)
    hex (5 9 8 6  15 19 18 16) bend2  ( $nxbend $ny $nz)  simpleGrading (1    
    (
       ( 0.5 0.5 1000 )
       ( 0.5 0.5 0.001)
    ) 
    
    1)
);

edges
(
    // block 2
    arc  1  8  origin (0 0 $zmin)
    arc  2  9  origin (0 0 $zmin)
    arc 11 18  origin (0 0 $zmax)
    arc 12 19  origin (0 0 $zmax)
    // block 3
    arc  6  8  origin (0 0 $zmin)
    arc  5  9  origin (0 0 $zmin)
    arc 16 18  origin (0 0 $zmax)
    arc 15 19  origin (0 0 $zmax)
);

boundary
(
    outlet
    {
        type patch;
        faces
        (
            (0 10 13 3)
        );
    }

    inlet
    {
        type patch;
        faces
        (
            (4 14 17 7)
        );
    }
    frontAndBack
    {
        type empty;
        faces
        (
            (0 1 2 3)
            (4 5 6 7)
            (6 5 9 8)
            (8 9 2 1)
            (16 15 19 18)
            (18 19 12 11)
            (10 11 12 13)
            (14 15 16 17)
            
        );
    }
    
    innerWall4
    {
        type wall;
        faces
        (
          (0 1 10 11) 
        );
    }
    innerWall1
    {
        type wall;
        faces
        (
          (6 7 16 17)
        );
    }
    innerWall3
    {
        type wall;
        faces
        (
          (1 8 11 18)
        );
    }
    innerWall2
    {
        type wall;
        faces
        (
          (8 6 18 16)
        );
    }
    outerWall4
    {
        type wall;
        faces
        (
          (2 3 12 13)
        );
    }
    outerWall1
    {
        type wall;
        faces
        (
          (4 5 14 15)
        );
    }
    outerWall3
    {
        type wall;
        faces
        (
          (2 9 12 19)
        );
    }
    outerWall2
    {
        type wall;
        faces
        (
          (9 5 19 15)
        );
    }
    
);

mergePatchPairs
(
);




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