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 Members List Search Today's Posts Mark Forums Read

Like Tree5Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 6, 2020, 01:55
Default failing to snap
  #1
Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 54
Rep Power: 5
Marpole is on a distinguished road
I have a strange problem. I used snappyHexMesh to generate mesh. It failed to snap. When I reduce a block size in blockMesh by 2mm, it snaps well. (see attached plot). When it failed, I have not found any error message. I attached code here as well (two blockMeshDict are a.blockMeshDict and b.blockMeshDict. you need to copy it to blockMeshDict in order to run). Any help is appreciated.


Regards,
Attached Images
File Type: png mesh1.png (121.2 KB, 26 views)
File Type: jpg mesh2.jpg (130.9 KB, 23 views)
Attached Files
File Type: zip modelV2e.zip (66.2 KB, 3 views)
Marpole is offline   Reply With Quote

Old   February 6, 2020, 02:55
Default
  #2
Senior Member
 
M
Join Date: Dec 2017
Posts: 227
Rep Power: 5
AtoHM is on a distinguished road
Seen this a view times and - as you mentioned - I determined it can originate from a "bad" block mesh. How do you set that up?
Get the max bounding box of the STL file and add just a bit of material in each direction, so the block mesh covers a bit more space than the geometry.



Also, make sure your "point inside" is correctly located inside domain AND does not coincide with a face or node (use coordinate values like 0.0124 instead of 0).
HPE likes this.
AtoHM is offline   Reply With Quote

Old   February 6, 2020, 12:37
Default
  #3
Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 54
Rep Power: 5
Marpole is on a distinguished road
Thanks AtoHM for your comments.



I checked and am sure that the seed point is inside: locationInMesh (-0.100 0.069 -0.001);


Bound of STL is an interesting question.



STL x bound is from -0.114 to 0.114. If I used -0.116 or -0.120 as the block left, to have a bit more space, it wouldn't snap. But if I used -0.114 or -0.110, it snaps well for the rest surface. Of course, it wouldn't see the left surface. This is where I get confused.



BR
Marpole is offline   Reply With Quote

Old   February 7, 2020, 02:09
Default
  #4
Senior Member
 
M
Join Date: Dec 2017
Posts: 227
Rep Power: 5
AtoHM is on a distinguished road
When you have a background mesh of 2mm and try -0.016, the first cell covers exactly the space up to -0.014, which might cause this. Try -0.015 to 0.015 for the background mesh and see what happens.
AtoHM is offline   Reply With Quote

Old   February 7, 2020, 02:24
Default
  #5
Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 54
Rep Power: 5
Marpole is on a distinguished road
Thanks again.



I tried with -0.115. It failed to snap. I was surprised that there is no error message on snapping failure.
Marpole is offline   Reply With Quote

Old   February 7, 2020, 04:00
Default
  #6
Senior Member
 
M
Join Date: Dec 2017
Posts: 227
Rep Power: 5
AtoHM is on a distinguished road
Hm, then it must be something else. Can you share your sHM dict?
AtoHM is offline   Reply With Quote

Old   February 7, 2020, 11:06
Default
  #7
Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 54
Rep Power: 5
Marpole is on a distinguished road
The model was attached in my first post ( modelV2e.zip), where blockMeshDict is included. There are two blockMeshDict files: a.blockMeshDict and b.blockMeshDict. The run time is about 2-3 minutes. You can copy to blockMeshDict so to reproduce the snapping failure or the snapping working. Appreciate!
Marpole is offline   Reply With Quote

Old   February 7, 2020, 14:15
Default
  #8
HPE
Senior Member
 
Herpes Free Engineer
Join Date: Sep 2019
Posts: 298
Rep Power: 3
HPE is on a distinguished road
`snappyHexMesh` guarantees the generated mesh obeys the given `mesh quality metrics`. In light of this constraint, if the `mesh quality` metrics are not attained at the end of `snap` phase, the entire mesh is reverted back to the `castellatedMesh` result. I think your `not-snapped` mesh corresponds to just blocks of cells, which indicates `castellatedMesh`.

Try to relax the mesh metrics if you want to keep the `blockMeshDict` the same.

In addition, `snappyHexMesh` may need finer `blockMesh` to achieve the input refinement levels for your geometry. To my experience, fine background `blockMesh` helps.
__________________
Kind regards,
HPE

The OpenFOAM community is the biggest contributor to OpenFOAM; not person A or B. Let's report bugs or issue feature requests in GitLab-OpenFOAM.

Please `design` your questions well. Such effort always pays off well for inquirers and `helpmate`s:
How to create a Minimal, Reproducible Example,
How to give enough info to get help.
HPE is offline   Reply With Quote

Old   February 7, 2020, 14:23
Default
  #9
Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 54
Rep Power: 5
Marpole is on a distinguished road
Thanks Herpes.



I have already tried finer background. Maybe, I need to make it further.



Your suggestion on "reverting back" is very helpful. It explained why there is no error message. I will try to relax mesh quality metrics and see what I get. Can I get info, from snappyHexMesh log file, on what metric should I relax?
Marpole is offline   Reply With Quote

Old   February 7, 2020, 14:32
Default
  #10
HPE
Senior Member
 
Herpes Free Engineer
Join Date: Sep 2019
Posts: 298
Rep Power: 3
HPE is on a distinguished road
Yes, log file contains all the related info, even tells you that it reverts the mesh back.

But there are lots of messages inside a typical log file. That's why you might have missed it if it is there.

Hope you solve your problem.
__________________
Kind regards,
HPE

The OpenFOAM community is the biggest contributor to OpenFOAM; not person A or B. Let's report bugs or issue feature requests in GitLab-OpenFOAM.

Please `design` your questions well. Such effort always pays off well for inquirers and `helpmate`s:
How to create a Minimal, Reproducible Example,
How to give enough info to get help.
HPE is offline   Reply With Quote

Old   February 7, 2020, 14:40
Default
  #11
Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 54
Rep Power: 5
Marpole is on a distinguished road
It is strange, I cannot find keyword "revert" or "Revert" in log file
Marpole is offline   Reply With Quote

Old   February 7, 2020, 14:48
Default
  #12
HPE
Senior Member
 
Herpes Free Engineer
Join Date: Sep 2019
Posts: 298
Rep Power: 3
HPE is on a distinguished road
No no, revert is my verb. If you attach the log file here, we can try to find it in our spare time.
__________________
Kind regards,
HPE

The OpenFOAM community is the biggest contributor to OpenFOAM; not person A or B. Let's report bugs or issue feature requests in GitLab-OpenFOAM.

Please `design` your questions well. Such effort always pays off well for inquirers and `helpmate`s:
How to create a Minimal, Reproducible Example,
How to give enough info to get help.
HPE is offline   Reply With Quote

Old   February 7, 2020, 14:54
Default
  #13
Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 54
Rep Power: 5
Marpole is on a distinguished road
Hi HPE,


Attached is the log.snappyHexMesh. The system doesn't allow me to upload log.snappyHexMesh. I have to compress it to zip file. Thanks.
Attached Files
File Type: zip log.zip (5.6 KB, 2 views)
Marpole is offline   Reply With Quote

Old   February 7, 2020, 15:00
Default
  #14
HPE
Senior Member
 
Herpes Free Engineer
Join Date: Sep 2019
Posts: 298
Rep Power: 3
HPE is on a distinguished road
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.
"
__________________
Kind regards,
HPE

The OpenFOAM community is the biggest contributor to OpenFOAM; not person A or B. Let's report bugs or issue feature requests in GitLab-OpenFOAM.

Please `design` your questions well. Such effort always pays off well for inquirers and `helpmate`s:
How to create a Minimal, Reproducible Example,
How to give enough info to get help.
HPE is offline   Reply With Quote

Old   February 7, 2020, 15:19
Default
  #15
Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 54
Rep Power: 5
Marpole is on a distinguished road
Good findings. I will review them in more detail. Thanks very much!
Marpole is offline   Reply With Quote

Old   February 8, 2020, 02:22
Default
  #16
Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 54
Rep Power: 5
Marpole is on a distinguished road
Quote:
Originally Posted by AtoHM View Post
Hm, then it must be something else. Can you share your sHM dict?

Hello AtoHM,



Have you tried to open up the model zip file and review the blockMeshDict? I would like to hear your insight comments. Thanks.
Marpole is offline   Reply With Quote

Old   February 8, 2020, 14:02
Default
  #17
Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 54
Rep Power: 5
Marpole is on a distinguished road
Hi HPE,


I got chance to review the log file this morning. I found that I got similar messages when I reduced the block size and made a good (snapping) mesh. So I'm not sure if I will take these as root cause of snapping failure. Any more insights on the log file?


If you want, the blockMeshDict and snappyHexMeshDict are in the attachment of my initial post.



Kind Regards,






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.
"
Marpole is offline   Reply With Quote

Old   February 9, 2020, 12:41
Default
  #18
HPE
Senior Member
 
Herpes Free Engineer
Join Date: Sep 2019
Posts: 298
Rep Power: 3
HPE is on a distinguished road
Let me look at it properly then when I have a chunk of free time, which is rare to find these days.

Hope you find your answer before then.
__________________
Kind regards,
HPE

The OpenFOAM community is the biggest contributor to OpenFOAM; not person A or B. Let's report bugs or issue feature requests in GitLab-OpenFOAM.

Please `design` your questions well. Such effort always pays off well for inquirers and `helpmate`s:
How to create a Minimal, Reproducible Example,
How to give enough info to get help.
HPE is offline   Reply With Quote

Old   February 9, 2020, 14:12
Default
  #19
Member
 
Charles
Join Date: Aug 2016
Location: Vancouver, Canada
Posts: 54
Rep Power: 5
Marpole is on a distinguished road
Thanks very much.



I noticed a difference, between "working" log and "failed" log, that the failed log has "Correcting 2-D mesh motion ...done" but working long doesn't have this. I don't know if this is helpful for diagnosis.
Marpole is offline   Reply With Quote

Old   February 10, 2020, 02:35
Default
  #20
Senior Member
 
M
Join Date: Dec 2017
Posts: 227
Rep Power: 5
AtoHM is on a distinguished road
HPE's findings sounded promising and I thought blockMesh was ok then, but I had the same message "2-d mesh motion" last week. Reason was, I increased the model dimensions in y but forgot to adjust the block mesh. I might have time to look into your files in the evening today.
AtoHM is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 failing to snap ("did not find surface within...") Jaworski.Mike OpenFOAM Meshing & Mesh Conversion 7 December 2, 2019 21:13
[snappyHexMesh] Failed Edge Snap with box geometry and correct feature capture thiagomarinho OpenFOAM Meshing & Mesh Conversion 6 April 16, 2019 05:03
[snappyHexMesh] snappyHexMesh doesnt snap staustrahltriebwerk OpenFOAM Meshing & Mesh Conversion 47 March 18, 2018 15:19
[snappyHexMesh] snappyHexMesh failure to snap to geometry Yadasol OpenFOAM Meshing & Mesh Conversion 1 November 17, 2014 06:00
[snappyHexMesh] problems with sHM: it doesn't snap! Claudio87 OpenFOAM Meshing & Mesh Conversion 24 March 18, 2014 04:51


All times are GMT -4. The time now is 09:02.