foamyHexMesh: Added cell sizing based on local surface closeness

First run the surfaceFeatureExtract with the "closeness" option enabled in the
surfaceFeatureExtractDict to extract the surface closeness point field

    // Out put the closeness of surface elements to other surface elements.
    closeness               yes;

Then enable cell sizing based on local surface closeness by specifying the
"internalCloseness" options in the foamyHexMeshDict e.g.

motionControl
{
    defaultCellSize             4;

    minimumCellSizeCoeff        0.1;
    maxSmoothingIterations      100;
    maxRefinementIterations     2;

    shapeControlFunctions
    {
        geometry
        {
            type                        searchableSurfaceControl;
            priority                    1;
            mode                        inside;

            surfaceCellSizeFunction     nonUniformField;

            cellSizeCalculationType     automatic;

            curvature                   false;
            curvatureFile               dummy;
            featureProximity            false;
            featureProximityFile        dummy;
            internalCloseness           true;
            internalClosenessFile       geometry.internalPointCloseness;
            internalClosenessCellSizeCoeff 25;
            curvatureCellSizeCoeff      0;
            maximumCellSizeCoeff        1;
            cellSizeFunction            uniform;
        }
    }
}
This commit is contained in:
Henry Weller
2018-01-14 12:05:38 +00:00
parent a5a034a1d2
commit 3e761d6a41
12 changed files with 1640 additions and 1280 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -115,6 +115,10 @@ Foam::automatic::automatic
featureProximityFile_(coeffsDict_.lookup("featureProximityFile")),
readInternalCloseness_(Switch(coeffsDict_.lookup("internalCloseness"))),
internalClosenessFile_(coeffsDict_.lookup("internalClosenessFile")),
internalClosenessCellSizeCoeff_
(
readScalar(coeffsDict_.lookup("internalClosenessCellSizeCoeff"))
),
curvatureCellSizeCoeff_
(
readScalar(coeffsDict_.lookup("curvatureCellSizeCoeff"))
@ -203,7 +207,7 @@ Foam::tmp<Foam::triSurfacePointScalarField> Foam::automatic::load()
Info<< indent
<< "Reading internal closeness: " << internalClosenessFile_ << endl;
triSurfaceScalarField internalCloseness
triSurfacePointScalarField internalClosenessPointField
(
IOobject
(
@ -219,17 +223,13 @@ Foam::tmp<Foam::triSurfacePointScalarField> Foam::automatic::load()
true
);
scalarField internalClosenessPointField
(
patchInterpolate.faceToPointInterpolate(internalCloseness)
);
forAll(pointCellSize, pI)
{
pointCellSize[pI] =
min
(
internalClosenessPointField[meshPointMap[pI]],
(1.0/internalClosenessCellSizeCoeff_)
*internalClosenessPointField[meshPointMap[pI]],
pointCellSize[pI]
);
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2018 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -74,6 +74,10 @@ private:
const Switch readInternalCloseness_;
const word internalClosenessFile_;
//- The internalCloseness values are multiplied by the inverse
// of this value to get the cell size
const scalar internalClosenessCellSizeCoeff_;
//- The curvature values are multiplied by the inverse of this value to
// get the cell size
const scalar curvatureCellSizeCoeff_;