CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] Failed Edge Snap with box geometry and correct feature capture (https://www.cfd-online.com/Forums/openfoam-meshing/216043-failed-edge-snap-box-geometry-correct-feature-capture.html)

thiagomarinho March 26, 2019 08:34

Failed Edge Snap with box geometry and correct feature capture
 
2 Attachment(s)
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

thiagomarinho March 27, 2019 15:04

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 March 29, 2019 16:05

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.

Clément_G April 1, 2019 16:58

corner snapping with snapEdge
 
3 Attachment(s)
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

Clément_G April 2, 2019 03:16

3 Attachment(s)
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.

thiagomarinho April 2, 2019 09:41

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
https://www.cfd-online.com/Forums/op...t-working.html

good luck to us. If anyone out there actually managed to get a good snapping configuration, could you please share your case?

Clément_G April 16, 2019 04:03

SnapEdge feedback
 
5 Attachment(s)
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.

cibanez May 7, 2022 09:19

Reduce maxConcave
 
2 Attachment(s)
Quote:

Originally Posted by Clément_G (Post 729541)
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


All times are GMT -4. The time now is 15:48.