CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Native Meshers: snappyHexMesh and Others (http://www.cfd-online.com/Forums/openfoam-meshing-snappyhexmesh/)
-   -   snappyHexMesh, complex geometry (http://www.cfd-online.com/Forums/openfoam-meshing-snappyhexmesh/108081-snappyhexmesh-complex-geometry.html)

nakor October 14, 2012 11:47

snappyHexMesh, complex geometry
 
Hello,
since a few days I was using snappyHexMesh without any problem, but since I tried to switch to a more complex geometry it is not working anymore. I have an error when I use splitMeshRegion -cellZonesOnly.

My error is the following one :
Code:

--> FOAM FATAL ERROR:
Face 20096 fc:(-0.0031125 -0.0015 -0.027975) in zone solid1 is in patch air_out and in patch solid1

If I check in my geometry, this point should be inside of the cell zone Air_out.

I do not understand how a cell could be outside a cell zone since the air outside of the other solids is obtained by cutting all of the solid from a box which is of the domain of calculation size.
If I do not use the option cellZonesOnly, I something like 500 domains, which is not acceptable.

I use the Allrun from snappyMultiRegionHeater
Code:

runApplication blockMesh

runApplication surfaceFeatureExtract -includedAngle 150 constant/triSurface/Region1.stl Region1
mv log.surfaceFeatureExtract log.surfaceFeatureExtract.Region
runApplication surfaceFeatureExtract -includedAngle 150 constant/triSurface/Region2.stl Region2
mv log.surfaceFeatureExtract log.surfaceFeatureExtract.Region2
runApplication surfaceFeatureExtract -includedAngle 150 constant/triSurface/Region3.stl Region3
mv log.surfaceFeatureExtract log.surfaceFeatureExtract.Region3
runApplication surfaceFeatureExtract -includedAngle 150 constant/triSurface/Region4.stl Region4
mv log.surfaceFeatureExtract log.surfaceFeatureExtract.Region4


runApplication snappyHexMesh -overwrite
runApplication splitMeshRegions -cellZonesOnly -overwrite

and the following snappyHexMeshDict
Code:

FoamFile
{
    version 2.0;
    format ascii;
    class dictionary;
    location system;
    object snappyHexMeshDict;
}

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

        Region2.stl
        {
            type triSurfaceMesh;
            name Region2;
        }

        Region3.stl
        {
            type triSurfaceMesh;
            name Region3;
        }

        Region4.stl
        {
            type triSurfaceMesh;
            name Region4;
        }

       

    }

    castellatedMeshControls
    {
        features (
    {
            file "Region1.eMesh";
            level 1;
        }
        {
            file "Region2.eMesh";
            level 1;
        }
        {
            file "Region3.eMesh";
            level 1;
        }
        {
            file "Region4.eMesh";
            level 1;
        }
       
        {
            file "air_out.eMesh";
            level 1;
        }
);
        refinementSurfaces
        {
            Region1
            {
                cellZoneInside inside;
                cellZone Region1;
                level (3 3 );
                faceZone Region1;
            }
                air_out
            {
                cellZoneInside inside;
                cellZone air_out;
                level (1 1 );
                faceZone air_out;
            }

            Region2
            {
                level (3 3 );
                cellZoneInside inside;
                cellZone Region2;
                faceZone Region3;
            }

            Region3
            {
                level (3 3 );
                cellZoneInside inside;
                cellZone Region3;
                faceZone Region3;
            }

            Region4
            {
                cellZoneInside Region4;
                cellZone Region4;
                level (1 1 );
                faceZone Region4;
            }

         

        }

        refinementRegions
        {
        }

        locationInMesh (0 0 0);
        maxLocalCells 10000000;
        maxGlobalCells 20000000;
        minRefinementCells 1;
        nCellsBetweenLevels 2;
        resolveFeatureAngle 30;
        allowFreeStandingZoneFaces false;
    }

    snapControls
    {
        nSolveIter 30;
        nSmoothPatch 3;
        tolerance 4.0;
        nRelaxIter 5;
        nFeatureSnapIter 10;
    }

    addLayersControls
    {
        layers
        {
        }

        relativeSizes true;
        expansionRatio 1.0;
        finalLayerThickness 0.3;
        minThickness 0.2;
        nGrow 1;
        featureAngle 60;
        nRelaxIter 5;
        nSmoothSurfaceNormals 1;
        nSmoothNormals 3;
        nSmoothThickness 10;
        maxFaceThicknessRatio 0.5;
        maxThicknessToMedialRatio 0.3;
        minMedianAxisAngle 130;
        nBufferCellsNoExtrude 0;
        nLayerIter 50;
        nRelaxedIter 20;
    }

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

    debug 0;
    mergeTolerance 1E-6;

My resulting boundary file is the following one :
Quote:

ffminx
{
type patch;
nFaces 10000;
startFace 13030914;
}
ffmaxx
{
type patch;
nFaces 10000;
startFace 13040914;
}
ffmaxy
{
type wall;
nFaces 10000;
startFace 13050914;
}
ffminy
{
type wall;
nFaces 10000;
startFace 13060914;
}
ffmaxz
{
type wall;
nFaces 10000;
startFace 13070914;
}
ffminz
{
type wall;
nFaces 10000;
startFace 13080914;
}
air_out_air_out
{
type wall;
nFaces 0;
startFace 13090914;
}
region1_region1
{
type wall;
nFaces 0;
startFace 13090914;
}
region2_region2
{
type wall;
nFaces 0;
startFace 13090914;
}
region3_region3
{
type wall;
nFaces 0;
startFace 13090914;
}
region4_region4
{
type wall;
nFaces 0;
startFace 13090914;
}

If someone could spot what I am doing wrong it will be greatly appreciated.
Thanks for you help,
Romain

JR22 June 7, 2013 01:35

Hi Nakor,

Did you solve the problem here?

Thanks


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