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

[snappyHexMesh] First try at snappyHexMesh... jaggies, weirdness and missing boundary layers :(

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 29, 2016, 22:10
Default First try at snappyHexMesh... jaggies, weirdness and missing boundary layers :(
  #1
Member
 
Anonymouse
Join Date: Dec 2015
Posts: 98
Rep Power: 11
KarenRei is on a distinguished road
So, I've been working on getting snappyHexMesh to work for about a day and a half now. While I've worked through a lot of problems, I think I've gotten myself to a roadblock

I start with a gradiation-biased simple rectangular domain for the blockmesh, with higher levels of division in a more computation sensitive region. I use surfaceFeatureExtract on the stl (and it indeed extracts all of the edges), then snappyHexMesh. My configuration file is set up to try to create a moderate level of subdivision around the "inert" sections and a high level of subdivision around the "engine" subdivision. It's also supposed to create a couple layers of surface-aligned cells.

What actually happens is that it generates a jagged mess. I can manage to get rid of most (but not all) of the jaggies in the edge section by increasing nCellsBetweenLevels, but that makes the top inert areas worse. There seems to be no difference in the level of cell tesselation between the engine layers and the snappyHexMesh does nothing to attempt creating a surface layer. The actions of snappyHexMesh also makes the already rather skewed cells at the top skewed beyond recognition.

Hmm.

Thoughts on how to get a clean mesh out of this, that's still with a higher degree of tesselation at and below the "engine" area? I feel like I've messed with every parameter in the dictionary about a dozen times...
Attached Images
File Type: jpg eldflaug5.jpg (44.0 KB, 24 views)
File Type: png eldflaug6.png (37.8 KB, 34 views)
File Type: png eldflaug7.png (23.3 KB, 29 views)
File Type: png eldflaug8.png (31.0 KB, 34 views)
Attached Files
File Type: gz tmp.tar.gz (6.0 KB, 1 views)
KarenRei is offline   Reply With Quote

Old   September 29, 2016, 22:13
Default
  #2
Member
 
Anonymouse
Join Date: Dec 2015
Posts: 98
Rep Power: 11
KarenRei is on a distinguished road
More pics (including of the raw blockMesh before snapping), and a trimmed version of the dictionary:

FoamFile
{
version 2.0;
format ascii;
class dictionary;
object snappyHexMeshDict;
}

convertToMeters 1.0;

castellatedMesh true;
snap true;
addLayers true;

geometry
{
rocket.stl
{
type triSurfaceMesh;
regions
{
inert
{
name inert;
}
engine_0_1
{
name engine_0_1;
}
...
engine_21_22
{
name engine_21_22;
}
}
}

bounds
{
type searchableBox;
min (0.0 -10.172217 -0.5);
max (4.592441 13.795547 0.5);
}
};

snapControls
{
nSmoothPatch 3;
tolerance 2.0;
nSolveIter 50;
nRelaxIter 5;
nFeatureSnapIter 10;
implicitFeatureSnap false;
explicitFeatureSnap true;
multiRegionFeatureSnap true;
};
castellatedMeshControls
{
maxLocalCells 500;
maxGlobalCells 15000;
minRefinementCells 100;
maxLoadUnbalance 0.10;
nCellsBetweenLevels 2;
resolveFeatureAngle 60;
locationInMesh (0.1 1 0);
allowFreeStandingZoneFaces true;

features
(
{
file "rocket.eMesh";
level 2;
}
);

refinementSurfaces
{
rocket.stl
{
level (0 2);
regions
{
inert
{
type wall;
level (1 2);
}
engine_0_1
{
type inlet;
level (2 5);
}
...
engine_21_22
{
type inlet;
level (2 5);
}
}
}
};

refinementRegions
{
rocket.stl
{
mode distance;
levels ((0.05 5) (0.2 2));
}

bounds
{
mode inside;
levels ((1.0 2));
}
};
};

addLayersControls
{
layers rocket.stl;
relativeSizes false;
firstLayerThickness 0.01;
thickness 0.04;
minThickness 0.001;
nGrow 0;
featureAngle 60;
nRelaxIter 5;
nSmoothSurfaceNormals 1;
nSmoothNormals 3;
nSmoothThickness 10;
maxFaceThicknessRatio 0.5;
maxThicknessToMedialRatio 0.3;
minMedianAxisAngle 90;
nBufferCellsNoExtrude 0;
nLayerIter 50;
nRelaxedIter 20;
layers
{
inert
{
nSurfaceLayers 2;
firstLayerThickness 0.05;
thickness 0.3;
};
engine_0_1
{
nSurfaceLayers 2;
firstLayerThickness 0.01;
thickness 0.04;
};
...
engine_21_22
{
nSurfaceLayers 2;
firstLayerThickness 0.01;
thickness 0.04;
};
};
};

meshQualityControls
{
nSmoothScale 3;
errorReduction 0.75;
maxNonOrtho 65;
maxBoundarySkewness 20;
maxInternalSkewness 4;
maxConcave 80;
minVol 1e-13;
minTetQuality 1e-9;
minArea -1;
minTwist 0.05;
minDeterminant 0.001;
minFaceWeight 0.05;
minVolRatio 0.01;
minTriangleTwist -1;
relaxed
{
maxNonOrtho 75;
}
};

mergeTolerance 1e-6;



I'll note that I don't want super-high resolution.
Attached Images
File Type: png eldflaug8.png (31.0 KB, 12 views)
File Type: png eldflaug9.png (17.6 KB, 7 views)
File Type: png eldflaug10.png (21.0 KB, 7 views)
File Type: png eldflaug11.png (12.5 KB, 8 views)
KarenRei is offline   Reply With Quote

Old   September 29, 2016, 22:48
Default
  #3
Member
 
Anonymouse
Join Date: Dec 2015
Posts: 98
Rep Power: 11
KarenRei is on a distinguished road
Hmm, please ignore this for now.... I may have made some progress.... we'll see where it leads.
KarenRei is offline   Reply With Quote

Old   September 30, 2016, 01:05
Default
  #4
Member
 
Anonymouse
Join Date: Dec 2015
Posts: 98
Rep Power: 11
KarenRei is on a distinguished road
Okay, I've successfully resolved most of the above. The key takeaways:

1) Never deliberately set maxGlobalCells small to limit cell counts; it causes bad things. You need to limit the tesselation level.

2) Don't adjust cell sizes with grading of the blockmesh; adjust it with searchableBox and searchableSphere elements.

3) refinementSurfaces levels don't cause tesselation.


Anyway, only one issue remaining. See the screenshot - I'm getting random thin triangles around. I need to either dissolve them somehow or prevent their formation. Any clue how to do this?
Attached Images
File Type: png eldflaug12.png (24.9 KB, 31 views)
KarenRei is offline   Reply With Quote

Old   October 15, 2016, 20:42
Default
  #5
Member
 
Anonymouse
Join Date: Dec 2015
Posts: 98
Rep Power: 11
KarenRei is on a distinguished road
Okay, some more takeaways from my progress:

1) Your blockmesh patch types matter when you extrude. I fixed a lot of problems from switching from type "symmetryPlane" to "patch". Why? Not a clue.

2) I finally got a very clean mesh by doing a double extrude - once linearly, the second as a wedge - but you have to do it *exactly right* for this to work. Your linearDirection extrusion should be from sourcePatches (far) to exposedPatchName near, while the wedge extrusion goes near to far. I also do a collapseEdges after snappy and after the second extrusion, though I don't know that they're needed.

3) I made a big improvement in my mesh quality by changing error reduction from 0.75 to 0.95.

4) Most of the remaining errors were concavity. I found that significantly reducing the concavity limit from the usual ~80 down to the lower tens or even less helps a lot. The tradeoff is that if you go too low, the shape stops matching your mesh as well.

5) I omitted having a surface layer; it only seemed to cause problems, and really wasn't needed.

The only errors I have left are the unavoidable concave cell errors where the block resolution changes. These do not seem to cause problems. Otherwise the mesh quality is excellent - including a max non-orthogonality of only 36.
KarenRei 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



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