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

castellatedMesh true;

snap            true;

addLayers       true;

singleRegionName true;

geometry
{
    stlName.stl
    {
        type            triSurfaceMesh;
        name            duct;
        regions
        {
            fixedWalls
            {
                name            fixedWalls;
            }
            symmetry
            {
                name            symmetry;
            }
            outlet1
            {
                name            outlet1;
            }
            outlet2
            {
                name            outlet2;
            }
            inlet
            {
                name            inlet;
            }
            topOPatch
            {
                name            topOPatch;
            }
        }
    }
}

castellatedMeshControls
{
    maxLocalCells   100000;
    maxGlobalCells  2000000;
    minRefinementCells 100;
    maxLoadUnbalance 0.2;
    nCellsBetweenLevels 2;
    features        ( { file stlName.eMesh ; level 2 ; } );
    refinementSurfaces
    {
        duct
        {
            level           ( 2 2 );
            patchInfo
            {
                type            patch;
            }
            regions
            {
                "topOPatch|fixedWalls"
                {
                    level           ( 2 2 );
                    patchInfo
                    {
                        type            wall;
                        inGroups        ( ductWalls );
                    }
                }
                symmetry
                {
                    level           ( 1 1 );
                    patchInfo
                    {
                        type            symmetry;
                    }
                }
            }
        }
    }
    resolveFeatureAngle 30;
    refinementRegions
    {
    }
    allowFreeStandingZoneFaces true;
    locationInMesh  myLocationInMesh;
}

snapControls
{
    nSmoothPatch    3;
    tolerance       2;
    nSolveIter      30;
    nRelaxIter      5;
    nFeatureSnapIter 10;
    implicitFeatureSnap false;
    explicitFeatureSnap true;
    multiRegionFeatureSnap false;
}

addLayersControls
{
    relativeSizes   true;
    layers
    {
        "topOPatch|fixedWalls"
        {
            nSurfaceLayers  2;
        }
    }
    expansionRatio  1;
    finalLayerThickness 0.3;
    minThickness    0.1;
    nGrow           0;
    featureAngle    60;
    slipFeatureAngle 30;
    nRelaxIter      3;
    nSmoothSurfaceNormals 1;
    nSmoothNormals  3;
    nSmoothThickness 10;
    maxFaceThicknessRatio 0.5;
    maxThicknessToMedialRatio 0.3;
    minMedialAxisAngle 90;
    nBufferCellsNoExtrude 0;
    nLayerIter      50;
}

meshQualityControls
{
    maxNonOrtho     65;
    maxBoundarySkewness 20;
    maxInternalSkewness 4;
    maxConcave      80;
    minVol          1e-13;
    minTetQuality   1e-15;
    minArea         -1;
    minTwist        0.02;
    minDeterminant  0.001;
    minFaceWeight   0.02;
    minVolRatio     0.01;
    minTriangleTwist -1;
    nSmoothScale    4;
    errorReduction  0.75;
}

writeFlags      ( scalarLevels layerSets layerFields );

mergeTolerance  1e-06;


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