CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] snappyHexMesh minRefinementCells (https://www.cfd-online.com/Forums/openfoam-meshing/220730-snappyhexmesh-minrefinementcells.html)

bullmut September 19, 2019 09:36

snappyHexMesh minRefinementCells
 
1 Attachment(s)
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.


All times are GMT -4. The time now is 18:42.