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

[snappyHexMesh] Celllevel does not satisfy 2:1 constraint

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 3, 2023, 13:47
Default Celllevel does not satisfy 2:1 constraint
  #1
New Member
 
Join Date: Jan 2023
Posts: 1
Rep Power: 0
zippy is on a distinguished road
Hi there,

I've recently begun getting an Abort Error when I run snappyHexMesh:

Celllevel does not satisfy 2:1 constraint. On face 109 owner cell 19 has refinement 0 neighbour cell 32 has refinement 3

I think that it wants be to change my settings in the snappyHexMeshDict so that the difference between refinement levels between cells is of the ratio 2:1 but I'm not sure how to do this. I've returned all my settings back to the values they had the last time the case ran successfully and still I'm not having any luck.

If anybody could educate me on what settings are best to adjust to affect the refinement levels that would be great.

I've included the full log.snappyHexMesh and the full snappyHexMeshDict file below.

Thanks!

This is the full log.snappyHexMeshFile:

/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 8
\\/ M anipulation |
\*---------------------------------------------------------------------------*/
Build : 8-1c9b5879390b
Exec : snappyHexMesh -overwrite
Date : Jan 03 2023
Time : 17:30:13
Host : "DESKTOP-BJRHRQE"
PID : 5423
I/O : uncollated
Case : /home/shamirabh/OpenFOAM/shamirabh-8/run/f1Car
nProcs : 1
sigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).
fileModificationChecking : Monitoring run-time modified files using timeStampMaster (fileModificationSkew 10)
allowSystemOperations : Allowing user-supplied system call operations

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 0

Read mesh in = 3.98 s

Overall mesh bounding box : (-16.56 0 -0.000409582) (53.28 15.9478 16.32)
Relative tolerance : 1e-06
Absolute matching distance : 7.34732e-05

Reading refinement surfaces.
Read refinement surfaces in = 2.65 s

Reading refinement shells.
Read refinement shells in = 0 s

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

Reading features.
Read edgeMesh ActionCar.eMesh
points : 25980
edges : 26097
boundingBox : (-1.32552 -0.996742 0.045) (4.35 0.996742 1.02)

Refinement level according to distance to "ActionCar.eMesh" (25980 points, 26097 edges).
level 6 for all cells within 0 metre.
Read edgeMesh f1CarFrontRightWheel.eMesh
points : 2392
edges : 2392
boundingBox : (-0.296197 0.639406 -1.31131e-08) (0.296197 1.0013 0.694427)

Refinement level according to distance to "f1CarFrontRightWheel.eMesh" (2392 points, 2392 edges).
level 6 for all cells within 0 metre.
Read edgeMesh f1CarRearRightWheel.eMesh
points : 2579
edges : 2575
boundingBox : (3.25047 0.553532 -1.31131e-08) (3.94953 0.997027 0.685191)

Refinement level according to distance to "f1CarRearRightWheel.eMesh" (2579 points, 2575 edges).
level 6 for all cells within 0 metre.
Read features in = 0.06 s


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

hexRef8 : Dumping cell as obj to "/home/shamirabh/OpenFOAM/shamirabh-8/run/f1Car/cell_19.obj"
hexRef8 : Dumping cell as obj to "/home/shamirabh/OpenFOAM/shamirabh-8/run/f1Car/cell_32.obj"


--> FOAM FATAL ERROR:
Celllevel does not satisfy 2:1 constraint.
On face 109 owner cell 19 has refinement 0 neighbour cell 32 has refinement 3

From function void Foam::hexRef8::checkRefinementLevels(Foam::label, const labelList&) const
in file polyTopoChange/polyTopoChange/hexRef8/hexRef8.C at line 4851.

FOAM aborting

#0 Foam::error:rintStack(Foam::Ostream&) at ??:?
#1 Foam::error::abort() at ??:?
#2 Foam::hexRef8::checkRefinementLevels(int, Foam::List<int> const&) const at ??:?
#3 Foam::hexRef8::hexRef8(Foam:olyMesh const&, bool) at ??:?
#4 Foam::meshRefinement::meshRefinement(Foam::fvMesh& , double, bool, Foam::refinementSurfaces const&, Foam::refinementFeatures const&, Foam::shellSurfaces const&) at ??:?
#5 ? in "/opt/openfoam8/platforms/linux64GccDPInt32Opt/bin/snappyHexMesh"
#6 __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#7 ? in "/opt/openfoam8/platforms/linux64GccDPInt32Opt/bin/snappyHexMesh"
Aborted


This is my full snappyHexMeshDict:

/*--------------------------------*- C++ -*----------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Version: 8
\\/ 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
{
ActionCar
{
type triSurfaceMesh;
file "ActionCar.stl";
}

f1CarFrontRightWheel
{
type triSurfaceMesh;
file "f1CarFrontRightWheel.stl";
}

f1CarRearRightWheel
{
type triSurfaceMesh;
file "f1CarRearRightWheel.stl";
}

// refinementBox
// {
// type searchableBox;
// min (-5.0 -80.0 -5.0);
// max ( 20.0 20.0 25.0);
// }
};



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

// 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 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.
features
(
{
file "ActionCar.eMesh";
level 6;
}

{
file "f1CarFrontRightWheel.eMesh";
level 6;
}

{
file "f1CarRearRightWheel.eMesh";
level 6;
}
);



// 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
{
ActionCar
{
// Surface-wise min and max refinement level
level (5 6); //(min amount the block will split max amount the block will split)

// Optional specification of patch type (default is wall). No
// constraint types (cyclic, symmetry) etc. are allowed.
patchInfo
{
type wall;
inGroups (carGroup);
}
}

f1CarFrontRightWheel
{
// Surface-wise min and max refinement level
level (5 6);
patchInfo
{
type wall;
inGroups (carGroup);
}
}

f1CarRearRightWheel
{
// Surface-wise min and max refinement level
level (5 6);
patchInfo
{
type wall;
inGroups (carGroup);
}
}
}

// 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
{
// refinementBox
// {
// mode inside;
// levels ((5 6));
// }
}


// 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 (0 0 0.05);




// Whether any faceZones (as specified in the refinementSurfaces)
// are only on the boundary of corresponding cellZones or also allow
// free-standing zone faces. Not used if there are no faceZones.
allowFreeStandingZoneFaces true;
}



// Settings for the snapping.
snapControls
{
//- Number of patch smoothing iterations before finding correspondence
// to surface
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 1.0;

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

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

// Feature snapping

//- Number of feature edge snapping iterations.
// Leave out altogether to disable.
nFeatureSnapIter 10;

//- Detect (geometric only) features by sampling the surface
// (default=false).
implicitFeatureSnap false;

//- Use castellatedMeshControls::features (default = true)
explicitFeatureSnap true;

//- Detect points on multiple surfaces (only for explicitFeatureSnap)
multiRegionFeatureSnap false;
}



// Settings for the layer addition.
addLayersControls
{
// Are the thickness parameters below relative to the undistorted
// size of the refined cell outside layer (true) or absolute sizes (false).
relativeSizes true;

// Per final patch (so not geometry!) the layer information
layers
{
"ActionCar.*"
{
nSurfaceLayers 3;
}

// "f1CarFrontRightWheel.*"
// {
// nSurfaceLayers 3;
// }
//
// "f1CarRearRightWheel.*"
// {
// nSurfaceLayers 3;
// }
}

// Expansion factor for layer mesh
expansionRatio 1.0;

// 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.
// See relativeSizes parameter.
finalLayerThickness 0.3;

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

// 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.
// Note: changed(corrected) w.r.t 17x! (didn't do anything in 17x)
nGrow 0;

// Advanced settings

// When not to extrude surface. 0 is flat surface, 90 is when two faces
// are perpendicular
featureAngle 60;

// At non-patched sides allow mesh to slip if extrusion direction makes
// angle larger than slipFeatureAngle.
slipFeatureAngle 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
// Note: changed(corrected) w.r.t 17x! 90 degrees corresponds to 130 in 17x.
minMedianAxisAngle 90;


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


// Overall max number of layer addition iterations. The mesher will exit
// if it reaches this number of iterations; possibly with an illegal
// mesh.
nLayerIter 50;
}



// Generic mesh quality settings. At any undoable phase these determine
// where to undo.
meshQualityControls
{
#include "meshQualityDict"
}


// Advanced

// Write flags
writeFlags
(
scalarLevels
layerSets
layerFields // write volScalarField for layer coverage
);


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


// ************************************************** *********************** //
zippy is offline   Reply With Quote

Old   July 30, 2024, 06:58
Default
  #2
New Member
 
Ashish Singh
Join Date: Feb 2024
Posts: 3
Rep Power: 2
sinsinwar is on a distinguished road
Try removing the cellLevel file from constant/polyMesh directory.
sinsinwar is offline   Reply With Quote

Reply

Tags
2:1 ratio, celllevel, refinement level


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
Add a constraint equation sebastien.cadalen OpenFOAM Running, Solving & CFD 2 September 21, 2021 07:26
rhoSimpleFoam pressure P is not satisfy perfect gas state equation at inlet patch fxzf OpenFOAM Running, Solving & CFD 0 September 18, 2017 07:40
[Other] cellLevel field not readable by topoSet blaise OpenFOAM Meshing & Mesh Conversion 0 June 30, 2015 05:35
New sixDoFRigidBody BC working with laplaceFaceDecomposition Ya_Squall2010 OpenFOAM Running, Solving & CFD 13 April 17, 2013 03:04
Breaking of constraint conditions lt.quibbler OpenFOAM Running, Solving & CFD 0 January 13, 2012 09:28


All times are GMT -4. The time now is 03:48.