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

R0 0.25;
R0_ -0.25;
Z0 0.00;
Z1 14;
Rx #calc "$R0*(0.7071067812)";
Rx_ #calc "$R0_*(0.7071067812)";
R1 0.4;
R1_ -0.4;
R2 1;
R2_ -1;
Ymin -2;
Ymax 6;
Xmax 7;
Xmax_ -7;
W1 0.15;
W1_ -0.15;
Rw #calc "$W1*(1.1316525)";
Rw_ #calc "$W1_*(1.1316525)";

wcd 12;

vertices
(
    (0 0 $Z0)		// vertex 0
    ($Rx $Rx $Z0)	// vertex 1
    ($Rx_ $Rx $Z0)	// vertex 2
    ($Rx_ $Rx_ $Z0)	// vertex 3
    ($Rx $Rx_ $Z0)	// vertex 4
    ($R2 $R2 $Z0)	// vertex 5
    ($R2_ $R2 $Z0)	// vertex 6
    ($R2_ $R2_ $Z0)	// vertex 7
    ($R2 $R2_ $Z0)	// vertex 8
    ($Rx $Rx $Z1)	// vertex 9
    ($Rx_ $Rx $Z1)	// vertex 10
    ($Rx_ $Rx_ $Z1)	// vertex 11
    ($Rx $Rx_ $Z1)	// vertex 12
    ($R2 $R2 $Z1)	// vertex 13
    ($R2_ $R2 $Z1)	// vertex 14
    ($R2_ $R2_ $Z1)	// vertex 15
    ($R2 $R2_ $Z1)	// vertex 16
    ($R1 $R1 $Z0)	//vertex 17
    ($R1_ $R1 $Z0)	//vertex 18
    ($R1_ $R1_ $Z0)	//vertex 19
    ($R1 $R1_ $Z0)	//vertex 20
    ($R1 $R1 $Z1)	//vertex 21
    ($R1_ $R1 $Z1)	//vertex 22
    ($R1_ $R1_ $Z1)	//vertex 23
    ($R1 $R1_ $Z1)	//vertex 24
    ($Xmax $R2_ $Z0)   // vertex 25
    ($Xmax $R2 $Z0)
    ($Xmax $Ymax $Z0)
    ($R2 $Ymax $Z0)
    ($R2_ $Ymax $Z0)
    ($Xmax_ $Ymax $Z0)
    ($Xmax_ $R2 $Z0)
    ($Xmax_ $R2_ $Z0)
    ($Xmax_ $Ymin $Z0)
    ($R2_ $Ymin $Z0)
    ($R2 $Ymin $Z0)
    ($Xmax $Ymin $Z0) // vertex 36
    ($Xmax $R2_ $Z1) // vertex 37
    ($Xmax $R2 $Z1)
    ($Xmax $Ymax $Z1)
    ($R2 $Ymax $Z1)
    ($R2_ $Ymax $Z1)
    ($Xmax_ $Ymax $Z1)
    ($Xmax_ $R2 $Z1)
    ($Xmax_ $R2_ $Z1)
    ($Xmax_ $Ymin $Z1)
    ($R2_ $Ymin $Z1)
    ($R2 $Ymin $Z1)
    ($Xmax $Ymin $Z1) //vertex 48
    ($W1 $W1 $Z0)
    ($W1_ $W1 $Z0)
    ($W1_ $W1_ $Z0)
    ($W1 $W1_ $Z0)
    ($W1 $W1 $Z1)
    ($W1_ $W1 $Z1)
    ($W1_ $W1_ $Z1)
    ($W1 $W1_ $Z1)
);

blocks
(
    hex (1 17 18 2 9 21 22 10) (11 $wcd 90) simpleGrading (3.5 1 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078)))	// w-f up ((6 33 0.3333)(2 20 1)(6 33 3))
    hex (2 18 19 3 10 22 23 11) (11 $wcd 90) simpleGrading (3.5 1 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078)))	// w-f right (-(6 33 0.3333)(2 20 1)(6 33 3))
    hex (3 19 20 4 11 23 24 12) (11 $wcd 90) simpleGrading (3.5 1 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078)))	// w-f - down (-(25 7 1.5)(30 14 0.25)(30 30 1)(30 14 4)(25 7 0.666667))
    hex (4 20 17 1 12 24 21 9) (11 $wcd 90) simpleGrading (3.5 1 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078)))	// w-f left (-(40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078))
    hex (17 5 6 18 21 13 14 22) (8 $wcd 90) simpleGrading (2.5 1 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078)))	// f-int up
    hex (18 6 7 19 22 14 15 23) (8 $wcd 90) simpleGrading (2.5 1 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078)))	// f-int left ((1 15 1.4231)(1 19 0.4127))
    hex (19 7 8 20 23 15 16 24) (8 $wcd 90) simpleGrading (2.5 1 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078)))	// f-int down ((1 19 2.4231)(1 19 0.7027))
    hex (20 8 5 17 24 16 13 21) (8 $wcd 90) simpleGrading (2.5 1 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078)))	// f-int right ((20 13 0.3855))
    hex (49 50 51 52 53 54 55 56) ($wcd $wcd 90) simpleGrading (1 1 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078))) // centre  w block
    hex (49 1 2 50 53 9 10 54) (3 $wcd 90) simpleGrading (1 1 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078))) // centre w block up
    hex (50 2 3 51 54 10 11 55) (3 $wcd 90) simpleGrading (1 1 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078))) // centre w block left
    hex (51 3 4 52 55 11 12 56) (3 $wcd 90) simpleGrading (1 1 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078))) // centre w block down
    hex (52 4 1 49 56 12 9 53) (3 $wcd 90) simpleGrading (1 1 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078))) // centre w block right
    hex (8 25 26 5 16 37 38 13) (34 $wcd 90) simpleGrading (((1 15 1.4231)(1 19 0.4127)) 1 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078))) // right -(-(22 8 1.95)(38 22 0.135))
    hex (5 26 27 28 13 38 39 40) (34 28 90) simpleGrading (((1 15 1.4231)(1 19 0.4127)) ((30 15 1.4231)(20 13 0.3855)) ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078))) // right-up 
    hex (6 5 28 29 14 13 40 41) ($wcd 28 90) simpleGrading (1 ((30 15 1.4231)(20 13 0.3855)) ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078))) // up
    hex (31 6 29 30 43 14 41 42) (34 28 90) simpleGrading (((1 19 2.4231)(1 19 0.7027)) ((30 15 1.4231)(20 13 0.3855)) ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078))) // left-up
    hex (32 7 6 31 44 15 14 43) (34 $wcd 90) simpleGrading (((1 19 2.4231)(1 19 0.7027)) 1 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078))) // left
    hex (33 34 7 32 45 46 15 44) (34 8 90) simpleGrading (((1 19 2.4231)(1 19 0.7027)) 1.85 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078))) // left-down
    hex (34 35 8 7 46 47 16 15) ($wcd 8 90) simpleGrading (1 1.85 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078))) // down
    hex (35 36 25 8 47 48 37 16) (34 8 90) simpleGrading (((1 15 1.4231)(1 19 0.4127)) 1.85 ((40 23 3.2489)(20 12 0.2716)(20 20 1)(20 12 3.682)(40 23 0.3078))) // right-down
    );

edges
(
    arc 1 2 (0 $R0 $Z0)	// edge 5
    arc 2 3 ($R0_ 0 $Z0)	// edge 6
    arc 3 4 (0 $R0_ $Z0)	// edge 7
    arc 4 1 ($R0 0 $Z0)	// edge 8


    arc 9 10 (0 $R0 $Z1)	// edge 13
    arc 10 11 ($R0_ 0 $Z1)	// edge 14
    arc 11 12 (0 $R0_ $Z1)	// edge 15
    arc 12 9 ($R0 0 $Z1)	// edge 16

    arc 17 18 (0 0.5 $Z0)  //edge 17
    arc 18 19 (-0.5 0 $Z0) //edge 18
    arc 19 20 (0 -0.5 $Z0) //edge 19
    arc 20 17 (0.5 0 $Z0) //edge 20

    arc 21 22 (0 0.5 $Z1)  //edge 21
    arc 22 23 (-0.5 0 $Z1) //edge 22
    arc 23 24 (0 -0.5 $Z1) //edge 23
    arc 24 21 (0.5 0 $Z1) //edge 24

    arc 49 50 (0 $Rw $Z0) //edge 25
    arc 50 51 ($Rw_ 0 $Z0) //edge 25
    arc 51 52 (0 $Rw_ $Z0) //edge 25
    arc 52 49 ($Rw 0 $Z0) //edge 25

    arc 53 54 (0 $Rw $Z1) //edge 25
    arc 54 55 ($Rw_ 0 $Z1) //edge 25
    arc 55 56 (0 $Rw_ $Z1) //edge 25
    arc 56 53 ($Rw 0 $Z1) //edge 25

    arc 5 6 (0 1.245 $Z0) //edge 25
    arc 6 7 (-1.245 0 $Z0) //edge 25
    arc 7 8 (0 -1.245 $Z0) //edge 25
    arc 8 5 (1.245 0 $Z0) //edge 25

    arc 13 14 (0 1.245 $Z1) //edge 25
    arc 14 15 (-1.245 0 $Z1) //edge 25
    arc 15 16 (0 -1.245 $Z1) //edge 25
    arc 16 13 (1.245 0 $Z1) //edge 25

);

boundary
(   
    outlet
    {
        type patch;
        faces
        (
            (27 28 40 39)   //upper surface
            (28 29 41 40)   //upper surface
            (29 30 42 41)   //upper surface
        );
    }

    fixedWalls
    {
        type wall;
        faces
        (
        (52 51 50 49) //w-mid back
        (49 50 2 1) //w-out back
        (50 51 3 2) //w-out back
        (51 52 4 3) //w-out back
        (52 49 1 4) //w-out back

        (53 54 55 56) //w-mid front
        (9 10 54 53) //w-out front
        (10 11 55 54) //w-out front
        (11 12 56 55) //w-out front
        (12 9 53 56) //w-out front
        
        (1 17 18 2) //w-f back
		(2 18 19 3) //w-f back
		(3 19 20 4) //w-f back
		(4 20 17 1) //w-f back
		(17 5 6 18) //f-int back
		(18 6 7 19) //f-int back
		(19 7 8 20) //f-int back
		(20 8 5 17) //f-int back

        (8 5 26 25) //f back
        (5 28 27 26) //f back
        (6 29 28 5) //f back
        (31 30 29 6) //f back
        (32 31 6 7) //f back
        (33 32 7 34) //f back
        (34 7 8 35) //f back
        (35 8 25 36) //f back
		
		(9 10 22 21) //w-f front
		(10 11 23 22) //w-f front
		(11 12 24 23) //w-f front
		(12 9 21 24) //w-f front
		(21 22 14 13) //f-int front
		(22 23 15 14) //f-int front
		(23 24 16 15) //f-int front
		(24 21 13 16) //f-int front

        (16 37 38 13) //f front
        (13 38 39 40) //f front
        (14 13 40 41) //f front
        (43 14 41 42) //f front
        (44 15 14 43) //f front
        (45 46 15 44) //f front
        (46 47 16 15) //f front
        (47 48 37 16) //f front   
            
            
        (36 25 37 48)   //right wall
        (26 27 39 38)   //right wall
        (25  26 38 37)  //right wall
        
        (33 45 44 32)   //left wall
        (32 44 43 31)   //left wall
        (31 43 42 30)   //left wall

        (36 48 47 35)   //bottom surface
        (35 47 46 34)   //bottom surface
        (34 46 45 33)   //bottom surface

        );
    }
    
);

mergePatchPairs
(
);

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