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

[snappyHexMesh] snappyHexMesh minRefinementCells

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 19, 2019, 09:36
Default snappyHexMesh minRefinementCells
  #1
Member
 
Gareth
Join Date: Jun 2010
Posts: 56
Rep Power: 15
bullmut is on a distinguished road
Hi All


I am trying to figure out if the minRefinement feature in sanppyHexMesh is functional.
Quote:
/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 6
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object snappyHexMeshDict;
}

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

// 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
{
G.stl
{
type triSurfaceMesh;
name Box;
regions
{
Inlet
{
name Inlet;
}
Outlet
{
name Outlet;
}
rig
{
name rig;
}
port
{
name port;
}
t_in
{
name t_in;
}
t_out
{
name t_out;
}
exhaust
{
name exhaust;
}
Walls
{
name walls;
}
}
}
};


// Settings for the castellatedMesh generation.
castellatedMeshControls
{

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

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

// 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 3;
features
(
{
file "Walls.eMesh";
level 6;
}
{
file "Inlet.eMesh";
level 4;
}
{
file "Outlet.eMesh";
level 4;
}
{
file "Lower_port.eMesh";
level 4;
}
{
file "turbine_walls.eMesh";
level 4;
}
{
file "turbine_inlet.eMesh";
level 4;
}
{
file "turbine_outlet.eMesh";
level 4;
}
{
file "exhaust_outlet.eMesh";
level 4;
}
);




refinementSurfaces
{
Box
{
level (2 5);

regions
{
Inlet
{
level (3 3);
patchInfo{type patch;}
}
Outlet
{
level (3 3);
patchInfo{type patch;}
}
rig
{
level (3 3);
patchInfo{type patch;}
}
port
{
level (3 3);
patchInfo{type patch;}
}
t_in
{
level (3 3);
patchInfo{type patch;}
}
t_out
{
level (3 3);
patchInfo{type patch;}
}
exhaust
{
level (3 3);
patchInfo{type patch;}
}
Box_Walls
{
level (5 6);
patchInfo{type wall;}
}
}
}

}


resolveFeatureAngle 30;


refinementRegions
{

}


locationInMesh (3 3 3);

allowFreeStandingZoneFaces false;
}




snapControls
{

nSmoothPatch 4;


tolerance 2;


nSolveIter 30;


nRelaxIter 5;


nFeatureSnapIter 10;
}



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

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

expansionRatio 1.1;

finalLayerThickness 0.3;

minThickness 0.05;

nGrow 0;
featureAngle 60;

nRelaxIter 3;

nSmoothSurfaceNormals 1;

nSmoothNormals 3;

nSmoothThickness 2;

maxFaceThicknessRatio 0.5;


maxThicknessToMedialRatio 1;

minMedianAxisAngle 90;
nBufferCellsNoExtrude 0;

nLayerIter 50;
}

meshQualityControls
{

maxNonOrtho 65;
maxBoundarySkewness 20;
maxInternalSkewness 4;


maxConcave 80;

minVol 1e-13;

minTetQuality 1;
minArea -1;
minTwist 0.05;
minDeterminant 0.001
minFaceWeight 0.05;
minVolRatio 0.01;
minTriangleTwist -1;

nSmoothScale 4;

errorReduction 0.75;
}
mergeTolerance 1e-6;


// ************************************************** *********************** //
This would be my snappyHexMeshDict. As you can see i set the min number of cells to refine at 5. I expect it to stop performing fetaure iterations once the following line is printed in the log:

Marked for refinement due to explicit features : 4 cells.


However from the attached log file you can see it just keep ticking on.
I thought once it find less than the specified number of cells it would at most perform one more iteration and then stop. For example iteration 22 - 23, in the attached file. I have copied that particular section here for ease of reading.
Quote:
Feature refinement iteration 22
------------------------------

Marked for refinement due to explicit features : 2 cells.
Determined cells to refine in = 23.23 s
Selected for feature refinement : 4 cells (out of 9712249)
Edge intersection testing:
Number of edges : 34066119
Number of edges to retest : 358
Number of intersected edges : 3987980
Refined mesh in = 13.12 s
After refinement feature refinement iteration 22 : cells:9712277 faces:34066119 points:15136146
Cells per refinement level:
0 981310
1 98976
2 275530
3 748674
4 1834349
5 3023150
6 2750288
Balanced mesh in = 63.61 s
After balancing feature refinement iteration 22 : cells:9712277 faces:34066119 points:15136146
Cells per refinement level:
0 981310
1 98976
2 275530
3 748674
4 1834349
5 3023150
6 2750288

Feature refinement iteration 23
------------------------------

Marked for refinement due to explicit features : 2 cells.
Determined cells to refine in = 24.62 s
Selected for feature refinement : 2 cells (out of 9712277)
Edge intersection testing:
Number of edges : 34066158
Number of edges to retest : 212
Number of intersected edges : 3987983
Refined mesh in = 13.26 s
After refinement feature refinement iteration 23 : cells:9712291 faces:34066158 points:15136157
Cells per refinement level:
0 981310
1 98976
2 275530
3 748674
4 1834349
5 3023148
6 2750304
Balanced mesh in = 63.06 s
After balancing feature refinement iteration 23 : cells:9712291 faces:34066158 points:15136157
Cells per refinement level:
0 981310
1 98976
2 275530
3 748674
4 1834349
5 3023148
6 2750304

Feature refinement iteration 24
------------------------------
But as you can see it started on iteration 24.
If i am not understanding the minRefienement word in the dictionary could someone explain it to me please.
Thanks in adv.
Attached Files
File Type: txt snappyHexMesh.txt (28.2 KB, 0 views)
bullmut 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
[CAD formats] Creating waterproof STL using snappyHexMesh or salome Tobi OpenFOAM Meshing & Mesh Conversion 58 May 13, 2020 06:01
[snappyHexMesh] Running snappyHexMesh in parallel - optimizing peterhess OpenFOAM Meshing & Mesh Conversion 2 January 3, 2018 02:54
[snappyHexMesh] Tutorial crashes: snappyHexMesh floating point exception. jasv OpenFOAM Meshing & Mesh Conversion 4 May 10, 2016 02:55
[snappyHexMesh] snappyhexmesh doesn't creat mesh in parallel issue? klausb OpenFOAM Meshing & Mesh Conversion 1 March 7, 2015 11:55
[snappyHexMesh] stitchMesh and snappyHexMesh gdbaldw OpenFOAM Meshing & Mesh Conversion 0 December 23, 2009 02:09


All times are GMT -4. The time now is 09:26.