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

[snappyHexMesh] Failed Edge Snap with box geometry and correct feature capture

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 1 Post By thiagomarinho
  • 1 Post By Clément_G
  • 1 Post By cibanez

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 26, 2019, 09:34
Default Failed Edge Snap with box geometry and correct feature capture
  #1
New Member
 
Thiago Marinho
Join Date: Nov 2014
Posts: 8
Rep Power: 12
thiagomarinho is on a distinguished road
I've been a follower of this forum for a long time and found many answers to several issues here.

I've been through many threads with snapping problems and tried a bunch of different 'solutions' with no success. I've ended up with a much simplified case in order to iterate more quickly, still without success.

I am using openfoam 4 on ubuntu 16.04. The attached picture shows how the mesh is failing to snap to the feature edges of a simple box.

Under snappy log there's mention to the feature edges:
Code:
Reading features.
Read edgeMesh box.eMesh
    points      : 8
    edges       : 12
    boundingBox : (0 0 0) (0.5 0.5 0.5)
But during the morph section when its supposed to snap this is the status it provides is:
Code:
Feature analysis : total master points:638 attraction to :
    feature point   : 0
    feature edge    : 0
    nearest surface : 0
    rest            : 638
Along with the error/warning:
Code:
--> FOAM Warning : Displacement (-0.0001886980013 0.0003330792974 -5.659949559e-05) at mesh point 45330 coord (0.03065552061 0.002054266242 0.01850754925) points through the surrounding patch faces
I've observed this warning in the tutorial run as well but unlike my case the mesh snapped to the edges.

So far I've tried:
  • Increasing the snapControls tolerance up to 10 in 0.5 to 2 increments
  • implicit feature recognition
  • explicit feature recognition
  • disabling castellating by having the surface mesh refinement at level 0
  • converting the eMesh feature file to .obj format before running snap
  • upgrading to ubuntu 18.04 and openfoam 6
  • Increasing the refinement level on the curve up to level 7
  • refining the base mesh as a whole before running snap
  • providing a much coarser base mesh and refining only on the body really stressing the castellation
  • simplified geometry (as the box on the picture) to provide reduced number of feature lines
  • extracting the feature line file from the gz format before running SHM
  • increasing snap iterations up to 200
  • using the snapEdge utility post SHM

All of these without success.

Right now it seems I'm on a dead end where the only 'solution' is to really refine the edge mesh so that the absolute deviation of the mesh cells are much smaller, but this is going to be time consuming and not guaranteed to provide sucessfull meshing of the layers.

Im sure that I'm missing something obvious here, could you please provide some input?

I've attached the Log and dictionary files for SHM.

kind regards, T
Attached Images
File Type: png Failed Box.png (25.8 KB, 201 views)
Attached Files
File Type: zip snappyHexMeshDict.zip (9.0 KB, 5 views)
Clément_G likes this.
thiagomarinho is offline   Reply With Quote

Old   March 27, 2019, 16:04
Default
  #2
New Member
 
Thiago Marinho
Join Date: Nov 2014
Posts: 8
Rep Power: 12
thiagomarinho is on a distinguished road
Figured out the stupid mistake I was making.

The run script I was using would copy the contents of ./2/polymesh folder to ./constant folder at the end.

When running snapEdge (one of the attempts to fix my issue) it generates new points located under ./2 folder and those were not copied by the run script.

After playing around in paraFoam a little I was able to find the snapped edge.

Now on to the real case, hope it works as well as it did for a box.
thiagomarinho is offline   Reply With Quote

Old   March 29, 2019, 17:05
Default
  #3
New Member
 
Thiago Marinho
Join Date: Nov 2014
Posts: 8
Rep Power: 12
thiagomarinho is on a distinguished road
Using snapEdge potentially messes the mesh as it does not do a quality check and smoothing of the mesh. Ended up with some negative volume elements on my actual mesh.

I'll keep working on SHMD to try and get a quality mesh. I'll post whatever conclusion I find along with some pictures of the final mesh.
thiagomarinho is offline   Reply With Quote

Old   April 1, 2019, 17:58
Default corner snapping with snapEdge
  #4
New Member
 
Clément_G's Avatar
 
Clément Gouriou
Join Date: Jun 2013
Location: Paris, France
Posts: 13
Rep Power: 13
Clément_G is on a distinguished road
Hello Thiago and the Foamer's communicty,


Thank you Thiago for your recent post !
I feel less lonesome, since I've read you're user feedback.
I face a very comparable problem of edge and corner snapping on a very simple geometry (I believed it was simple to mesh properly but... unfortunately not). I've tested several parameters as you mentioned also:
Quote:
  • Increasing the snapControls tolerance from 0.5 to 4 increments
  • implicit feature recognition
  • explicit feature recognition
  • converting the eMesh feature file to .obj format before running snap
  • Increasing the refinement level
  • simplified geometry
  • increasing snap iterations up to 300
  • translate the blockMesh of few mm to help SHM to snap correctly
  • etc.
but until now the problem resists (see the pictures)

I would like to apply the snapEdge utility also but I need more information about the procedure.
I tried this procedure:
surfaceFeatureExtract > logs/logSurfaceFeature
blockMesh >logs/logBlockMesh
decomposePar > logs/logDecomposeParSHM
mpirun -np 32 snappyHexMesh -parallel -overwrite > logs/SHM
reconstructParMesh -mergeTol 1e-6 -constant > logs/logReconstructParSHM
checkMesh > logs/logCheckMesh_SHM
snapEdge > logs/logSnapEdge
checkMesh > logs/logCheckMesh_SHMSE


but recieved this message:
Quote:
command not found
Could somebody explicit the procedure for running snapEdge? (Should I copy the snapEdgeDict in snapyHexMesh/system directory as I did?)


Does somebody has any hint to snap properly the edge-corner without refining the mesh?



Thank you for your advices.
Regards
Clément
Attached Images
File Type: png wrong_snapping.png (52.4 KB, 117 views)
File Type: png wrong_snapping_2.png (40.2 KB, 84 views)
File Type: png wrong_snapping_corner_2D.png (9.7 KB, 52 views)
Clément_G is offline   Reply With Quote

Old   April 2, 2019, 04:16
Default
  #5
New Member
 
Clément_G's Avatar
 
Clément Gouriou
Join Date: Jun 2013
Location: Paris, France
Posts: 13
Rep Power: 13
Clément_G is on a distinguished road
I've forgotten to attached my Dict files and the foil.stl file, sorry.
Morevover I run an OF 1812 version on Ubuntu 1804.


Thanks in advance for any hints.
Attached Files
File Type: txt blockMeshDict.txt (1.6 KB, 1 views)
File Type: txt snappyHexMeshDict.txt (6.9 KB, 15 views)
File Type: zip foil.zip (3.4 KB, 2 views)

Last edited by Clément_G; April 2, 2019 at 05:10. Reason: correction
Clément_G is offline   Reply With Quote

Old   April 2, 2019, 10:41
Default
  #6
New Member
 
Thiago Marinho
Join Date: Nov 2014
Posts: 8
Rep Power: 12
thiagomarinho is on a distinguished road
Hello Clement

I've been at this for the last couple of weeks. I am arriving at the conclusion that the way SHM works it does not snap points precisely to the edge and that is never going to change. The strategy I've used before was to refine sufficiently so that the difference is negligible. I fear that is what I'll have to resort to again.

snapEdge is a 3rd party application. I've given up on using it because with more complex meshes it produces several quality issues (including inverted normals) which are way too hard to prevent/correct.

snapEdge references:
http://openfoamwiki.net/index.php/Contrib_snapEdge
snapEdge not working

good luck to us. If anyone out there actually managed to get a good snapping configuration, could you please share your case?
thiagomarinho is offline   Reply With Quote

Old   April 16, 2019, 05:03
Default SnapEdge feedback
  #7
New Member
 
Clément_G's Avatar
 
Clément Gouriou
Join Date: Jun 2013
Location: Paris, France
Posts: 13
Rep Power: 13
Clément_G is on a distinguished road
Hello Thiago and all Foamers,


I give you now some results of my experiences with snapping corner and right edge with a relative coarse mesh.


First of all, I discovered that "snapEdge" doesn't work with openFoam 1812 but it works with openFoam 6!


Then, this utility works quite well to snap right angles and corners as you can see on the different pictures I attached (pictures 2 and 4).


Nevertheless, I noticed also (Thiago mentioned it already), that il produces sometimes "inverted faces" which could lead to errors in the layering step (see picture 5).



Finally, my personal belief is that SHM doesn't snap correctly the right angles and corners if the refinement isn't high enough (the cells should be small enough close to the edge). This lead to multiply sufficiently the cell number which is expensive in cpu time, but to my mind it's the most robust solution.
Nevertheless in some specific case the "snapEdge" utility can be usefull and lead to a correct meshing (with correct layering), but it wasn't the case for me, probably because I have an airfoil shape in 3D.


I hope those news will help some people facing the problem of snapping edge.


Good luck in meshing!


Clément
PS: the first four pictures represent the efficiency of "snapEdge" and the last picture (5) is a perpendicular view (from the top) of the pictures 3 and 4 which illustrates the layering defect induced by the snapEdge process.
Attached Images
File Type: png wrong_snappingedge-corner.png (51.0 KB, 115 views)
File Type: png right_snappingedge-corner.png (50.2 KB, 117 views)
File Type: png mesh_wrong_corner_snapping.png (15.2 KB, 103 views)
File Type: png mesh_right_corner_snapping.png (15.1 KB, 99 views)
File Type: jpg mesh_right_corner_snapping_wrong_layering.jpg (92.9 KB, 111 views)
Yanagi likes this.
Clément_G is offline   Reply With Quote

Old   May 7, 2022, 10:19
Default Reduce maxConcave
  #8
New Member
 
Cristóbal
Join Date: Jan 2022
Location: Sweden
Posts: 17
Rep Power: 4
cibanez is on a distinguished road
Quote:
Originally Posted by Clément_G View Post
Hello Thiago and the Foamer's communicty,


Thank you Thiago for your recent post :)!
I feel less lonesome, since I've read you're user feedback.
I face a very comparable problem of edge and corner snapping on a very simple geometry (I believed it was simple to mesh properly but... unfortunately not). I've tested several parameters as you mentioned also:


but until now the problem resists (see the pictures)

I would like to apply the snapEdge utility also but I need more information about the procedure.
I tried this procedure:
surfaceFeatureExtract > logs/logSurfaceFeature
blockMesh >logs/logBlockMesh
decomposePar > logs/logDecomposeParSHM
mpirun -np 32 snappyHexMesh -parallel -overwrite > logs/SHM
reconstructParMesh -mergeTol 1e-6 -constant > logs/logReconstructParSHM
checkMesh > logs/logCheckMesh_SHM
snapEdge > logs/logSnapEdge
checkMesh > logs/logCheckMesh_SHMSE


but recieved this message:

Could somebody explicit the procedure for running snapEdge? (Should I copy the snapEdgeDict in snapyHexMesh/system directory as I did?)


Does somebody has any hint to snap properly the edge-corner without refining the mesh?



Thank you for your advices.
Regards
Clément
Hi Clément,

It might be too late of a reply but I figured I would share what I recently found to help me with a similar issue.

From the third picture of a slice of your mesh I can see from visual inspection that the cells that don’t snap correctly to the edge have a concave angle of ~ 50-60 degrees.

You might want to try decreasing maxConcave in meshQualityControls to a low value (e.g maxConcave 30;) to avoid those type of cells around your edge and hopefully it will snap correctly.

Regards,
Cristóbal
Attached Images
File Type: png wrong_snapping_corner_2D.png (9.7 KB, 60 views)
File Type: png convex_vs_concave_angle.png (31.5 KB, 52 views)
saladbowl likes this.
cibanez is offline   Reply With Quote

Reply

Tags
shm, shm snapping edges


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] No satisfying result with feature edge refinement Krapf OpenFOAM Meshing & Mesh Conversion 5 December 13, 2019 07:59
[snappyHexMesh] snappyHexMesh Parallel bad size error andrewpomeroy OpenFOAM Meshing & Mesh Conversion 2 April 2, 2018 02:08
[cfMesh] feature edge error zordiack OpenFOAM Community Contributions 3 October 11, 2016 07:09
[mesh manipulation] Sharp edge problem on concave patches using polyDualMesh without error keepfit OpenFOAM Meshing & Mesh Conversion 1 November 25, 2014 15:28
[snappyHexMesh] snappyHexMesh failure to snap to geometry Yadasol OpenFOAM Meshing & Mesh Conversion 1 November 17, 2014 06:00


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