/*--------------------------------*- C++ -*----------------------------------*\
|                                                                             |
|                Generated by the CfdOF workbench for FreeCAD                 |
|                      https://github.com/jaheyns/CfdOF                       |
|                                                                             |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     4.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

castellatedMesh true;
snap            true;
addLayers       true;

geometry
{
    "Cut_Geometry.stl"
    {
        type triSurfaceMesh;
        name Cut_Geometry;
        file "Cut_Geometry.stl";
        regions
        {
            patch_0_0
            {
                name patch_0_0;
            }

            patch_1_1
            {
                name patch_1_1;
            }

            patch_2_0
            {
                name patch_2_0;
            }

            patch_3_0
            {
                name patch_3_0;
            }

        }
    }

    "MeshRefinement.stl"
    {
        type triSurfaceMesh;
        name MeshRefinement;
        file "MeshRefinement.stl";
    }

};

castellatedMeshControls
{
    maxLocalCells 100000000;
    maxGlobalCells 2000000000;
    minRefinementCells 0;
    nCellsBetweenLevels 3;
    maxLoadUnbalance 0.20;

    features
    (
        {
            file "Cut_Geometry.eMesh";
            level 0;
        }
        {
            file "MeshRefinement.eMesh";
            level 0;
        }

    );

    refinementSurfaces
    {
        Cut_Geometry
        {
            level (0 0);
        }

        MeshRefinement
        {
            level (2 2);
            faceZone MeshRefinement;
        }

    }

    resolveFeatureAngle 30;

    refinementRegions
    {
    }

    locationInMesh (0.0 0.0 -0.005);
    allowFreeStandingZoneFaces true;
}

snapControls
{
    nSmoothPatch 3;
    tolerance 1.0;
    nSolveIter 100;
    nRelaxIter 5;
    nFeatureSnapIter 10;

    implicitFeatureSnap false;
    explicitFeatureSnap true;
}

addLayersControls
{
    relativeSizes true;
    layers
    {
        "patch_1_1"
        {
            nSurfaceLayers 2;
            expansionRatio 1.4;
        }
    }

    expansionRatio 1.2;
    finalLayerThickness 0.3;
    minThickness 0.1;
    nGrow 0;
    featureAngle 120;
    nRelaxIter 3;
    nSmoothSurfaceNormals 1;
    nSmoothNormals 3;
    nSmoothThickness 10;
    maxFaceThicknessRatio 0.5;
    maxThicknessToMedialRatio 0.3;
    minMedialAxisAngle 90;
    minMedianAxisAngle 90;
    nBufferCellsNoExtrude 0;
    nLayerIter 50;
}

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;
    relaxed
    {
        maxNonOrtho 75;
    }
}

mergeTolerance 1e-6;

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