CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Native Meshers: snappyHexMesh and Others

refinementBox in snappyHexMesh

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   October 29, 2010, 09:23
Default refinementBox in snappyHexMesh
Join Date: Oct 2010
Location: Germany
Posts: 39
Rep Power: 9
Ivanet is on a distinguished road
I am new to OpenFoam and snappyHexMesh. I am trying to do my first grid with sHM and have the following problem: I define the limits of my refinementBox in the snappyHexMeshDict file, then run sHM and then see the grid in ParaView. The refinement is done correctly but only in the directions X and Y. In the Z direction I can not see any refinement. Is this a problem of sHM or of ParaView or something different?
Thanks a lot for your advices.
Ivanet is offline   Reply With Quote

Old   October 29, 2010, 09:43
Default refinementBox in snappyHexMesh
New Member
CFD user
Join Date: Apr 2010
Location: Germany
Posts: 28
Rep Power: 9
subhkirti is on a distinguished road
Can you post the snappyHexMeshDict file?
subhkirti is offline   Reply With Quote

Old   October 29, 2010, 10:08
Default refinementBox in snappyHexMesh
Join Date: Oct 2010
Location: Germany
Posts: 39
Rep Power: 9
Ivanet is on a distinguished road
Hi Subhkirti,
I am working with the motorbike tutorial. You can find bellow the snappyHexMeshDict file. As you see, at the moment I am only trying to refine the zone of the refinementBox (without the motorbike).
Thanks for your help.

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

// 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
type triSurfaceMesh;
name motorBike;

type searchableBox;
min (-1.0 -1.0 0.0);
max ( 8.0 1.0 3.0);

// Settings for the castellatedMesh generation.

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

// If local number of cells is >= maxLocalCells on any processor
// switches from from refinement followed by balancing
// (current method) to (weighted) balancing before refinement.
maxLocalCells 10000;

// 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 20000;

// 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 10;

// Allow a certain level of imbalance during refining
// (since balancing is quite expensive)
// Expressed as fraction of perfect balance (= overall number of cells /
// nProcs). 0=balance always.
maxLoadUnbalance 0.10;

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

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

// Specifies a level for any cell intersected by its edges.
// This is a featureEdgeMesh, read from constant/triSurface for now.
// 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.

// {
// Surface-wise min and max refinement level
// level (3 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.

mode inside;
levels ((1E15 1));

// 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 (3 3 0.43);
locationInMesh (1 0 0.5);

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

//- 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;

//- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh.
nRelaxIter 5;
Ivanet is offline   Reply With Quote

Old   October 30, 2010, 14:12
Senior Member
Ziad Boutanios
Join Date: Mar 2009
Location: Montréal, Canada
Posts: 119
Rep Power: 10
ziad is on a distinguished road
why is this section commented out:

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

by the way it is better to upload files as zipped attachments or wrap them in code tags. makes for a much cleaner and easier to read post.
ziad is offline   Reply With Quote

Old   May 25, 2011, 07:14
Join Date: Oct 2010
Location: Germany
Posts: 39
Rep Power: 9
Ivanet is on a distinguished road
Upps, sorry. I had completely forgotten to update this post. Dear ziad, I commented out the motorbike in refinementSurfaces because I was only trying to see how the refinementRegions work. The reason why I could not see at that time the refinement in Z direction is that I did not do any slice with Paraview. Without the slice, it is not possible to see it. Well, it was just a beginners problem but I hope this can help someone else starting now with OpenFoam. Best regards Ivan
Ivanet is offline   Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Createpatch and SnappyHexMesh hm86 OpenFOAM Native Meshers: snappyHexMesh and Others 1 February 3, 2011 10:50
stitchMesh and snappyHexMesh gdbaldw OpenFOAM 0 December 23, 2009 03:09
SnappyHexMesh samiam1000 OpenFOAM 0 October 5, 2009 10:32
Problem with snappyHexMesh samiam1000 OpenFOAM 0 October 3, 2009 05:08
SnappyHexMesh not generate mesh first time mavimo OpenFOAM Mesh Utilities 4 August 26, 2008 07:08

All times are GMT -4. The time now is 20:52.