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

[snappyHexMesh] snappyHexMesh makes too many patches from STL?

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 26, 2022, 17:41
Default snappyHexMesh makes too many patches from STL?
  #1
New Member
 
David
Join Date: Dec 2021
Posts: 4
Rep Power: 4
dbazz is on a distinguished road
When trying to create a mesh with sHM from an STL file, thousands of patches and regions are generated - too many!



Adding patches for surface regions:
----------------------------------


Patch Type Region
----- ------ -------
model10m;


6 wall model10m_patch0
7 wall model10m_patch1
8 wall model10m_patch2
...
30000 wall model10m_patch30000


The meshing process should take a few minutes, but when this issue occurs, it can take hours to generate the same mesh.



I found that is issue occurs when an STL is encoded in binary. When the STL is encoded in ASCII, this issue does not occur. To prevent this issue, you can open the mesh in software like AutoCAD Fusion, import the binary STL, and save the STL as ASCII (which you can open with a simple text editor).


I have solved my own problem but I thought I should post the question and solution here, as I could not find anything to help troubleshoot the problem.
dbazz is offline   Reply With Quote

Old   June 22, 2022, 01:05
Default
  #2
New Member
 
Clemens Goessnitzer
Join Date: Nov 2021
Posts: 6
Rep Power: 4
cgoessni is on a distinguished road
Hi dbazz!


Did you find out what the problem was?
cgoessni is offline   Reply With Quote

Old   June 22, 2022, 09:05
Default
  #3
New Member
 
David
Join Date: Dec 2021
Posts: 4
Rep Power: 4
dbazz is on a distinguished road
Yes - the STL I was working with was in binary format. It needs to be in ASCII format to be friendly with SHM tools
dbazz is offline   Reply With Quote

Old   June 22, 2022, 09:56
Default
  #4
New Member
 
Clemens Goessnitzer
Join Date: Nov 2021
Posts: 6
Rep Power: 4
cgoessni is on a distinguished road
Okay, I want to stay with the binary format, since it is much faster, smaller in file size and more precise. I can live with the many patches now, since in my case there are only two, and not 10,000s.


Thanks for your answer.
cgoessni is offline   Reply With Quote

Old   July 13, 2022, 07:54
Default
  #5
New Member
 
Clemens Goessnitzer
Join Date: Nov 2021
Posts: 6
Rep Power: 4
cgoessni is on a distinguished road
Update: If you set the attribute to another value than 0, you will get as many patches as you set the number of attributes:
https://bugs.openfoam.org/view.php?id=3860


If you use numpy-stl, you can set the attribute to 0 by
mesh.attr = 0


That resolved my problem.
cgoessni is offline   Reply With Quote

Reply

Tags
ascii binary format, patches, regions, snappyhexmesh, stl


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] snappyHexMesh error "Cannot determine normal vector from patches." lethu OpenFOAM Meshing & Mesh Conversion 1 June 3, 2020 07:49
[mesh manipulation] createpatch not working when using layer addition in snappyHexMesh Dikkeunit OpenFOAM Meshing & Mesh Conversion 0 February 3, 2020 09:46
[snappyHexMesh] Creating baffes with snappyHexMesh BBack OpenFOAM Meshing & Mesh Conversion 0 September 22, 2019 05:10
[surface handling] How to make boundary patches in STL file nzy102 OpenFOAM Meshing & Mesh Conversion 4 January 22, 2018 15:03
[snappyHexMesh] Patch Names in STL file for snappyHexMesh Kattie OpenFOAM Meshing & Mesh Conversion 11 October 18, 2011 11:05


All times are GMT -4. The time now is 12:10.