CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Meshing & Mesh Conversion

[snappyHexMesh] snappyHexMeshDict

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 8, 2010, 09:23
Default snappyHexMeshDict
  #1
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
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
samiam1000 is offline   Reply With Quote

Old   November 10, 2010, 02:43
Default
  #2
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 18
colinB is on a distinguished road
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
colinB is offline   Reply With Quote

Old   November 10, 2010, 02:53
Default
  #3
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
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;

}

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
samiam1000 is offline   Reply With Quote

Old   November 10, 2010, 08:54
Default
  #4
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 18
colinB is on a distinguished road
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
colinB is offline   Reply With Quote

Old   November 10, 2010, 13:14
Default
  #5
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
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.
samiam1000 is offline   Reply With Quote

Old   November 11, 2010, 04:47
Default
  #6
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 18
colinB is on a distinguished road
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
colinB is offline   Reply With Quote

Old   November 11, 2010, 08:55
Default
  #7
Senior Member
 
Samuele Z
Join Date: Oct 2009
Location: Mozzate - Co - Italy
Posts: 520
Rep Power: 18
samiam1000 is on a distinguished road
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
samiam1000 is offline   Reply With Quote

Old   December 10, 2010, 05:34
Default
  #8
Member
 
Nico T
Join Date: Aug 2010
Location: Leipzig, Germany
Posts: 39
Rep Power: 15
deniggo is on a distinguished road
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;
deniggo is offline   Reply With Quote

Old   December 10, 2010, 05:58
Default
  #9
Senior Member
 
Join Date: Aug 2010
Location: Groningen, The Netherlands
Posts: 216
Rep Power: 18
colinB is on a distinguished road
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
colinB is offline   Reply With Quote

Old   December 10, 2010, 07:25
Default
  #10
Member
 
Nico T
Join Date: Aug 2010
Location: Leipzig, Germany
Posts: 39
Rep Power: 15
deniggo is on a distinguished road
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 is offline   Reply With Quote

Old   December 25, 2010, 03:06
Default
  #11
Member
 
Nico T
Join Date: Aug 2010
Location: Leipzig, Germany
Posts: 39
Rep Power: 15
deniggo is on a distinguished road
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
Attached Images
File Type: jpg mesh.jpg (107.3 KB, 82 views)
deniggo is offline   Reply With Quote

Old   January 5, 2011, 04:03
Default
  #12
Member
 
Nico T
Join Date: Aug 2010
Location: Leipzig, Germany
Posts: 39
Rep Power: 15
deniggo is on a distinguished road
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
Attached Images
File Type: jpg mesh2.jpg (98.7 KB, 95 views)
deniggo is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Writing snappyHexMeshDict jhanson2 OpenFOAM Running, Solving & CFD 3 September 27, 2017 05:09
[PyFoam] Can we modify snappyHexMeshDict using pyFoam? harsha_kulkarni OpenFOAM Community Contributions 0 November 13, 2016 08:18
[snappyHexMesh] How to define the computational region with snappyHexMeshDict xurenyi OpenFOAM Meshing & Mesh Conversion 3 June 12, 2014 09:20
[snappyHexMesh] Help with snappyHexMeshDict parameters lowis5 OpenFOAM Meshing & Mesh Conversion 0 March 4, 2014 16:52
[snappyHexMesh] snappyHexMesh ignoring skew limits from snappyhexmeshdict aerogt3 OpenFOAM Meshing & Mesh Conversion 4 May 5, 2013 04:12


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