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] Need help to improve my snappyHexMesh mesh (https://www.cfd-online.com/Forums/openfoam-meshing/142642-need-help-improve-my-snappyhexmesh-mesh.html)

aminem October 6, 2014 04:10

Need help to improve my snappyHexMesh mesh
 
5 Attachment(s)
Hi
I created mesh with snappyHexMesh but I have some
problem to have good mesh (see picture). Can anyone help me to ameliorate my mesh.
Code:

/*--------------------------------*- 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;
    location system;
    object snappyHexMeshDict;
}

    castellatedMesh true;
    snap true;
    addLayers true;
    geometry
    {
        cuve1.stl
        {
            type triSurfaceMesh;
            name cuve1;
        }

        cuve2.stl
        {
            type triSurfaceMesh;
            name cuve2;
        }

        cuve3.stl
        {
            type triSurfaceMesh;
            name cuve3;
        }

        P3.stl
        {
            type triSurfaceMesh;
            name P3;
        }

        P4.stl
        {
            type triSurfaceMesh;
            name P4;
        }

        shaft.stl
        {
            type triSurfaceMesh;
            name shaft;
        }

        P4MRF
        {
            type searchableCylinder;
            point1 ( 0.0 -0.0035 0.0 );
            point2 ( 0.0 0.0465 0.0 );
            radius 0.05;
        }

        P3MRF
        {
            type searchableCylinder;
            point1 ( 0.0 0.135 0.0 );
            point2 ( 0.0 0.185 0.0 );
            radius 0.05;
        }

    }

    castellatedMeshControls
    {
        features
        (
        );
        refinementSurfaces
        {
            cuve1
            {
                level ( 0 0 );
            }

            cuve2
            {
                level ( 0 0);
            }

            cuve3
            {
                level ( 0 0 );
            }

            P3
            {
                level ( 0 2 );
            }

            P4
            {
                level ( 0 2 );
            }

            shaft
            {
                level ( 0 2 );
            }

            P4MRF
            {
                faceType internal;
                faceZone MRFP4;
                cellZoneInside inside;
                cellZone MRFP4;
                level ( 0 0 );
            }

            P3MRF
            {
                faceType internal;
                faceZone MRFP3;
                cellZoneInside inside;
                cellZone MRFP3;
                level ( 0 0 );
            }

        }

        refinementRegions
        {
            P4MRF
            {
                mode inside;
                levels (( 1E5 2 ));
            }

            P3MRF
            {
                mode inside;
                levels (( 1E5 2 ));
            }

        }

        locationInMesh ( 0.0 0.0 0.05 );
        maxLocalCells 100000;
        maxGlobalCells 2000000;
        minRefinementCells 0;
        nCellsBetweenLevels 1;
        resolveFeatureAngle 30;
        allowFreeStandingZoneFaces true;
        planarAngle 30;
        maxLoadUnbalance 0.10;
    }

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

    addLayersControls
    {
        layers
        {
            cuve2
            {
                nSurfaceLayers 3;
            }

            cuve3
            {
                nSurfaceLayers 3;
            }

            P3
            {
                nSurfaceLayers 3;
            }

            P4
            {
                nSurfaceLayers 3;
            }

            shaft
            {
                nSurfaceLayers 3;
            }

        }

        relativeSizes true;
        expansionRatio 1.2;
        finalLayerThickness 0.3;
        minThickness 0.25;
        nGrow 0;
        featureAngle 130;
        slipFeatureAngle 30;
        nRelaxIter 5;
        nSmoothSurfaceNormals 1;
        nSmoothNormals 3;
        nSmoothThickness 10;
        maxFaceThicknessRatio 0.5;
        maxThicknessToMedialRatio 0.3;
        minMedianAxisAngle 90;
        nBufferCellsNoExtrude 0;
        nLayerIter 50;
        nRelaxedIter 20;
        writeVTK false;
        noErrors false;
        layerRecovery 1;
        growZoneLayers false;
        projectGrownUp 0.0;
    }

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

    debug 0;
    mergeTolerance 1E-6;
    autoBlockMesh true;

Thanks

aminem October 8, 2014 03:47

Any ideas???

wyldckat October 11, 2014 09:59

Greetings aminem,

You could have been a bit more specific regarding what exactly you want to improve. Either way, the one thing I say that needs work is related to this dictionary block:
Code:

        features
        (
        );

You're missing feature edges, therefore the edges are not snapped into place.

You can find a lot of reading material on this and other topics regarding snappyHexMesh, meshing strategies and visual diagnosis in this wiki page: http://openfoamwiki.net/index.php/SnappyHexMesh

Best regards,
Bruno


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