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 Surface Refinement (https://www.cfd-online.com/Forums/openfoam-meshing/91973-snappyhexmesh-surface-refinement.html)

laymelek August 29, 2011 04:21

SnappyHexMEsh Surface Refinement
 
1 Attachment(s)
Hi all,

I am trying to mesh a domain using SnappyHexMesh. After meshing is succesfully completed i checked the mesh and some part of the surfaces are not refined althoug other did... i attach my snappyhexmeshdict and add a screenshot of the mesh. Does someone have any idea what can be the reason?


/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.1 |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object snappyHexMeshDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// Which of the steps to run
castellatedMesh true;
snap false;
addLayers false;
 
 
geometry
{
simple.stl
{
convertToMeters 1;
type triSurfaceMesh;
name simple;
}
refinementBox
{
type searchableBox;
min (-50 -300 -300);
max ( 50 300 300);
}
};
 
 
// Settings for the castellatedMesh generation.
castellatedMeshControls
{
// Refinement parameters
// ~~~~~~~~~~~~~~~~~~~~~
maxLocalCells 1000000;
maxGlobalCells 2000000;
minRefinementCells 10;

maxLoadUnbalance 0.10;
 
nCellsBetweenLevels 3;
 
 
// Explicit feature edge refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

features
(
//{
// file "someLine.eMesh";
// level 2;
//}
);
 
 
// Surface based refinement
// ~~~~~~~~~~~~~~~~~~~~~~~~
 
 
refinementSurfaces
{
simple
{
// Surface-wise min and max refinement level
level (5 6);
}
}
// Resolve sharp angles
resolveFeatureAngle 10;
 
// Region-wise refinement
// ~~~~~~~~~~~~~~~~~~~~~~

refinementRegions
{
refinementBox
{
mode inside;
levels ((3 2));
}
}
 
// Mesh selection
// ~~~~~~~~~~~~~~
locationInMesh (-50 -500 -500);
}
 
 
// Settings for the snapping.
snapControls
{

nSmoothPatch 3;

tolerance 4.0;
//- Number of mesh displacement relaxation iterations.
nSolveIter 30;
nRelaxIter 5;
}
 
 
// Settings for the layer addition.
addLayersControls
{

relativeSizes true;

layers
{
}
// Expansion factor for layer mesh
expansionRatio 1.0;

finalLayerThickness 0.3;
minThickness 0.1;

nGrow 1;
 
// Advanced settings

featureAngle 30;

nRelaxIter 3;
// Number of smoothing iterations of surface normals
nSmoothSurfaceNormals 1;
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;
}
 
 
meshQualityControls
{

maxNonOrtho 65;

maxBoundarySkewness 20;
maxInternalSkewness 4;
 
maxConcave 80;

minFlatness 0.5;

minVol 1e-13;
 
minArea -1;
 
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;
 
mergeTolerance 1E-6;
 
// ************************************************** *********************** //

romant August 29, 2011 04:29

did you check that you didn't run into the problem of maximum reached cells? try changing the maximum cells you can have and/or reducing the level to which you refine around surfaces, say (3 4).

laymelek August 29, 2011 05:28

Hi,
thanks for reply.
I checked the number of cells.. its around 700k. still under the limit. But thge strange thing happened.. i deleted all the time steps and meshed again it seems like its working now... but i dont understand i did it lots of times and it was always the same problematic mesh but know its meshing quite well.....

Thanks a lot!

romant August 29, 2011 05:32

Quote:

Originally Posted by laymelek (Post 322051)
Hi,
thanks for reply.
I checked the number of cells.. its around 700k. still under the limit. But thge strange thing happened.. i deleted all the time steps and meshed again it seems like its working now... but i dont understand i did it lots of times and it was always the same problematic mesh but know its meshing quite well.....

Thanks a lot!

the limit that is hit is not the limit after the cells are taken out, but before. meaning that if you have about 700k cells now, there could have been a much larger number before the cells, that you don't need, were removed .

laymelek August 29, 2011 06:05

OK! Now its great info... i will check again. Thanks a lot

JonW August 29, 2011 08:46

addLayers
 
Hi laymelek
I would also recommend that you have

snap true;
addLayers true;

with the latter you have to have

layers
{
simple
{
nSurfaceLayers 3;
}
}

the number 3 is just an example (I usually use this). Note that the name simple in the above might have to be changed, depending on the name of solid in the stl file is.

For example if the designation is "solid voff_2" (edit the stl file and you see this in the first line) and the name of the .stl file is simple.stl, then use

layers
{
simple_voff_2
...


And final comment. Often, my simulation have crashed when using snappy. To solve this is to have small cells in vicinity of wall to handle large grad(U). This means large refinement at surface, say 4 to 5.

Hope this helps:)

val46 August 29, 2011 08:56

Hi,

Quote:

Originally Posted by JonW (Post 322083)
And final comment. Often, my simulation have crashed when using snappy. To solve this is to have small cells in vicinity of wall to handle large grad(U). This means large refinement at surface, say 4 to 5.

Well, surface refinement 4 to 5 says nothing about how fine the mesh is. Have you looked at the yplus values? Maybe you could correlate the yplus values with the crashed simulation? This would be very interesting to me.

JonW August 29, 2011 09:08

Quote:

Originally Posted by val46 (Post 322087)
Hi,



Well, surface refinement 4 to 5 says nothing about how fine the mesh is. Have you looked at the yplus values? Maybe you could correlate the yplus values with the crashed simulation? This would be very interesting to me.

Sorry, I am not using turbulence modeling. My theme is usually non Newt fluid mech, like the HB modell.


All times are GMT -4. The time now is 10:58.