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

[snappyHexMesh] Cannot snap correctly to a sphere

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By snak
  • 3 Post By Swift

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 21, 2019, 17:06
Default Cannot snap correctly to a sphere
  #1
Senior Member
 
Join Date: Jul 2013
Posts: 124
Rep Power: 13
wildfire230 is on a distinguished road
Hi all,


I am trying to use snappyHexMesh to mesh a volume full of spheres, where resolution is important, but I am stuck because the snapping step does not accurately snap to my spherical stl file, which is effectively very smooth. You can see the results of the snapping step attached. I have tried changing all of the snapping parameters, and no matter what, I get basically the same result, even with huge numbers of iterations. I need better fidelity to the STL than this.



Please help!
Attached Images
File Type: jpg SHM5.jpg (26.6 KB, 101 views)
wildfire230 is offline   Reply With Quote

Old   June 25, 2019, 12:23
Default
  #2
Senior Member
 
Join Date: Jul 2013
Posts: 124
Rep Power: 13
wildfire230 is on a distinguished road
Update: I have used dozens of different combinations of snapping parameters, and the outcome is almost always nearly indistinguishable. I have used implicit feature snapping, explicit feature snapping, low numbers of iterations, high numbers of iterations, low tolerance value, high tolerance value. In every case the results are practically the same! See attached. Please help, I cannot improve the smoothness of this snapping by any means! The STL surface is far smoother than this mesh.
Attached Images
File Type: jpg SHM Comparison.jpg (53.9 KB, 73 views)
wildfire230 is offline   Reply With Quote

Old   June 26, 2019, 00:43
Default
  #3
Senior Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 113
Blog Entries: 1
Rep Power: 18
snak is on a distinguished road
Quote:
Originally Posted by wildfire230 View Post
Update: I have used dozens of different combinations of snapping parameters, and the outcome is almost always nearly indistinguishable. I have used implicit feature snapping, explicit feature snapping, low numbers of iterations, high numbers of iterations, low tolerance value, high tolerance value. In every case the results are practically the same! See attached. Please help, I cannot improve the smoothness of this snapping by any means! The STL surface is far smoother than this mesh.

A standard tutorial "iglooWithFridges" uses a sphere region with smoother mesh. Have you checked the tutorial? Sharing the simplified case directory will help users to understand your problem.
Attached Images
File Type: png iglooWithFridges.png (64.9 KB, 63 views)
snak is offline   Reply With Quote

Old   June 26, 2019, 15:39
Default
  #4
Senior Member
 
Join Date: Jul 2013
Posts: 124
Rep Power: 13
wildfire230 is on a distinguished road
Thanks for the message, I have attached a simplified case. The problem is this, if I use snappyHexMesh to mesh ONLY the inside of the sphere, I get a very nice, smooth looking sphere, as seen in the first image. This can be generated with the attached test case by running:


blockMesh
snappyHexMesh -overwrite
paraFoam


However, what I am really interested in is a multi-region mesh of the inside and outside of the sphere. In this case, with exactly the same problem setup, the results appear as the second attached sphere, with clearly a less smooth surface. This can be generated with the attached case by:


First edit the snappyHexMeshDict to uncomment the lines:


faceZone fuelFaces;
cellZone fuelZone;
cellZoneInside inside;


This seems to trigger snappyHexMesh to recognize the problem as a multi-region simulation. Then run:


blockMesh
snappyHexMesh -overwrite
splitMeshRegions -cellZones -overwrite
paraFoam -touchAll


Finally, use paraview to open the meshingTest{fuelZone}.OpenFOAM file.


Somehow, with exactly the same snapping parameters and geometry files, the snapping does not work as well for a multi-region case. Please help!
Attached Images
File Type: png meshingTest1.png (69.1 KB, 87 views)
File Type: png meshingTest2.png (99.1 KB, 94 views)
Attached Files
File Type: gz meshingTest.tar.gz (4.6 KB, 13 views)
wildfire230 is offline   Reply With Quote

Old   June 27, 2019, 05:49
Default
  #5
Senior Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 113
Blog Entries: 1
Rep Power: 18
snak is on a distinguished road
Hi,

The problem is clear, now. Thank you for the test case.

The snapping problem is on the internal face, not the boundary.

When we put an additional setting about faceZone, mesh is smoother. I hope that this does not cause a side effect for multi-region setup.

Code:
    refinementSurfaces
    {
        sphere
        {
            level (2 2);
            faceZone fuelFaces;
            cellZone fuelZone;
            cellZoneInside inside;

            //- Optional specification of what to do with faceZone faces:
            //      internal : keep them as internal faces (default)
            //      baffle   : create baffles from them. This gives more
            //                 freedom in mesh motion
            //      boundary : create free-standing boundary faces (baffles
            //                 but without the shared points)
            faceType boundary;  // internal = default, baffle, boundary
        }
    }
Attached Images
File Type: png sphereMesh_faceTypeBoundary.png (57.6 KB, 55 views)
wildfire230 likes this.
snak is offline   Reply With Quote

Old   June 27, 2019, 09:56
Default
  #6
Senior Member
 
Join Date: Jul 2013
Posts: 124
Rep Power: 13
wildfire230 is on a distinguished road
Hi,


Thanks for the message, I wasn't aware of this option. Indeed it does seem to improve the smoothness of the sphere, however, I am worried that this hurts the conformal matching of the cells between the different regions. When I examine the multi-region mesh using this approach, it seems like the cells of the two regions no longer match exactly conformally. Do you know if this is the case? I am not really familiar with the use of baffles.


Thanks again!
wildfire230 is offline   Reply With Quote

Old   June 27, 2019, 21:41
Default
  #7
Senior Member
 
shinji nakagawa
Join Date: Mar 2009
Location: Japan
Posts: 113
Blog Entries: 1
Rep Power: 18
snak is on a distinguished road
Hi,

That is beyond my understanding.
If the resolution of mesh is enough at the interface, there is no need for worrying that, I guess...
snak is offline   Reply With Quote

Old   July 5, 2019, 09:42
Default
  #8
Member
 
Thomas Sprich
Join Date: Mar 2015
Posts: 76
Rep Power: 11
Swift is on a distinguished road
Hi,

Using
Code:
facetype baffles
will give you a conformal mesh between the two regions, whereas boundary will not.

This doesn't fix the smoothness however. To try fix smoothness change


Code:
maxNonOrtho 80;
in meshQualityControls. The problem is that snappy can't mesh to the surface of sphere and keep a max non orthogonality less than 65, which is what you are using. I tested this and it gives you a smoother sphere.

Good luck.



Regards,
Thomas
snak, Moopie and wildfire230 like this.
Swift is offline   Reply With Quote

Old   July 8, 2019, 08:46
Default
  #9
Senior Member
 
Join Date: Jul 2013
Posts: 124
Rep Power: 13
wildfire230 is on a distinguished road
Hi Thomas,


Thank you so much for the reply. Could you please clarify one point for me? If I use facetype baffles, I can get a nice smooth surface with maxNonOrtho 65, so with facetype internal, why do I need to increase maxNonOrtho?



Thanks again
wildfire230 is offline   Reply With Quote

Old   July 16, 2019, 08:54
Default
  #10
Member
 
Thomas Sprich
Join Date: Mar 2015
Posts: 76
Rep Power: 11
Swift is on a distinguished road
Hi,

Its a good question that I also thought of only once I had answered.

I suspect that it has to do with how the mesh quality is calculated at boundaries against cells that have adjacent cells. My (very limited) understanding is that non-orthogonality is the angle between a line joining cell centers and a face normal. Cells at the boundary, as in the external sphere case, have no adjacent cells whereas when calculating the internal sphere, the same cells would have adjacent cells. You would have to investigate how non-orthogonality is calculated at the boundary. But if non-orthogonality is ignored at the boundary this would explain why it was possible to mesh the external sphere with low non-orthogonality limits.


As I said, my understanding of this is limited, so take that for what its worth.



Thomas
Swift is offline   Reply With Quote

Reply

Tags
snapping, snappyhexmesh, sphere


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] The snappyMultiRegionHeater tutorial does not snap correctly wildfire230 OpenFOAM Meshing & Mesh Conversion 2 May 10, 2019 07:19
[Other] How to correctly mesh a spherical domain with an .stl objet in it ? TerenceA OpenFOAM Meshing & Mesh Conversion 3 September 14, 2017 10:00
[snappyHexMesh] Sphere in a channel by snappyHexMesh arsalan.dryi OpenFOAM Meshing & Mesh Conversion 0 November 14, 2016 17:01
[ICEM] meshing a sphere - large deviation from perfect sphere murx ANSYS Meshing & Geometry 25 August 15, 2012 13:37
meshing F1 front wing Steve FLUENT 0 April 17, 2003 13:37


All times are GMT -4. The time now is 03:31.