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/)
-   -   snappyHexMeshDict (http://www.cfd-online.com/Forums/openfoam-meshing-snappyhexmesh/81833-snappyhexmeshdict.html)

samiam1000 November 8, 2010 10:23

snappyHexMeshDict
 
Dear All,

I am writing since I have a couple of questions about the snappyHexMeshDict file.

I can not understand 2 sections in that file and I can not find any explanation in the user's guide.

I am speaking about "pointsCheck" and "handleSnapProblems"..

Could you help?

Thanks a lot,

Samuele

colinB November 10, 2010 03:43

Hi,

which version of OF are you using?
For I'm using 1.7.1 and I don't have such parameters in my
sHMD and mine is working fine without them.

regards

samiam1000 November 10, 2010 03:53

Dear Colin,

actually, I am running the version 1.7, as well.

I attach below my sHMD.

Also, one more question about snappyHexMesh. I thought it was enough to create the blockMeshDict and the snappyHexMeshDict files, in order to be able to run "snappyHexMesh".
Indeed, I need 4 other files (e.g. controlDict, decomposeParDict, fvSchemes and fvSolution) that, imho, do not contain any info about the mesh generation. Where am I wrong?

Thanks a lot,
Samuele

Here is my sHMD:
Code:

// * Created by Francesco * //


FoamFile
{
    version 2.0;
    format ascii;

    root ".";
    case "";
    instance ".";
    local "";

    class dictionary;
    object snappyHexMeshDict;
}

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

castellatedMesh true;

snap            true;

pointsCheck    false;

addLayers      false;

debug          0;

handleSnapProblems on;

mergeTolerance  1e-6;

geometry
{

    "nasal_cavity.stl"
    {
        type            triSurfaceMesh;
        name            cavity;
        tolerance      1e-3;
        regions
        {
            patch0          { name nasalCavitySurface; }
        }
    }

}

castellatedMeshControls
{

    maxLocalCells  80000000;

    maxGlobalCells  160000000;

    minRefinementCells 20;

    nCellsBetweenLevels 3;

    features
    (
    );

    locationInMesh  ( -27.65 -40.65 -552.04 );

    allowFreeStandingZoneFaces true;

    curvature      0.9925;

    maxLoadUnbalance 0.01;

    resolveFeatureAngle 30.0;

    refinementSurfaces
    {
   
        cavity
        {
       
            level          (2 2);
       
            regions
            {
            };
       
        }
   
    };

    refinementRegions
    {
   
    };

}

snapControls
{

    nSmoothPatch    3;

    tolerance      4.0;

    smoothMesh      true;

    nSolveIter      30;

    nRelaxIter      5;

}

meshCheckControls
{

    pointsInsideMesh
    (
    );

    pointsOutsideMesh
    (
    );

}

addLayersControls
{

    relativeSizes  true;

    nSurfaceLayers  0;

    expansionRatio  1.2;

    finalLayerThickness 0.5;

    minThickness    0.1;

    nGrow          1;

    featureAngle    90;

    nRelaxIter      5;

    nSmoothSurfaceNormals 1;

    nSmoothNormals  3;

    nSmoothThickness 10;

    maxFaceThicknessRatio 0.5;

    maxThicknessToMedialRatio 0.3;

    minMedianAxisAngle 130;

    nBufferCellsNoExtrude 0;

    nLayerIter      50;

    layers
    {
    }

}

meshQualityControls
{

    maxNonOrtho    65;

    maxBoundarySkewness 20;

    maxInternalSkewness 20;

    maxConcave      80;

    minFlatness    0.5;

    minVol          1e-13;

    minArea        -1;

    minTwist        0.05;

    minDeterminant  0.001;

    minFaceWeight  0.02;

    minVolRatio    0.01;

    minTriangleTwist 0.05;

    nSmoothScale    4;

    errorReduction  0.75;

}

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


colinB November 10, 2010 09:54

Hi Samuele,

how did you come up with these points?
I just checked (like you probalby did as well) the motorBike tutorial
and the user documentation and they are not mentioned there.
So why would you introduce these to parameters and who came
up with that idea?

Unfortunately my sHMD is on a different computer so I can not show you my file but the beginning looks like this (note I skiped the FoamFile part):


Code:

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

castellatedMesh true;
snap  true;
addLayers  true;


geometry
{

and so on and so on....

I read through your code further and found some other parameters I'm not familiar with.
So it would be really interesting where you got the file from.
regards
Colin

samiam1000 November 10, 2010 14:14

Dear Colin,

to be true, I got these files (sHMD and bMD) from a person who works daily with OF and who shared his samples with me.

I'll ask him news about those zones and then I'll post them here, if he agrees.

Ok??

Thanks again,

Samuele.

colinB November 11, 2010 05:47

Thats a good idea, because it would be also interesting for me to know what these parameters are for.

looking forward to your post
regards

samiam1000 November 11, 2010 09:55

I do not have good news.

The author of those files just told me that he used those sections with old (and not always released) versions of snappy.

Also, he told me that I can ignore them.

I am sorry.

Samuele

deniggo December 10, 2010 06:34

Hi,

After running snappyHexMesh with satisfactory results the boundary condition in the 0.002/polyMesh folder is extented by one more entry:
name_solid
{
type wall;
nFaces 20512;
startFace 98394;
}

Obviosly, the case does not work anymore, when I copy the content of the new polyMesh folder to constant/polyMesh to replace the old files generated by blockMesh. A boundary error occurs.

Did I something wrong in the snappyHexMeshDict:
Code:

FoamFile
{
    version    2.0;
    format      ascii;
    class      dictionary;
    object      snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

castellatedMesh true;
snap            true;
addLayers      true;

geometry
{
    stlfileascii.stl
    {
        type triSurfaceMesh;
        name snaptest;
       
    }

  /* refinementBox
    {
        type searchableBox;
        min (-0.3 -0.1 -0.1);
        max ( 6.2  0.2 0.1);
    }
    */
};


castellatedMeshControls
{

   
    maxLocalCells 1000000;
    maxGlobalCells 2000000;
    minRefinementCells 10;
    maxLoadUnbalance 0.10;
    nCellsBetweenLevels 2;
    features
    (
        //{
        //    file "someLine.eMesh";
        //    level 2;
        //}
    );

    refinementSurfaces
    {
        snaptest
        {
           
            level (1 2);
        }
    }


    resolveFeatureAngle 30;


    refinementRegions
    {
      /* snaptest
        {
            mode inside;
            levels ((0 4));
        }
        */
    }

    locationInMesh (10 0.5 0.0);
}

snapControls
{

    nSmoothPatch 3;
    tolerance 4.0;
    nSolveIter 30;
    nRelaxIter 5;
}

addLayersControls
{

    relativeSizes true;
    layers
    {
    /* 
     
        {
            nSurfaceLayers 1;
        }
        */
    }

    expansionRatio 1.0;
    finalLayerThickness 0.3;
    minThickness 0.1;
    nGrow 1;
    featureAngle 30;
    nRelaxIter 3;
    nSmoothSurfaceNormals 1;
    nSmoothNormals 3;
    nSmoothThickness 10;
    maxFaceThicknessRatio 0.5;
    maxThicknessToMedialRatio 0.3;
    minMedianAxisAngle 130;
    nBufferCellsNoExtrude 0;
    nLayerIter 50;
}

meshQualityControls
{

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

debug 0;

mergeTolerance 1E-6;


colinB December 10, 2010 06:58

Hi Deniggo,

well actually this is nothing unusual what you are describing.

The normal procedure is to create a background mesh with blockMesh and then with sHM you are introducing a solid where the flow of whatever goes around.
This solid has to be named and defined as well which is done automatically
by sHM in the boundary file.
You now have to specify this new patch also in the other boundary files
(U p k omega alpha1 or others depending on what kind of solver you use)

So there is nothing special about this.

What maybe can make things more easy for you is using the command

snappyHexMesh -overwrite

when creating the new mesh. This will suppres writing the new mesh in different time folders and it is immediatelly stored in the constant folder where the rest of your mesh is as well.

I hope I captchured your problem well if not let me know.

regards Colin

deniggo December 10, 2010 08:25

Hi Colin,
thanks for your help.
I think, I have to reverse the stl-geometry and change the bounding box extent, because in my case the "whatever" is not flowing around the stl, it should flow inside. Now I understand, why all BC defined in blockMesh become 0 after running sHM- because they have been clipped.

Nico

deniggo December 25, 2010 04:06

1 Attachment(s)
Hello sHM-profis,

after using sHM, the mesh contains some pentagonal cells (see attachment). How can I preserve the quadrangular cells, created by blockMesh? I want to use the obtained data for further calculations and need a geometrie with more or less equal intervals of cells/points.
I played a bit with several parameter in sHM but with no success (e.g. refinementSurfaces, maxNonOrtho). Which one I have to change?

Thanks for your help,

Nico

deniggo January 5, 2011 05:03

1 Attachment(s)
When I change the maxNonOrtho to 10 instead of 80 only quadrangular elements are generated (see pic), but how can I avoid these sharp edges?

Can anyone help?

Thanks,

Nico


All times are GMT -4. The time now is 10:19.