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

convertToMeters 0.001;

// Mesh resolution parameters
innerResX 28;
innerResY 28;
innerResZ 200;
outerResX 28;
outerResY 5;
outerResZ 200;

// Grading parameters
gradX 1;
gradY 1;
gradZ 1;

vertices
(
    (42 0 0)    // 0
    (0 0 42)    // 1
    (-42 0 0)   // 2
    (0 0 -42)   // 3
    (48 0 0)    // 4
    (0 0 48)    // 5
    (-48 0 0)   // 6
    (0 0 -48)   // 7
    (42 600 0)  // 8
    (0 600 42)  // 9
    (-42 600 0) // 10
    (0 600 -42) // 11
    (48 600 0)  // 12
    (0 600 48)  // 13
    (-48 600 0) // 14
    (0 600 -48) // 15
);

edges
(
	// Inner arcs (radius = 42mm)
	arc 0 1 (25.45584412 0 25.45584412)
	arc 1 2 (-25.45584412 0 25.45584412)
	arc 2 3 (-25.45584412 0 -25.45584412)
	arc 3 0 (25.45584412 0 -25.45584412)
	arc 8 9 (25.45584412 600 25.45584412)
	arc 9 10 (-25.45584412 600 25.45584412)
	arc 10 11 (-25.45584412 600 -25.45584412)
	arc 11 8 (25.45584412 600 -25.45584412)
	    // Outer arcs (radius = 48mm)
	arc 4 5 (33.9411255 0 33.9411255)
	arc 5 6 (-33.9411255 0 33.9411255)
	arc 6 7 (-33.9411255 0 -33.9411255)
	arc 7 4 (33.9411255 0 -33.9411255)
	arc 12 13 (33.9411255 600 33.9411255)
	arc 13 14 (-33.9411255 600 33.9411255)
	arc 14 15 (-33.9411255 600 -33.9411255)
	arc 15 12 (33.9411255 600 -33.9411255)
);

blocks
(
    // Inner cylinder (must be ordered clockwise when looking from inside)
    hex (3 2 1 0 11 10 9 8) ($innerResX $innerResY $innerResZ) 
    simpleGrading ($gradX $gradY $gradZ)
    
    // Outer blocks (ordered to match inner cylinder)
    hex (0 1 5 4 8 9 13 12) ($outerResX $outerResY $outerResZ) 
    simpleGrading ($gradX $gradY $gradZ)
    
    hex (1 2 6 5 9 10 14 13) ($outerResX $outerResY $outerResZ) 
    simpleGrading ($gradX $gradY $gradZ)
    
    hex (2 3 7 6 10 11 15 14) ($outerResX $outerResY $outerResZ) 
    simpleGrading ($gradX $gradY $gradZ)
    
    hex (3 0 4 7 11 8 12 15) ($outerResX $outerResY $outerResZ) 
    simpleGrading ($gradX $gradY $gradZ)
);

boundary
(
    inlet
    {
        type patch;
        faces
        (
            (3 2 1 0)
            (0 1 5 4)
            (1 2 6 5)
            (2 3 7 6)
            (3 0 4 7)
        );
    }
    
    outlet
    {
        type patch;
        faces
        (
            (11 10 9 8)
            (8 9 13 12)
            (9 10 14 13)
            (10 11 15 14)
            (11 8 12 15)
        );
    }
    
    casing
    {
        type wall;
        faces
        (
            (4 5 13 12)
            (5 6 14 13)
            (6 7 15 14)
            (7 4 12 15)
        );
    }
);

mergePatchPairs
(
);
