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

[snappyHexMesh] failing to snap

Register Blogs Community New Posts Updated Threads Search

Like Tree5Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 10, 2020, 10:42
Default
  #21
Senior Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9
Marpole is on a distinguished road
Hello HPE and AtoHM


I simplified the case so I can demonstrate the problem more clearly. Attached are 3 blockMeshDict files. Baseline is that the block has a little space (baffle space) out of STL. Left blockMeshDict is the one with left block side a little inside the STL (0.5mm) and right blockMeshDict is the one with right block side a little inside the STL (0.5mm). Baseline failed to snap and the rest two snap very well. I believe there is a bug in the snappyHexMesh but would like to hear your comments on this.



Kind Regards,
Attached Files
File Type: zip blockMeshDictFiles.zip (1.8 KB, 11 views)
Marpole is offline   Reply With Quote

Old   February 11, 2020, 12:13
Default
  #22
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Dear all,


I am just writing as Charles sent me a message. A short analysis:


  • Just downloaded the case
  • blockMesh
  • Removed featureEdges
  • Added implicit feature edges
  • snappying -> failed
  • blockMesh
  • changed the "empty" patch to wall in the background mesh (you dont't have a 2D mesh)
  • snappying -> fine




Maybe I did not get the point but snappying is fine on my computer.
Attached Images
File Type: jpg Screen.jpg (76.8 KB, 31 views)
Marpole and HPE like this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   February 11, 2020, 13:31
Default
  #23
Senior Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9
Marpole is on a distinguished road
Hi Tobi,


Thank you, I can make the mesh!


Though, I'm still puzzled that snapping works by moving blockmesh side a bit inward into the stl geometry . I checked the boundary file, they are pretty much the same. I will dig deep into it.
Attached Images
File Type: png mesh.png (62.3 KB, 15 views)
Marpole is offline   Reply With Quote

Old   February 11, 2020, 14:24
Default
  #24
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
The outcome you observe is common and known. However, even though I wanted to dig into that already 5 years ago, I never found the time to analyze the code. Furthermore, my background knowledge about meshing strategies and quality criteria calculation is almost zero. In order to provide all patches, it is common practice to make the background mesh a bit larger, otherwise the patch name of the background mesh should be added (maybe I am wrong here).


Actually my steps are always the same:

  • build a well surface triangulation
  • export each patch as stl
  • combine the stl to form a region stl
  • proof of watertightness
  • create the background mesh (fits the whole stl one to one)
  • scale the background mesh by a factor of e.g., 1.005
  • build the snappyHexMeshDict
  • run snappy
  • check the mesh and improve the settings
The workflow given above is done almost automatically (I created some scripts for doing the work). So actually what I do is:


  • Create the STL in Salome
  • Export the STL's
  • Create the background mesh in Salome
  • Export the background mesh
  • Execute `buildRegionSTL`
  • Execute `buildSnappyHexMeshDict`
  • Execute `createSnappyMesh`
Done
Marpole and HPE like this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   February 11, 2020, 14:40
Default
  #25
Senior Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9
Marpole is on a distinguished road
Thanks Tobi, I took a note of your procedure!



My plan to dig deep into the code might be over ambitious. But I can write a python script to automate the process (including Salome).
Marpole is offline   Reply With Quote

Old   July 27, 2022, 10:03
Default
  #26
Member
 
Wolfram Schneider
Join Date: Jan 2018
Location: Germany
Posts: 57
Rep Power: 8
Wolfram is on a distinguished road
Quote:
Originally Posted by HPE View Post
Have you set the refinement level correctly:

`snappy` does not pick the cells for the refinement at the very beginning:

"
Cells per refinement level:
0 98273
"

Also feature, shell refinements are not picked up. hmmm

"
Refinement phase
----------------

Found point (-0.1 0.069 -0.001) in cell 163322 on processor 0

Feature refinement iteration 0
------------------------------

Marked for refinement due to explicit features : 0 cells.
Determined cells to refine in = 3.14 s
Selected for feature refinement : 0 cells (out of 277344)
Stopping refining since too few cells selected.
"

Have you found the reason for this message? I am facing the same issue
Wolfram is offline   Reply With Quote

Old   July 27, 2022, 10:17
Default
  #27
Senior Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 148
Rep Power: 9
Marpole is on a distinguished road
I solved the problem but cannot recall exactly now.

The error message basically says it tried to refine the mesh in the refinement region. But the refinement region is too small that it doesn't have enough initial background cells for refinement. The solution might be to redefine the refinement region to make it larger. Hope it works for you.
__________________
Charles L.
Marpole 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] Failed Edge Snap with box geometry and correct feature capture thiagomarinho OpenFOAM Meshing & Mesh Conversion 7 May 7, 2022 09:19
[snappyHexMesh] problems with sHM: it doesn't snap! Claudio87 OpenFOAM Meshing & Mesh Conversion 25 July 10, 2020 08:06
[snappyHexMesh] snappyHexMesh failing to snap ("did not find surface within...") Jaworski.Mike OpenFOAM Meshing & Mesh Conversion 7 December 2, 2019 20:13
[snappyHexMesh] snappyHexMesh doesnt snap staustrahltriebwerk OpenFOAM Meshing & Mesh Conversion 47 March 18, 2018 14:19
[snappyHexMesh] snappyHexMesh failure to snap to geometry Yadasol OpenFOAM Meshing & Mesh Conversion 1 November 17, 2014 05:00


All times are GMT -4. The time now is 08:20.