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

// Include defaults parameters from master dictionary
#include "$WM_PROJECT_DIR/etc/caseDicts/foamyHexMeshDict"

geometry
{
    sphere_orient.stl
    {
        name sphere;
        type triSurfaceMesh;
    }

    cone_orient.stl
    {
        name cone;
        type triSurfaceMesh;
    }

    // Outside of domain
    domain
    {
        type searchableBox;
        min (-0.7 -0.9 -1);
        max (1.3 1.1 1);
    }

}


surfaceConformation
{
    locationInMesh (0 -0.5 0);

    featurePointControls
    {
        specialiseFeaturePoints off;
        edgeAiming              off;
        guardFeaturePoints      off;
        snapFeaturePoints       off;
        circulateEdges          off;
    }

    // Geometry to mesh to
    geometryToConformTo
    {
        cone
        {
            featureMethod   extractFeatures;
            includedAngle   140;

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

        sphere
        {
            featureMethod   none;

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

        domain
        {
            featureMethod   extractFeatures;
            includedAngle   100;
            mode            outside;
        }
    }

    additionalFeatures
    {
        coneSphereIntersection
        {
            featureMethod           extendedFeatureEdgeMesh;
            extendedFeatureEdgeMesh "cone_orient_sphere_orient_intersection.extendedFeatureEdgeMesh";
        }
    }
}


initialPoints
{
    initialPointsMethod         autoDensity;

    autoDensityCoeffs
    {
        minCellSizeLimit        0.1;
        minLevels               4;
        maxSizeRatio            5.0;
        sampleResolution        3;
        surfaceSampleResolution 3;
    }
}


motionControl
{
    defaultCellSize         0.1;

    minimumCellSizeCoeff    0;

    // For background cell size and alignment grid
    maxSmoothingIterations  100;

    maxRefinementIterations 0;

    shapeControlFunctions
    {
        sphere
        {
            type                        searchableSurfaceControl;
            priority                    2;
            mode                        inside;

            surfaceCellSizeFunction     uniformValue;
            uniformValueCoeffs
            {
                surfaceCellSizeCoeff    0.25;
            }

            cellSizeFunction            linearDistance;
            linearDistanceCoeffs
            {
                distanceCellSizeCoeff   1;
                distanceCoeff           2;
            }
        }

        cone
        {
            type                searchableSurfaceControl;
            priority            1;
            mode                bothSides;

            surfaceCellSizeFunction uniformValue;
            uniformValueCoeffs
            {
                surfaceCellSizeCoeff 1;
            }

            cellSizeFunction        uniform;
            uniformCoeffs
            {}
        }

        domain
        {
            type                searchableSurfaceControl;
            priority            1;
            mode                bothSides;

            surfaceCellSizeFunction uniformValue;
            uniformValueCoeffs
            {
                surfaceCellSizeCoeff 1;
            }

            cellSizeFunction        uniform;
            uniformCoeffs
            {}
        }
    }

    // Output lots and lots of .obj files
    objOutput                   no;

    // Timing and memory usage.
    timeChecks                  no;
}


// After simulation, when converting to polyMesh, filter out small faces/edges.
// Do not change. See cvControls.H
polyMeshFiltering
{
    filterEdges                 on;
    filterFaces                 on;
    writeTetDualMesh            false;
}


meshQualityControls
{
    #include "meshQualityDict"
}


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