|
[Sponsors] |
[snappyHexMesh] SHM refines feature edges partially |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
July 15, 2024, 00:28 |
SHM refines feature edges partially
|
#1 |
Member
Ali B.
Join Date: Mar 2020
Location: abzrg.github.io
Posts: 44
Rep Power: 6 |
Dear all,
I am meshing a rectangular pipe with a cavity on top of it. An image of the domain with feature edges extracted is attached here. I want to refine the mesh on the cavity's edges. The cavity features are extracted using Paraview: using FeatureEdges and ExtractSelected filters, and then converted to surface using ExtractSurface filter. The surface is exported as a VTK file and converted to eMesh file using surfaceFeatureConvert. outline.jpg Then, I set the surface refinement everywhere uniformly (level 2) and set the feature refinement of the cavity to 3, 4, and 5 in multiple attempts. The images below show the refinement level of 5, but the results were similar in that somewhere on few of the edges the mesh was refined below the specified level. I'm totally clueless why this is happening. I would appreciate if anyone could point out what's wrong or I'm missing something (like a parameter needs to be changed in the dictionary). The snappyHexMeshDict dictionary is attached below as well. mesh-is.jpg mesh-2.jpg (Why I'm meshing this using snappyHexMesh and not blockMesh? I'm just learning SHM and tinkering with stuff. ) Code:
/*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: v2312 | | \\ / A nd | Website: www.openfoam.com | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; object snappyHexMeshDict; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // /////////////////////////////////////////////////////////////////////////////// castellatedMesh true; snap false; addLayers false; /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// geometry { pipe.stl { type triSurfaceMesh; name pipe; regions { inlet { name inlet; } outlet { name outlet; } fixedWalls { name fixedWalls; } middle { name middle; } front { name front; } back { name back; } }; } } /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// castellatedMeshControls { maxLocalCells 100000; maxGlobalCells 2000000; minRefinementCells 10; maxLoadUnbalance 0.10; nCellsBetweenLevels 3; features ( { file "pipe.eMesh"; level 2; } { file "cavityRegion.eMesh"; level 5; // <------- } ); refinementSurfaces { pipe { level (0 0); regions { inlet { level (2 2); patchInfo { type path; inGroups (grpPatch); }} outlet { level (2 2); patchInfo { type path; inGroups (grpPatch); }} fixedWalls { level (2 2); patchInfo { type wall; inGroups (grpWall); }} middle { level (2 2); patchInfo { type symmetry; inGroups (grpSymmetry); }} front { level (2 2); patchInfo { type wall; inGroups (grpWall); }} back { level (2 2); patchInfo { type wall; inGroups (grpWall); }} } } } resolveFeatureAngle 30; planarAngle 30; refinementRegions { } locationInMesh (0.05 0.05 0.0); allowFreeStandingZoneFaces true; } /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// snapControls { nSmoothPatch 3; tolerance 2.0; nSolveIter 30; nRelaxIter 5; // Feature snapping nFeatureSnapIter 10; implicitFeatureSnap false; explicitFeatureSnap true; multiRegionFeatureSnap false; } /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// addLayersControls { relativeSizes true; layers { pipe { nSurfaceLayers 1; } } expansionRatio 1.0; finalLayerThickness 0.3; minThickness 0.1; nGrow 0; // Advanced settings featureAngle 130; slipFeatureAngle 30; nRelaxIter 3; nSmoothSurfaceNormals 1; nSmoothNormals 3; nSmoothThickness 10; maxFaceThicknessRatio 0.5; maxThicknessToMedialRatio 0.3; minMedialAxisAngle 90; nBufferCellsNoExtrude 0; nLayerIter 50; } /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// meshQualityControls { #include "meshQualityDict" nSmoothScale 4; errorReduction 0.75; } /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// writeFlags ( scalarLevels layerSets layerFields ); /////////////////////////////////////////////////////////////////////////////// mergeTolerance 1e-6; // ************************************************************************* // // vim: fdm=indent Last edited by reverseila; July 15, 2024 at 02:13. |
|
July 15, 2024, 03:18 |
|
#2 |
Senior Member
M
Join Date: Dec 2017
Posts: 703
Rep Power: 13 |
sHM might reach your specified
Code:
maxGlobalCells 2000000; |
|
July 15, 2024, 13:34 |
|
#3 |
Member
Ali B.
Join Date: Mar 2020
Location: abzrg.github.io
Posts: 44
Rep Power: 6 |
Hi AtoHM, and Thanks for your reply.
I have attached both the snappyHexMesh's log and the checkMesh's log. Total number of cells in the mesh: 400k. |
|
July 16, 2024, 02:20 |
|
#4 | |
Senior Member
M
Join Date: Dec 2017
Posts: 703
Rep Power: 13 |
The parameter maxLocalCells could have the same influence as it specifies the
Quote:
Try setting this above the expected cell count, e.g. 2M too. Other than that I cannot see an error. Check visually that the eMesh file holds all the edges you expect it to have. Try refinement with level 4 first, see it if works. You can also try to set minRefinementCells to 1. This way snappy will always refine until all cells marked for refinement are at the target level. Your log does not state that it stopped with cells left, but its worth a try. |
||
July 16, 2024, 18:05 |
|
#5 |
Member
Ali B.
Join Date: Mar 2020
Location: abzrg.github.io
Posts: 44
Rep Power: 6 |
Thank you AtoHM.
Unfortunately, I've tried all of these, one by one and combined, but none changed the result. I've also changed two other parameters, e.g., nCellsBetweenLevels (3 -> 1), maxBoundarySkewness (20 -> 4) but they didn't help. Other thing I did was to import stl (created in FreeCAD) into Blender, converted the mesh into quad and refined the mesh, and then meshed it with shm, and this too didn't work. At this point I think I'm gonna quit trying further . If you, however, want to check the case let me know please. Last edited by reverseila; July 16, 2024 at 23:06. |
|
July 17, 2024, 03:17 |
|
#6 |
Senior Member
M
Join Date: Dec 2017
Posts: 703
Rep Power: 13 |
Stl is a triangulated surface representation, I wonder how you even exported your quad mesh into stl?
You can upload the stl file and I can try to mesh it. And the eMesh files too. |
|
July 18, 2024, 08:16 |
|
#7 |
Member
Ali B.
Join Date: Mar 2020
Location: abzrg.github.io
Posts: 44
Rep Power: 6 |
The exported STL is indeed a triangulated surface. However, in Blender
using the Remesh modifier, I made a quad mesh out of the FreeCAD's triangulated coarse mesh. Hope you find a solution for this |
|
July 18, 2024, 08:41 |
|
#8 |
Senior Member
M
Join Date: Dec 2017
Posts: 703
Rep Power: 13 |
Yeah still, what did you do with the quad thing afterwards? When you export it to stl or obj again its again split into triangles.
I will try to look at the case over the weekend! |
|
July 18, 2024, 08:51 |
|
#9 |
Member
Ali B.
Join Date: Mar 2020
Location: abzrg.github.io
Posts: 44
Rep Power: 6 |
I thought a finer, more structured, and more uniform mesh would help.
The initial mesh generated by FreeCAD was very coarse and non-uniform. I converted it into quad mesh (more uniform) and then sub-divided it (finer). Now, I really didn't think about it at the time, and I don't know how it is converted to triangles during the export process, but Blender did it for me anyway. Last edited by reverseila; July 19, 2024 at 07:08. |
|
Tags |
feature edge handling, feature refinement, featureedges, snappyhexmesh |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] stringing of feature edges | Hr_kules | OpenFOAM Meshing & Mesh Conversion | 0 | July 22, 2022 09:30 |
[snappyHexMesh] snappyHexMesh - 90° edges problem | troth | OpenFOAM Meshing & Mesh Conversion | 22 | October 22, 2021 11:28 |
[snappyHexMesh] snappyHexMesh stuck when snap is turned on | yukuns | OpenFOAM Meshing & Mesh Conversion | 3 | February 2, 2021 14:05 |
SimpleFoam & Theater | jipai | OpenFOAM Running, Solving & CFD | 3 | June 18, 2019 11:11 |
[snappyHexMesh] Manually define feature edges in SHM | palgroth | OpenFOAM Meshing & Mesh Conversion | 0 | July 9, 2014 05:22 |