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

castellatedMesh true;
snap            true;
addLayers       false;

geometry
{
    bob
    {
        type triSurfaceMesh;
        file "Fann_bob.stl";
    }

    rotor
    {
    	type triSurfaceMesh;
	file "Fann_rotor.stl";
    }
}

castellatedMeshControls
{
    maxLocalCells   1000000;
    maxGlobalCells  20000000;
    minRefinementCells 0;
    maxLoadUnbalance 0.1;
    nCellsBetweenLevels 1;
    locationInMesh (0 0 -0.01);
    allowFreeStandingZoneFaces true;
    resolveFeatureAngle 30;

    features
    (
        {
            file "Fann_bob.eMesh";
            level 4;
        }

	{
	    file "Fann_rotor.eMesh";
	    level 4;
	}
    );


    refinementSurfaces
    {
        bob
        {
            level (2 4);
            patchInfo { type patch; }
        }

	rotor
	{
	    level (2 4);
	    patchInfo { type patch; }
	}
    }


    refinementRegions
    {
    }
}

snapControls
{
    nSmoothPatch    3;
    tolerance       1;
    nSolveIter      300;
    nRelaxIter      10;
    nFeatureSnapIter 10;
    implicitFeatureSnap false;
    explicitFeatureSnap true;
    multiRegionFeatureSnap false;
}

addLayersControls
{
    relativeSizes   true;
    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;
    minMedianAxisAngle 90;
    nBufferCellsNoExtrude 0;
    nLayerIter      50;

    layers
    {

    }
}

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

writeFlags      ( scalarLevels layerSets layerFields );

mergeTolerance  1e-06;

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

