CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] snappyHexMesh refinement issue (https://www.cfd-online.com/Forums/openfoam-meshing/221231-snappyhexmesh-refinement-issue.html)

najimaddin96 October 9, 2019 11:24

snappyHexMesh refinement issue
 
1 Attachment(s)
Hi everyone, I am using SHM to mesh an stl file I generated. After running snappy I dont get the meshing I expected.

As you see in the picture below some cells are coarser than the others. I want all of it to be same
Attachment 72654

My snappyHexMeshDict is as below:
Code:

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

// Which of the steps to run
castellatedMesh true;
snap            true;
addLayers      false;

geometry
{
    baffle03.stl
    {
        type triSurfaceMesh;
        name baffle;
    }
};


castellatedMeshControls
{
    maxLocalCells 300000;

    maxGlobalCells 5000000;

    minRefinementCells 0;

    maxLoadUnbalance 0.10;

    nCellsBetweenLevels 2;

    features
    (
        {
                file "baffle03.eMesh";
                level 5;
        }
    );

    refinementSurfaces
    {
        baffle
        {
            level (5 5);
            patchInfo
            {
                type wall;
            }
        }
    }

    resolveFeatureAngle 30;

    refinementRegions
    {
    }

    locationInMesh (0.001 -0.001 0.001);

    allowFreeStandingZoneFaces true;
}

snapControls
{

    nSmoothPatch 3;

    tolerance 2.0;

    nSolveIter 300;

    nRelaxIter 5;

        nFeatureSnapIter 10;

        implicitFeatureSnap true;

        explicitFeatureSnap false;

        multiRegionFeatureSnap false;
}

addLayersControls
{

    relativeSizes true;

    layers
    {

    }

    expansionRatio 1.0;

    finalLayerThickness 0.5;

    minThickness 0.2;

    nGrow 0;

    featureAngle 30;

    slipFeatureAngle 30;

    nRelaxIter 5;

    nSmoothSurfaceNormals 1;

    nSmoothNormals 3;

    nSmoothThickness 10;

    maxFaceThicknessRatio 0.5;

    maxThicknessToMedialRatio 0.3;

    minMedianAxisAngle 90;

    nBufferCellsNoExtrude 0;

    nLayerIter 50;
}

meshQualityControls
{

    maxNonOrtho 65;

    maxBoundarySkewness 20;

    maxInternalSkewness 4;

    maxConcave 80;

    minFlatness 0.5;

    minVol 1e-13;

    minTetQuality 1e-30;

    minArea -1;

    minTwist 0.02;

    minDeterminant 0.001;

    minFaceWeight 0.02;

    minVolRatio 0.01;

    minTriangleTwist -1;

    nSmoothScale 4;

    errorReduction 0.75;
}

writeFlags
(
    layerSets
);

mergeTolerance 1e-6;


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


rapoutin October 14, 2019 23:16

Hello,
Can you send the checkMesh result?
and the snappyHexMesh log files?
It may be due to maxGlobalCells or maxLocalCells

virengos October 15, 2019 03:58

The refinement and quality of the mesh and required wall resolution are strongly related to your simulation task and chosen model. Which physical problem do you want to simulate?
best,
Damian

Swift October 15, 2019 08:51

Hi,

To refine the entire region add:

Code:

     
baffle
        {
            mode        inside;
            levels      ((1E15 5));
        }


to refinementRegions assuming you haven't hit the maxGlobalCells and maxLocalCells limits mentioned by rapoutin.

Thomas

najimaddin96 November 9, 2019 12:34

Hi everyone, thanks so much for the replies and sorry for the late reply. @rapoufin, @virengos, @swift, I solved my problem by increasing nCellsbetweenLevels value to 9. The mesh got better, but my geometry had ~30million cells. For the same base mesh, I tried a different design, and surprisingly even with low nCellsbetweenLevels value, I get better mesh with less number of cells. Swift thank you for your recommendation, I will try it as soon as I will have to try new mesh. And by the way I @virengos, I am analyzing water flow inside a contact tank and use simpleFoam.

Best,

Nazhmiddin


All times are GMT -4. The time now is 12:13.