CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Native Meshers: snappyHexMesh and Others (https://www.cfd-online.com/Forums/openfoam-meshing-snappyhexmesh/)
-   -   Problem with cell removal in SHM (https://www.cfd-online.com/Forums/openfoam-meshing-snappyhexmesh/103606-problem-cell-removal-shm.html)

Bercht June 21, 2012 08:16

Problem with cell removal in SHM
 
Hi,

Iam trying to create a mesh for an internal flow with SHM. Everything i tried ended up with the refined background mesh but with no removed cells. I tried different stl's because i wasnt sure if they might have holes.

After that i found this tutorial:
http://www.hydroniumion.de/general/s...mesh-tutorial/

I took his .stl file and tried to run SHM again with the same result:
Code:

Removing mesh beyond surface intersections
------------------------------------------
Found point (0.3 0.3 -0.08) in cell 58028 in global region 0 out of 1 regions.
Keeping all cells in region 0 containing point (0.3 0.3 -0.08)
Selected for keeping : 127807 cells.
Edge intersection testing:
    Number of edges            : 392133
    Number of edges to retest  : 0
    Number of intersected edges : 1063

My snappyHexMeshDict looks like that:
Code:

/*---------------------------------------------------------------------------*\
| =========                |                                                |
| \\      /  F ield        | OpenFOAM: The Open Source CFD Toolbox          |
|  \\    /  O peration    | Version:  1.6                                  |
|  \\  /    A nd          | Web:      http://www.openfoam.org                |
|    \\/    M anipulation  |                                                |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version        2.0;
    format          ascii;
    root            "/home/penfold/mattijs/foam/mattijs2.1/run/icoFoam";
    case            "cavity";
    instance        "system";
    local          "";
    class          dictionary;
    object          autoHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
castellatedMesh true;
snap            true;
addLayers      true;
mergeTolerance 1e-06;
geometry
{
    wigley.stl
    {
        type triSurfaceMesh;
        name Ofen;
    }
    refinementBox
    {
        type searchableBox;
        min (-10000 -1000 -10000);
        max (10000 11000 10000);
    }
}
castellatedMeshControls
{
    maxLocalCells 1000000;
    maxGlobalCells 5000000;
    minRefinementCells 1;
    nCellsBetweenLevels 2;
    features
    (
    );
    allowFreeStandingZoneFaces true;
    curvature      0.9925;
    maxLoadUnbalance 0.01;
    resolveFeatureAngle 30;
    refinementSurfaces
    {
        "Ofen_*"
        {
            level (1 2);
    faceZone Ofen;
            cellZone Ofen;
            zoneInside true;
        }
    }
    refinementRegions
    {
 
    }
    locationInMesh (0.3 0.3 -0.08);
}
snapControls
{
    nSmoothPatch 3;
    tolerance 4.0;
    nSolveIter 30;
    nRelaxIter 5;
}
addLayersControls
{
    relativeSizes true;
    layers
    {
//flowAirDuctReagent_flowAirDuctReagent
        //{
        //    nSurfaceLayers 1;
        //}
//flowAirDuctReagent_inlet1
        //{
        //    nSurfaceLayers 1;
        //}
//flowAirDuctReagent_inlet2
        //{
        //    nSurfaceLayers 1;
        //}
    }
    expansionRatio 1.0;
    finalLayerThickness 0.3;
    minThickness 0.1;
    nGrow 0;
    featureAngle 30;
    nRelaxIter 3;
   
    nLayerIter 50;
    nSmoothSurfaceNormals 1;
    nSmoothNormals 3;
    nSmoothThickness 10;
    maxFaceThicknessRatio 0.5;
    maxThicknessToMedialRatio 0.3;
    minMedianAxisAngle 130;
    nBufferCellsNoExtrude 0;
}

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


What is wrong with my Dict file? Iam wondering because the defined locationInMesh Vector points to an existing cell (58028) but doesnt remove any cells.
Hope you can help me.

Doug68 June 21, 2012 20:05

A silly question but I made this mistake myself...
Is "Ofen" the name of the solid in the STL file?
Assuming its an ascii STL file this should be in the top line of the file.

Doug68 June 21, 2012 22:31

Also... by looking at:

refinementBox
{
type searchableBox;
min (-10000 -1000 -10000);
max (10000 11000 10000);
}

I'm guess you think that this is in mm? I found out the hard way the units quoted are m, if the STL file is in mm then it may be way bigger than the blockmesh volume hence no cells are removed.

An easy test for this is to open the mesh in parafoam then open the stl file at the same time and see if it is inside the mesh or not.

Bercht June 22, 2012 04:30

Thank you so much... it works now. Yes, I thought that it is in mm. But i created my stl with Gmsh entering "mm" aswell so this is ok ;)

Bercht June 22, 2012 06:20

Now i have another problem. I created the stl with gmsh in which i can define physical groups which i can use as boundaries in OF. But am I right that i cant export those groups with an stl file made by Gmsh? Is it possible with another freeware software like Gmsh?

lovecraft22 June 22, 2012 08:34

You could just export every region to a different ASCII stl file then open them with a text editor and append them all in an empty file which you'll then save as a .stl


All times are GMT -4. The time now is 11:42.