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

castellatedMesh true;
snap            true;
addLayers       false;

geometry
{
    savonius.obj{ type triSurfaceMesh; name savonius;}
	AMI
    {
        type searchableCylinder;
        point1 (21.25 0 41);
        point2 (21.25 300 41);
        radius 100;
    }
refinementBox
    {
        type box;
        min  (-100   0 -100);
        max  ( 350 300  200);
    }
}
castellatedMeshControls
{
    maxLocalCells 100000;
    maxGlobalCells 3000000;
    minRefinementCells 10;
    maxLoadUnbalance 0.10;
    nCellsBetweenLevels 3;

    features
    (
        { file "savonius.eMesh"; level 4;} // Note: better: level 3
    );

    refinementSurfaces
    {
        AMI
        {
            level (3 3); // Note: better: levels 3 3
            faceType boundary;
            cellZone rotatingZone;
            faceZone rotatingZone;
            cellZoneInside inside;
        }
        savonius
        {
            level (3 4);

            patchInfo
            {
                type wall;
                inGroups (savonius);
            }
        }
    }

    resolveFeatureAngle 30;

    refinementRegions
    {
	    AMI
        {
            mode inside;
            levels ((1E15 2));
        }
		refinementBox
        {
            mode inside;
            levels ((1E15 2));
        }
    }

    locationInMesh (149 99 199);
    allowFreeStandingZoneFaces false;
}

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

addLayersControls
{
    relativeSizes true;

    layers
    {
	    savonius
        {
            nSurfaceLayers 3;
        }
    }

    expansionRatio 1.1;
    finalLayerThickness 0.2;
    minThickness 0.05;
    nGrow 0;
    featureAngle 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 -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;


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