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 Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 5, 2008, 11:26
Default SnappyHexMeshDict
  #1
Member
 
fabrizio
Join Date: Mar 2009
Posts: 33
Rep Power: 17
fabrizio is on a distinguished road
Hi everybody I'm very interested in using SnappyHexMesh utility. I've read the manual about this topic, but I have problems in understanding part of SnappyHexMeshDict file. For example,how can I define "refinementBox" and "refinementSurfaces"?

Thanks for help

Fabrizio
fabrizio is offline   Reply With Quote

Old   November 5, 2008, 11:32
Default Whats you problem with that ex
  #2
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Whats you problem with that exactly?

refinementBoxes are uses to refine the mesh volume. refinement on surfaces is refinement near your geometry.

Regards
bastil is offline   Reply With Quote

Old   November 6, 2008, 10:25
Default Hi BastiL so I should set "ref
  #3
Member
 
fabrizio
Join Date: Mar 2009
Posts: 33
Rep Power: 17
fabrizio is on a distinguished road
Hi BastiL so I should set "refinement box" field with the max&min coordinates defined in the blockmesh file? And how can I set refinement surface level?And locationInMesh?

Thank you
fabrizio is offline   Reply With Quote

Old   November 6, 2008, 17:05
Default so I should set "refinement bo
  #4
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
so I should set "refinement box" field with the max&min coordinates defined in the blockmesh file?
No. The course inital mesh generated witm blockmesh mark the outer mesh dimensions. If you want some additional refinement inside this volume you can use refinement boxes....

What is unclear about the other options?
bastil is offline   Reply With Quote

Old   November 7, 2008, 11:40
Default I cant'understand how to build
  #5
Member
 
fabrizio
Join Date: Mar 2009
Posts: 33
Rep Power: 17
fabrizio is on a distinguished road
I cant'understand how to build this file, what values I have to insert in the fields. I have a simple geometry in stl format and a mesh generated with blockMeshDict.

Thank you

Fabrizio
fabrizio is offline   Reply With Quote

Old   November 7, 2008, 12:00
Default For example how can I set the
  #6
Member
 
fabrizio
Join Date: Mar 2009
Posts: 33
Rep Power: 17
fabrizio is on a distinguished road
For example how can I set the right value for "refinementBox"? In the field "refinementSurfaces" what are min e max level? And refinementRegions modes and levels? I don't know how to set the 'right' values.

Thank you again

Fabrizio
fabrizio is offline   Reply With Quote

Old   November 10, 2008, 10:36
Default Hi I'm going crazy on snappyHe
  #7
Member
 
fabrizio
Join Date: Mar 2009
Posts: 33
Rep Power: 17
fabrizio is on a distinguished road
Hi I'm going crazy on snappyHexMeshDict file. I can't understand what "levels" are, talking about refinement. I don't know what "region defined by bounding box" is and what it is needed for.

Please help me the manual is not very clear about this topic.

Thank you very much

Fabrizio
fabrizio is offline   Reply With Quote

Old   November 10, 2008, 12:25
Default Hi I've tried the utility with
  #8
Member
 
fabrizio
Join Date: Mar 2009
Posts: 33
Rep Power: 17
fabrizio is on a distinguished road
Hi I've tried the utility with a stl file but I can see nothing...the process ends succesfully but if I open the mesh in paraview I only can see the hex mesh created with blockmesh...help!

Thanks to all and sorry for annoying you so much

Fabrizio
fabrizio is offline   Reply With Quote

Old   November 10, 2008, 14:09
Default Hi Fabrizio, have you tried
  #9
Senior Member
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26
mattijs is on a distinguished road
Hi Fabrizio,

have you tried the tutorial? time constant/0 is the blockMesh generated blockMesh, time 1 is the refined mesh, time 2 is the refined+snapped mesh, time 3 is the refined+snapped+layer mesh. Just use the time-selector in paraFoam to look at the mesh you want. (or foamToVTK -time DDD)

levels: level 0 is the starting mesh, level 1 means one level refined etc.
mattijs is offline   Reply With Quote

Old   November 12, 2008, 11:18
Default Hi everybody I've finally crea
  #10
Member
 
fabrizio
Join Date: Mar 2009
Posts: 33
Rep Power: 17
fabrizio is on a distinguished road
Hi everybody I've finally created the mesh with snappy..thanks to all!
I have now only a doubt: after creating the mesh with hex8 elements, in the "face" file I should have e list of faces with 4 points each one, but there are also faces with 5 or 6 points.
Why is that?

Thanks again

Fabrizio
fabrizio is offline   Reply With Quote

Old   November 15, 2008, 08:34
Default Hi I'm trying to optimize my h
  #11
Member
 
fabrizio
Join Date: Mar 2009
Posts: 33
Rep Power: 17
fabrizio is on a distinguished road
Hi I'm trying to optimize my hex mesh done with Snappy. During the process I've noted this warning message:

FOAM Warning : Displacement (-0.0118261 0.0110534 0.00107809) at mesh point 9326 coord (21.1735 25.0765 25.0661) points through the surrounding patch faces

What is it?

King regards

Fabrizio
fabrizio is offline   Reply With Quote

Old   November 21, 2008, 11:01
Default Hi everybody I'm going on with
  #12
Member
 
fabrizio
Join Date: Mar 2009
Posts: 33
Rep Power: 17
fabrizio is on a distinguished road
Hi everybody I'm going on with my work using SnappyHexMesh, I hope you can help me clearing my doubts. What is the difference between "surface refinement" and "shell refinement?"

My pourpose is obtaining a pure hex mesh, so can I avoid the snapping process? How can I avoid it? I hope someone can tell me how to set the pamametres in SnappyHexMeshDict to obtain a well defined hex mesh.

Thanks to all, again

Fabrizio
fabrizio is offline   Reply With Quote

Old   February 25, 2009, 05:28
Default Hi everybody, we would like
  #13
Member
 
norman1981's Avatar
 
Norman Del Puppo
Join Date: Mar 2009
Location: Hinwil, CH
Posts: 57
Rep Power: 17
norman1981 is on a distinguished road
Hi everybody,

we would like to know why the the total number of final cells generated by snappyHexMesh exceed the ones setted in the control parameters maxGlobalCells and maxLocalCells too.

We really also appreciate more informations (than the ones present in the motorBike tutorial file) about the minRefinementCells, nCellsBetweenLevels and resolveFeatureAngle parameters.

Could someone help us?

Thank you very much

Kind Regards

Norman
norman1981 is offline   Reply With Quote

Old   March 26, 2009, 14:29
Default cyclic boundaru condition snappyhexmesh
  #14
Member
 
mohd mojab
Join Date: Mar 2009
Posts: 31
Rep Power: 17
mou_mi is on a distinguished road
Hello,

I have a geometry that have cyclic boundary condition in two directions (x & z) and wall in top and bottom.



when i use snappy hex mesh, it gave me this error:

Create time

Create mesh for time = 0

Read mesh in = 0.12 s
Reading refinement surfaces.
Read refinement surfaces in = 0.01 s

Reading refinement shells.
Read refinement shells in = 0 s

Setting refinement level of surface to be consistent with shells.
Checked shell refinement in = 0 s


Adding patches for surface regions
----------------------------------

Patch Region
----- ------
cell_type_IV:

4 cell_type_IV_cell_type_IV

Added patches in = 0 s

Selecting decompositionMethod simple

Overall mesh bounding box : (0.5 0.2 0.5) (2.5 1.8 2.5)
Relative tolerance : 1e-06
Absolute matching distance : 3.249615e-06


Determining initial surface intersections
-----------------------------------------

Edge intersection testing:
Number of edges : 56100
Number of edges to retest : 56100
Number of intersected edges : 2881
Calculated surface intersections in = 0.22 s

Initial mesh : cells:18000 faces:56100 points:20181
Cells per refinement level:
0 18000

Refinement phase
----------------

Found point (1.5 0.5 0.5) in cell 17504 on processor 0
Reading external feature lines.
Read feature lines in = 0 s


Surface refinement iteration 0
------------------------------

Marked for refinement due to surface intersection : 2858 cells.
Marked for refinement due to curvature/regions : 0 cells.
Determined cells to refine in = 0.01 s
Selected for refinement : 2858 cells (out of 18000)
--> FOAM Warning :
From function syncTools<class T, class CombineOp>::syncEdgeList(const polyMesh&, UList<T>&, const CombineOp&, const T&, const bool)
in file /home/dm2/henry/OpenFOAM/OpenFOAM-dev/src/OpenFOAM/lnInclude/syncToolsTemplates.C at line 1333
There are decomposed cyclics in this mesh with transformations.
This is not supported. The result will be incorrect
cyclicPolyPatch:rder : Writing half0 faces to OBJ file "X_half0_faces.obj"
cyclicPolyPatch:rder : Writing half1 faces to OBJ file "X_half1_faces.obj"
cyclicPolyPatch:rder : Dumping currently found cyclic match as lines between corresponding face centres to file "/home/mou/OpenFOAM/mou-1.5-dev/run/mou_cases/cell_1/X_faceCentres.obj"
--> FOAM Serious Error :
From function cyclicPolyPatch:rder(const primitivePatch&, labelList&, labelList&) const
in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 1253
Patch:X : Cannot match vectors to faces on both sides of patch
Perhaps your faces do not match? The obj files written contain the current match.
Continuing with incorrect face ordering from now on!
cyclicPolyPatch:rder : Writing half0 faces to OBJ file "Z_half0_faces.obj"
cyclicPolyPatch:rder : Writing half1 faces to OBJ file "Z_half1_faces.obj"
cyclicPolyPatch:rder : Dumping currently found cyclic match as lines between corresponding face centres to file "/home/mou/OpenFOAM/mou-1.5-dev/run/mou_cases/cell_1/Z_faceCentres.obj"
--> FOAM Serious Error :
From function cyclicPolyPatch:rder(const primitivePatch&, labelList&, labelList&) const
in file meshes/polyMesh/polyPatches/constraint/cyclic/cyclicPolyPatch.C at line 1253
Patch:Z : Cannot match vectors to faces on both sides of patch
Perhaps your faces do not match? The obj files written contain the current match.
Continuing with incorrect face ordering from now on!



But if I change one of these cyclic boundary conditions to "patch", it works fine. It seems that having two cyclic boundary conditions make this problem. Would you give me some advise to fix this problem?

Thank you
mou
Attached Images
File Type: jpg cell.jpg (25.4 KB, 1372 views)
mou_mi is offline   Reply With Quote

Old   June 14, 2009, 11:19
Default
  #15
Senior Member
 
louisgag's Avatar
 
Louis Gagnon
Join Date: Mar 2009
Location: Stuttgart, Germany
Posts: 338
Rep Power: 18
louisgag is on a distinguished road
Send a message via ICQ to louisgag
Quote:
Originally Posted by norman1981 View Post
Hi everybody,

we would like to know why the the total number of final cells generated by snappyHexMesh exceed the ones setted in the control parameters maxGlobalCells and maxLocalCells too.
Hi Norman,

I think that maxGlobalCells will only stop after reaching the max number of cells specified, so if you have a refinement level that adds 400K cells and specified a maxGlobalCells of 550K you might end up with almost 950K cells.. Thats how I see it, not sure if its exact though...

regards,

-Louis
louisgag is offline   Reply With Quote

Old   August 20, 2009, 10:23
Default
  #16
New Member
 
andres
Join Date: Aug 2009
Posts: 15
Rep Power: 16
andresbh is on a distinguished road
Hi mou_mi

have you been able to solve this problem? i also have a similar one and cant find any advise for that.
I would appreciate it very much if you could give me a hint.

thanks
andres
andresbh is offline   Reply With Quote

Old   August 21, 2009, 04:24
Default
  #17
Member
 
norman1981's Avatar
 
Norman Del Puppo
Join Date: Mar 2009
Location: Hinwil, CH
Posts: 57
Rep Power: 17
norman1981 is on a distinguished road
Quote:
Originally Posted by louisgag View Post
Hi Norman,

I think that maxGlobalCells will only stop after reaching the max number of cells specified, so if you have a refinement level that adds 400K cells and specified a maxGlobalCells of 550K you might end up with almost 950K cells.. Thats how I see it, not sure if its exact though...

regards,

-Louis
Hi Louis,

I think so!
Thank you
Have a nice day
Norman
norman1981 is offline   Reply With Quote

Old   August 21, 2009, 10:48
Default
  #18
Member
 
mohd mojab
Join Date: Mar 2009
Posts: 31
Rep Power: 17
mou_mi is on a distinguished road
Hi andres

I think the snappyhexmesh can not handle the mesh that have cyclic boundary conditions in two directions.

Moe
mou_mi is offline   Reply With Quote

Old   March 22, 2010, 15:09
Default
  #19
Bob
New Member
 
Bob De Clercq
Join Date: Apr 2009
Location: Belgium
Posts: 17
Rep Power: 17
Bob is on a distinguished road
Hi Fabrizio,

I am wondering if you already solved your FOAM warning below? I encounter the same problem and do not know the reason?

Many thanks!

Regards,
Bob


FOAM Warning : Displacement (-0.0118261 0.0110534 0.00107809) at mesh point 9326 coord (21.1735 25.0765 25.0661) points through the surrounding patch faces
Bob is offline   Reply With Quote

Old   March 25, 2010, 06:47
Default snappyHexMesh refuses to add boundary layers
  #20
Bob
New Member
 
Bob De Clercq
Join Date: Apr 2009
Location: Belgium
Posts: 17
Rep Power: 17
Bob is on a distinguished road
Dear all,

I created the snappyHexMesh file to mesh around a structure. Everything works fine until I want to add layers around the boundary of the .stl. Nothing happens so I wonder if other people have experienced the same problem? Did I use the wrong settings? Any ideas...

I attached my snappy-file if people are willing to have a look at it.

Many thanks in advance!

Cheers,
Bob





// Which of the steps to run
castellatedMesh true;
snap true;
addLayers true;


// Geometry. Definition of all surfaces. All surfaces are of class
// searchableSurface.
// Surfaces are used
// - to specify refinement for any mesh cell intersecting it
// - to specify refinement for any mesh cell inside/outside/near
// - to 'snap' the mesh boundary to the surface
geometry
{
box //user-defined name
{
type searchableBox;
min (-15 -100 0);
max (15 12 0.5);
}

tower.stl
{
type triSurfaceMesh;
name tower;
}

cylinder.stl
{
type triSurfaceMesh;
name cylinder;
}

};



// Settings for the castellatedMesh generation.
castellatedMeshControls
{

// Refinement parameters
// ~~~~~~~~~~~~~~~~~~~~~

// While refining maximum number of cells per processor. This is basically
// the number of cells that fit on a processor. If you choose this too small
// it will do just more refinement iterations to obtain a similar mesh.
maxLocalCells 1000000;

// Overall cell limit (approximately). Refinement will stop immediately
// upon reaching this number so a refinement level might not complete.
// Note that this is the number of cells before removing the part which
// is not 'visible' from the keepPoint. The final number of cells might
// actually be a lot less.
maxGlobalCells 2000000;

// The surface refinement loop might spend lots of iterations refining just a
// few cells. This setting will cause refinement to stop if <= minimumRefine
// are selected for refinement. Note: it will at least do one iteration
// (unless the number of cells to refine is 0)
minRefinementCells 5;

// Number of buffer layers between different levels.
// 1 means normal 2:1 refinement restriction, larger means slower
// refinement.
// nCellsBetweenLevels 1;
nCellsBetweenLevels 6;


// Explicit feature edge refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

// Specifies a level for any cell intersected by its edges.
// This is a featureEdgeMesh, read from constant/triSurface for now.
features
(
//{
// file "someLine.eMesh";
// level 2;
//}
);



// Surface based refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~

// Specifies two levels for every surface. The first is the minimum level,
// every cell intersecting a surface gets refined up to the minimum level.
// The second level is the maximum level. Cells that 'see' multiple
// intersections where the intersections make an
// angle > resolveFeatureAngle get refined up to the maximum level.

refinementSurfaces
{
tower
{
// Surface-wise min and max refinement level
level (4 4);
}

cylinder
{
// Surface-wise min and max refinement level
level (4 4);
}
}

// Resolve sharp angles
resolveFeatureAngle 30;


// Region-wise refinement
// ~~~~~~~~~~~~~~~~~~~~~~

// Specifies refinement level for cells in relation to a surface. One of
// three modes
// - distance. 'levels' specifies per distance to the surface the
// wanted refinement level. The distances need to be specified in
// descending order.
// - inside. 'levels' is only one entry and only the level is used. All
// cells inside the surface get refined up to the level. The surface
// needs to be closed for this to be possible.
// - outside. Same but cells outside.

refinementRegions
{
box
{
mode inside;
levels ((1 1));
}
tower
{
mode distance;
levels ((3 3) (5 2) (10 1));
}

cylinder
{
mode distance;
levels ((3 3) (5 2));
}
}


// Mesh selection
// ~~~~~~~~~~~~~~

// After refinement patches get added for all refinementSurfaces and
// all cells intersecting the surfaces get put into these patches. The
// section reachable from the locationInMesh is kept.
// NOTE: This point should never be on a face, always inside a cell, even
// after refinement.
locationInMesh (20 20 0.1);
}



// Settings for the snapping.
snapControls
{
//- Number of patch smoothing iterations before finding correspondence
// to surface
// nSmoothPatch 3;
nSmoothPatch 4;

//- Relative distance for points to be attracted by surface feature point
// or edge. True distance is this factor times local
// maximum edge length.
tolerance 4.0;

//- Number of mesh displacement relaxation iterations.
// nSolveIter 30;
nSolveIter 40;

//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
}



// Settings for the layer addition.
addLayersControls
{
relativeSizes true;

// Per final patch (so not geometry!) the layer information
layers
{
tower_tower
{
nSurfaceLayers 2;
}

cylinder_cylinder
{
nSurfaceLayers 2;
}
}

// Expansion factor for layer mesh
expansionRatio 1.5;

//- Wanted thickness of final added cell layer. If multiple layers
// is the
// thickness of the layer furthest away from the wall.
// Relative to undistorted size of cell outside layer.
finalLayerThickness 0.8;

//- Minimum thickness of cell layer. If for any reason layer
// cannot be above minThickness do not add layer.
// Relative to undistorted size of cell outside layer.
minThickness 0.01;

//- If points get not extruded do nGrow layers of connected faces that are
// also not grown. This helps convergence of the layer addition process
// close to features.
nGrow 1;


// Advanced settings

//- When not to extrude surface. 0 is flat surface, 90 is when two faces
// make straight angle.
// featureAngle 30;
featureAngle 30;

//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 3;

// Number of smoothing iterations of surface normals
nSmoothSurfaceNormals 1;

// Number of smoothing iterations of interior mesh movement direction
nSmoothNormals 3;

// Smooth layer thickness over surface patches
nSmoothThickness 10;

// Stop layer growth on highly warped cells
maxFaceThicknessRatio 0.5;

// Reduce layer growth where ratio thickness to medial
// distance is large
maxThicknessToMedialRatio 0.3;

// Angle used to pick up medial axis points
minMedianAxisAngle 130;

// Create buffer region for new layer terminations
nBufferCellsNoExtrude 0;

// Overall max number of layer addition iterations
nLayerIter 50;
}



// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
//- Maximum non-orthogonality allowed. Set to 180 to disable.
maxNonOrtho 65;

//- Max skewness allowed. Set to <0 to disable.
maxBoundarySkewness 20;
maxInternalSkewness 4;

//- Max concaveness allowed. Is angle (in degrees) below which concavity
// is allowed. 0 is straight face, <0 would be convex face.
// Set to 180 to disable.
maxConcave 80;

//- Minimum projected area v.s. actual area. Set to -1 to disable.
minFlatness 0.5;

//- Minimum pyramid volume. Is absolute volume of cell pyramid.
// Set to very negative number (e.g. -1E30) to disable.
minVol 1e-13;

//- Minimum face area. Set to <0 to disable.
minArea -1;

//- Minimum face twist. Set to <-1 to disable. dot product of face normal
//- and face centre triangles normal
minTwist 0.02;

//- minimum normalised cell determinant
//- 1 = hex, <= 0 = folded or flattened illegal cell
minDeterminant 0.001;

//- minFaceWeight (0 -> 0.5)
minFaceWeight 0.02;

//- minVolRatio (0 -> 1)
minVolRatio 0.01;

//must be >0 for Fluent compatibility
minTriangleTwist -1;


// Advanced

//- Number of error distribution iterations
nSmoothScale 4;
//- amount to scale back displacement at error points
errorReduction 0.75;
}


// Advanced

// Flags for optional output
// 0 : only write final meshes
// 1 : write intermediate meshes
// 2 : write volScalarField with cellLevel for postprocessing
// 4 : write current intersections as .obj files
debug 0;


// Merge tolerance. Is fraction of overall bounding box of initial mesh.
// Note: the write tolerance needs to be higher than this.
mergeTolerance 1E-6;


// ************************************************** *********************** //
Bob is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
[snappyHexMesh] How to define the computational region with snappyHexMeshDict xurenyi OpenFOAM Meshing & Mesh Conversion 3 June 12, 2014 10:20
[snappyHexMesh] Help with snappyHexMeshDict parameters lowis5 OpenFOAM Meshing & Mesh Conversion 0 March 4, 2014 17:52
[snappyHexMesh] snappyHexMesh ignoring skew limits from snappyhexmeshdict aerogt3 OpenFOAM Meshing & Mesh Conversion 4 May 5, 2013 05:12
[snappyHexMesh] snappyHexMeshDict samiam1000 OpenFOAM Meshing & Mesh Conversion 11 January 5, 2011 05:03
[snappyHexMesh] Any have a refined snappyHexMeshDict for the motorbike case? stark22 OpenFOAM Meshing & Mesh Conversion 0 February 1, 2010 17:42


All times are GMT -4. The time now is 16:05.