/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2406                                 |
|   \\  /    A nd           |                                                 |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/

FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      snappyHexMeshDict;
}

castellatedMesh true;
snap            true;
addLayers       false;

geometry
{
    Front_face.stl
    {
        type triSurfaceMesh;
        name front;
    }

    Back_face.stl
    {
        type triSurfaceMesh;
        name back;
    }

    Inner_wall.stl
    {
        type triSurfaceMesh;
        name innerWall;
    }



    Inlet.stl
    {
        type triSurfaceMesh;
        name inlet;
    }

    Side_wall_1.stl
    {
        type triSurfaceMesh;
        name sideWall1;
    }

    Side_wall_2.stl
    {
        type triSurfaceMesh;
        name sideWall2;
    }
}

castellatedMeshControls
{
    maxLocalCells 100000;
    maxGlobalCells 2000000;
    minRefinementCells 3;
    maxLoadUnbalance 0.10;
    nCellsBetweenLevels 2;

    features ();

    refinementSurfaces
    {
        //front      { level (1 1); }
        //back       { level (1 1); }
        innerWall  { level (2 2); }
        //Overset_top  { level (2 2); }
        inlet      { level (1 2); }
        sideWall1  { level (1 2); }
        sideWall2  { level (1 2); }
    }

    resolveFeatureAngle 30;

    refinementRegions
    {
    }

    // Change if required after visual check
    locationInMesh (0 90 0);

    allowFreeStandingZoneFaces false;
}

snapControls
{
    nSmoothPatch 3;
    tolerance 2.0;
    nSolveIter 100;
    nRelaxIter 5;

    nFeatureSnapIter 10;
    implicitFeatureSnap true;
    explicitFeatureSnap false;
    multiRegionFeatureSnap true;
}

addLayersControls
{
    relativeSizes true;
    layers {}
}

meshQualityControls
{
    maxNonOrtho 65;
    maxBoundarySkewness 20;
    maxInternalSkewness 4;
    maxConcave 80;
    minVol 1e-13;
    minTetQuality -1;
    minArea -1;
    minTwist 0.01;
    minDeterminant 0.001;
    minFaceWeight 0.05;
    minVolRatio 0.01;
    minTriangleTwist -1;

    nSmoothScale 4;
    errorReduction 0.75;
}

mergeTolerance 1e-6;

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