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

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

castellatedMesh true;
snap            true;
addLayers       false;


geometry
{
    fluidDomain.stl
    {
        type triSurfaceMesh;
        name fluidDomain;
    }
}


castellatedMeshControls
{
    maxLocalCells 1000000;
    maxGlobalCells 2000000;

    minRefinementCells 10;

    maxLoadUnbalance 0.10;

    nCellsBetweenLevels 3;


    features
    (
        {
            file "fluidDomain.eMesh";
            level 2;
        }
    );


    refinementSurfaces
    {
        fluidDomain
        {
            level (1 2);
        }
    };


    resolveFeatureAngle 30;


    refinementRegions
    {
    };


    locationInMesh (0.3 0.15 0.05);


    allowFreeStandingZoneFaces true;
}


snapControls
{
    nSmoothPatch 3;

    tolerance 2.0;

    nSolveIter 30;

    nRelaxIter 5;

    nFeatureSnapIter 10;

    implicitFeatureSnap false;

    explicitFeatureSnap true;

    multiRegionFeatureSnap false;
}



addLayersControls
{
    relativeSizes true;

    layers
    {
    }

    expansionRatio 1.0;
    finalLayerThickness 0.3;
    minThickness 0.1;

    nGrow 0;
    featureAngle 60;

    nRelaxIter 3;
    nSmoothSurfaceNormals 1;
    nSmoothNormals 3;
    nSmoothThickness 10;

    maxFaceThicknessRatio 0.5;
    maxThicknessToMedialRatio 0.3;

    minMedianAxisAngle 90;
    maxFaceThicknessRatio 0.5;

    nBufferCellsNoExtrude 0;
    nLayerIter 50;
    nRelaxedIter 20;
}



 meshQualityControls
{
    maxNonOrtho 65;

    maxBoundarySkewness 20;
    maxInternalSkewness 4;

    maxConcave 80;

    minFlatness 0.5;

    minVol 1e-13;

    minTetQuality 1e-9;

    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-6;
