|
[Sponsors] |
[snappyHexMesh] First try at snappyHexMesh... jaggies, weirdness and missing boundary layers :( |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 29, 2016, 22:10 |
First try at snappyHexMesh... jaggies, weirdness and missing boundary layers :(
|
#1 |
Member
Anonymouse
Join Date: Dec 2015
Posts: 98
Rep Power: 10 |
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... |
|
September 29, 2016, 22:13 |
|
#2 |
Member
Anonymouse
Join Date: Dec 2015
Posts: 98
Rep Power: 10 |
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. |
|
September 29, 2016, 22:48 |
|
#3 |
Member
Anonymouse
Join Date: Dec 2015
Posts: 98
Rep Power: 10 |
Hmm, please ignore this for now.... I may have made some progress.... we'll see where it leads.
|
|
September 30, 2016, 01:05 |
|
#4 |
Member
Anonymouse
Join Date: Dec 2015
Posts: 98
Rep Power: 10 |
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? |
|
October 15, 2016, 20:42 |
|
#5 |
Member
Anonymouse
Join Date: Dec 2015
Posts: 98
Rep Power: 10 |
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. |
|
|
|