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

[snappyHexMesh] Advice on limitations of SHM

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 26, 2021, 07:09
Default Advice on limitations of SHM
  #1
Senior Member
 
Join Date: Apr 2020
Location: UK
Posts: 727
Rep Power: 14
Tobermory will become famous soon enough
Dear Foamers

I have been battling with SHM to get a high quality, sharp mesh around a REALLY simple geometry - a surface mounted cube. I can generate a snapped mesh, no problem - the cube surfaces in the snapped mesh are all planar and the edges are located where expected. So far so good. Now I try and add the tiniest of layers at the base, and SHM seems to struggle with the edges at the top of the cube - these move, I guess as part of the mesh shrinkage to make room for the layer ... but there's nothing that I can do to encourage the edges to snap back to their proper place. See the attached plots for pictures of this. I know that the distortion is minor, but it bugs me and I want the corners/edges in the right place.

So here's my question - am I just inexperienced with SHM (that's true by the way) and have poor settings, or is SHM really this limited in what it can achieve? (I am not dishing SHM ... I just want to know the extent of its capabilities).

Re: my settings, I have the following in my surfaceFeaturesDict:
Code:
surfaces ("cube.stl");
includedAngle       150;
subsetFeatures
{
    nonManifoldEdges       no;
    openEdges       yes;
}
and my snappyHexMeshDict is:
Code:
castellatedMesh true;
snap            true;
addLayers       true;

geometry { 
    cube
    {
        type triSurfaceMesh;
        file "cube.stl";
    }


    refBox1
    {
        type            searchableBox;
        min             (-0.9 -0.9   0);
        max             ( 2.5  0.9 1.5);
    }

    refBox2
    {
        type            searchableBox;
        min             ( -2  -2    0);
        max             (  6   2  1.8);
    }

    refBox3
    {
        type            searchableBox;
        min             ( -3  -3    0);
        max             ( 10   3  2.4);
    }
};


castellatedMeshControls  {
	maxLocalCells 1000000;			//default 100000;
	maxGlobalCells 5000000;			//default 2000000;
	minRefinementCells 10;
	maxLoadUnbalance 0.10;
	nCellsBetweenLevels 5;

	//feature edge refinement - eMesh read from constant/triSurface
	features ( 		
		{ file "cube.eMesh"; level 4; }
	);

	//surface refinement
	refinementSurfaces {
	    cube { level (4 4);  patchInfo {type wall;} }
	}
	resolveFeatureAngle 30;

	//volume refinement
	refinementRegions { 
		refBox1 { mode inside; levels ((3 3)); } 
		refBox2 { mode inside; levels ((2 2)); } 
		refBox3 { mode inside; levels ((1 1)); } 
	}
	
	//other mesh parameters
	locationInMesh (1 0 1);
	allowFreeStandingZoneFaces true;
}


snapControls {
	nSmoothPatch 3;
	tolerance 2.0;
	nSolveIter 30;
	nRelaxIter 5;
	nFeatureSnapIter 10;
	implicitFeatureSnap false;
	explicitFeatureSnap true;
	multiRegionFeatureSnap false;
}

addLayersControls {
	relativeSizes false;
	expansionRatio 1.2;
	firstLayerThickness 0.004;
	//finalLayerThickness 0.136;
	//thickness 0.25;
	minThickness 0.001;
	layers { 
	    ground { nSurfaceLayers  1; }
	}
	nGrow 0;
	featureAngle 60;
	slipFeatureAngle 30;
	nRelaxIter 3;
	nSmoothSurfaceNormals 1;
	nSmoothNormals 3;
	nSmoothThickness 10;
	maxFaceThicknessRatio 0.5;
	maxThicknessToMedialRatio 0.3;
	minMedianAxisAngle 90;
	nBufferCellsNoExtrude 0;
	nLayerIter 50;
}

meshQualityControls { #include "meshQualityDict" }
writeFlags ( scalarLevels    layerSets     layerFields );
mergeTolerance 1e-6;
.

Any suggestions/comments on how to get SHM to preserve the geometry in the rest of the mesh during layer addition would be gratefully received.

Oh - and one more thing - and this is blowing my mind - when I plot the mesh in paraview, load in the cell coordinates (after running writeCellCentres) and pick off the coordinates of the upper edges, paraview reports these as having z<1 (cube top surface is at z=1), despite paraview clearly showing that these vertices are at z>1! What on earth is going on there?
Attached Images
File Type: jpg mesh2.jpg (200.0 KB, 11 views)
File Type: jpg mesh4.jpg (37.5 KB, 10 views)
File Type: jpg mesh7annotated.jpg (98.2 KB, 12 views)
Tobermory 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
[snappyHexMesh] trying to get a good mesh with SHM for about two weeks now tobiaslindstrom OpenFOAM Meshing & Mesh Conversion 1 November 7, 2016 02:39
[snappyHexMesh] SHM not snapping to some surfaces Swift OpenFOAM Meshing & Mesh Conversion 13 January 4, 2016 01:56
[snappyHexMesh] 2D AMI Moving Mesh with sHM; How hard can this be? ADGlassby OpenFOAM Meshing & Mesh Conversion 18 June 18, 2013 06:07
[snappyHexMesh] SHM: feature edge snapping not conforming thab OpenFOAM Meshing & Mesh Conversion 3 November 26, 2012 14:04
[snappyHexMesh] Multi Region Meshing with sHM marango OpenFOAM Meshing & Mesh Conversion 3 March 27, 2012 00:51


All times are GMT -4. The time now is 23:59.