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

[snappyHexMesh] jagged, ragged edges...

Register Blogs Community New Posts Updated Threads Search

Like Tree2Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 4, 2010, 13:14
Default
  #101
Senior Member
 
Ivan Flaminio Cozza
Join Date: Mar 2009
Location: Torino, Piemonte, Italia
Posts: 210
Rep Power: 18
ivan_cozza is on a distinguished road
Send a message via MSN to ivan_cozza
Quote:
Originally Posted by niklas View Post
That is really weird...

It looks like its calling for an average operation.
Im guessing that your controlDict contains functionObjects that require U.
You're right!
I was using an old controlDict with some average functionObjects activated...
Now it works, I just need to play around with the tolerance!
ivan_cozza is offline   Reply With Quote

Old   November 10, 2010, 06:36
Default Problem with snapEdge and layers
  #102
Member
 
P.A.
Join Date: Mar 2009
Location: Germany
Posts: 83
Rep Power: 17
blaise is on a distinguished road
Hi Niklas and Foamers,

I have a problem with the results of your snapEdge tool, which is really a great improvement. The problem is depicted in the attached image. It is a simple cuboid with only straight angles at each corner, all packed in a cylindrical domain. The picture shows a detail of the layer mesh at a corner of the cuboid.
I generate a grid using blockMesh, then sHM (with a stl file describing the cuboid). With sHM, I do the castellation, snapping and layer adding steps. Then I use snapEdge. This produces a new timestep (4 in this case) directory which contains a polymesh/points file which I copy to the last sHM generated timestep directory (which is 3 in this case). Now I would expect to see correctly snapped edges AND faces, but as can be seen in the attached picture, the faces are not generated according to the new points file.
This actually confuses me, as I thought until now that the faces are described by the points in the points file. But then, why don't the faces follow the new points description?

What am I doing wrong? I suspect that I miss some essential step, or I do things in a wrong order, but I am stuck here and need some help!

Thank you very much in advance!

Cheers,

Pascal.
Attached Images
File Type: jpg faces_over_points_small.jpg (76.2 KB, 61 views)

Last edited by blaise; November 10, 2010 at 07:21. Reason: picture attached
blaise is offline   Reply With Quote

Old   November 10, 2010, 07:01
Default
  #103
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
...awaiting pictures.
niklas is offline   Reply With Quote

Old   November 10, 2010, 07:18
Default ... pictures for snapEdge problem
  #104
Member
 
P.A.
Join Date: Mar 2009
Location: Germany
Posts: 83
Rep Power: 17
blaise is on a distinguished road
... don't understand why it is gone... it was there in the preview...


is it there now?

Cheers,

Pascal.
Attached Images
File Type: jpg faces_over_points_small.jpg (76.2 KB, 48 views)
blaise is offline   Reply With Quote

Old   November 10, 2010, 07:30
Default
  #105
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
yes, it is there now.

This will never work. You have several lines crossing the edge, but snapEdge only works on the boundaries, so this will produce negative volumes.
This is why you should use snapEdge before adding the boundary refinement.
niklas is offline   Reply With Quote

Old   November 10, 2010, 07:40
Default
  #106
Member
 
P.A.
Join Date: Mar 2009
Location: Germany
Posts: 83
Rep Power: 17
blaise is on a distinguished road
Hi Niklas,

if I use snapEdge before the creation of layers, the layers don't get created, because there is no longer any intersection of the stl geometry and the existing grid. So if I run sHM _after_ snapEdge, with only the layer step activated, it simply doesn't create layers.

So, what am I supposed to do to create the layers after the snapEdge step?

Cheers,

Pascal.
blaise is offline   Reply With Quote

Old   November 10, 2010, 07:47
Default
  #107
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
i have no idea. it sound like something fundamentally wrong in your setup, but I need the case to solve it.
niklas is offline   Reply With Quote

Old   November 10, 2010, 08:05
Default Test case for snapEdge problem
  #108
Member
 
P.A.
Join Date: Mar 2009
Location: Germany
Posts: 83
Rep Power: 17
blaise is on a distinguished road
Quote:
Originally Posted by niklas View Post
i have no idea. it sound like something fundamentally wrong in your setup, but I need the case to solve it.
... here we go! I hope I didn't miss something... the whole file looks so small, but it should contain everything needed! Thank you anyway for the quick response!

Cheers,

Pascal.
Attached Files
File Type: gz snappy_LES_for_Niklas.tar.gz (9.3 KB, 17 views)
blaise is offline   Reply With Quote

Old   November 10, 2010, 08:24
Default
  #109
Senior Member
 
Join Date: Mar 2009
Location: My oyster
Posts: 124
Rep Power: 17
ziad is on a distinguished road
Quote:
Originally Posted by blaise View Post
... here we go! I hope I didn't miss something... the whole file looks so small, but it should contain everything needed! Thank you anyway for the quick response!

Cheers,

Pascal.
Setting maxConcave to 1 fixed such a problem for me on a rectangular shape. Maybe it works on your geometry.
ziad is offline   Reply With Quote

Old   November 10, 2010, 09:53
Default
  #110
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
i had no problems at all running the setup

1. blockMesh
2. snappyHexMesh layers false
3. snapEdge
4. snappyHexMesh only layers true

are you sure you are looking at the last timestep when you look at the mesh?
Attached Images
File Type: jpg before.jpg (94.3 KB, 123 views)
File Type: jpg after.jpg (94.2 KB, 130 views)
File Type: jpg layers.jpg (98.1 KB, 140 views)
niklas is offline   Reply With Quote

Old   November 11, 2010, 04:32
Default
  #111
Member
 
P.A.
Join Date: Mar 2009
Location: Germany
Posts: 83
Rep Power: 17
blaise is on a distinguished road
Quote:
Originally Posted by niklas View Post
i had no problems at all running the setup

1. blockMesh
2. snappyHexMesh layers false
3. snapEdge
4. snappyHexMesh only layers true

are you sure you are looking at the last timestep when you look at the mesh?


I don't get it! I just tried the setup I sent to you myself and it does NOT work! What do you do different than me? :-///

I tried it with OF 1.6.x and 1.7.x. Which version do you use?

Is snapEdge supposed to produce a full timestep directory, i. e. with all the boundary and faces and whatever files in it?

What is meshPhi used for? Does this file have to go somewhere?

Ok, I did not mention one strange thing that happens inbetween (step 3 in the following description of my work flow):

1) blockMesh ==> ok
2) sHM without layers ==> ok
3) snapEdge ==> not ok
reason (output from snapEdge)
==============================
Create time

Create mesh for time = 2

Finding features for stl : stl_quader_only_scaled.stl
Done!
Could not find patch: Q_LID
Available patches are:
ZYL_AUSSEN
ZYL_TOP
ZYL_BASE
quader_Q_LID
quader_Q_TOP
quader_Q_FRONT
quader_Q_BOTTOM
quader_Q_BACK
=============================

Solution: Remove the "quader_" prefix from the patch names in the 2/polymesh/boundary file.

4) snapEdge ==> ok
This produces the correctly snapped mesh

5) sHM, only layers ==> not ok
reason (end of output from sHM):

=============================
Merging all faces of a cell
---------------------------
- which are on the same patch
- which make an angle < 90 degrees
(cos:6.12323399574e-17)
- as long as the resulting face doesn't become concave by more than 90 degrees
(0=straight, 180=fully concave)

Merging 0 sets of faces.

No faces merged ...

Merging all points on surface that
- are used by only two boundary faces and
- make an angle with a cosine of more than 6.12323399574e-17.

No straight edges simplified and no points removed ...

No layers to generate ...
Layer mesh : cells:248295 faces:782175 points:285748
Cells per refinement level:
0 174915
1 8580
2 64800
Writing mesh to time 4
Written mesh in = 0.8 s.
Layers added in = 0.8 s.
Finished meshing in = 4.79 s.
End

=================================

6) cp 3/polymesh/points 2/polymesh/
rm -rf 3/ 4/

7) sHM ==> Same result as in 5)


What really puzzles me is the problem in step 3. Do you experience this too?


I really appreciate your help and I hope it doesn't take too much off your time budget, but I am lost here...

Thanks a lot!

Cheers, Pascal.

P.S.: I attach the full output files from each of the 7 steps (but 6) described above, just in case you need to look at some details.
Attached Files
File Type: gz seven_steps.tar.gz (4.8 KB, 7 views)
blaise is offline   Reply With Quote

Old   November 11, 2010, 04:37
Default
  #112
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Quote:
Solution: Remove the "quader_" prefix from the patch names in the 2/polymesh/boundary file.
Right, I forgot about that part. That is not what I did.
Try changing the names in snapEdgeDict instead.

This is what mine says
snapPatches
(
quader_Q_LID
//quader_Q_TOP
quader_Q_FRONT
quader_Q_BOTTOM
quader_Q_BACK
);
niklas is offline   Reply With Quote

Old   November 11, 2010, 04:46
Default
  #113
Member
 
P.A.
Join Date: Mar 2009
Location: Germany
Posts: 83
Rep Power: 17
blaise is on a distinguished road
Hi Ziad,

I tried this before and it solved most of the critical points, but not all. Moreover I want toi be able to use Niklas snapEdge tool for more complex geometries where I might need to have the maxConcave setting available for more fine grained control.

Cheers,

Pascal.
blaise is offline   Reply With Quote

Old   November 11, 2010, 04:59
Smile
  #114
Member
 
P.A.
Join Date: Mar 2009
Location: Germany
Posts: 83
Rep Power: 17
blaise is on a distinguished road
Yeaaaaaah!

That's it!!! You made my day!

Thank you so much for your help and your great tool!!!

Best regards!

Pascal.
blaise is offline   Reply With Quote

Old   November 15, 2010, 05:36
Default
  #115
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
Hi Pascal,

hereafter is the answer to the private mail you sent me some days ago:
the layers are degrading towards the edges, rather than being continued around the edges.

For my case (cube) the problem has been solved changing the featureAngle value in the "addLayerControls" subdictionary:

Default value was 30
New value is 5

Have a look at the following thread:
http://www.cfd-online.com/Forums/ope...pyhexmesh.html

Best regards,

Stephane.
openfoam_user is offline   Reply With Quote

Old   November 22, 2010, 10:38
Default
  #116
New Member
 
Join Date: Mar 2010
Posts: 7
Rep Power: 16
macbeth is on a distinguished road
Hi,

first of all I'd like to thank you for providing such a great tool!

But of course every new tool brings new questions... here's mine:

can snapEdge detect the end of a surface as an edge?
For example if my STL-file fust defines a free surface, will the end of the surface be detected as edge?
In my case I have a piece of fabric that is modelled as surface (not as volume). I can make a mesh around that with snappyHexMesh. But I could not get snapEdge to work with it.
Here's a picture...

Do you think you can teach your "findEdges"-function to recognize surface ends?
Attached Images
File Type: jpg surface_feature.jpg (70.1 KB, 72 views)
macbeth is offline   Reply With Quote

Old   November 22, 2010, 12:29
Default
  #117
Senior Member
 
Ivan Flaminio Cozza
Join Date: Mar 2009
Location: Torino, Piemonte, Italia
Posts: 210
Rep Power: 18
ivan_cozza is on a distinguished road
Send a message via MSN to ivan_cozza
Hi Foamers,
still experiencing some issues with SHM+snapEdge.
I've meshed my serrated-tail airfoil, doing SHM, and to preserve the edges in the tail region I used snapEdge.
Everything seems ok, the edges are correctly preserved, but when I do a checkMesh on the snapEdge-ed mesh, i find:

Checking geometry...
Overall domain bounding box (-7.5 -7.5 -4.681865e-17) (11 7.5 0.050000001)
Mesh (non-empty, non-wedge) directions (1 1 1)
Mesh (non-empty) directions (1 1 1)
Boundary openness (1.394724e-17 -1.332086e-17 2.157553e-12) OK.
Max cell openness = 3.6734125e-16 OK.
Max aspect ratio = 87.78811 OK.
Minumum face area = 2.4743271e-08. Maximum face area = 0.72347347. Face area magnitudes OK.
Min volume = 1.3582091e-11. Max volume = 0.0090434184. Total volume = 13.870883. Cell volumes OK.
Mesh non-orthogonality Max: 55.729817 average: 6.8807493
Non-orthogonality check OK.
***Error in face pyramids: 4 faces are incorrectly oriented.
<<Writing 4 faces with incorrect orientation to set wrongOrientedFaces
Max skewness = 3.0275911 OK.

Failed 1 mesh checks.

End

I can't find anything apparently wrong by an inspection of the mesh.
Some picture of the mesh:



A zoom in the tail region:



More zoom:



What does this error in face orientation is? I don't have it after SHM, it seems that it's introduced by snapEdge. What can I do to overcome this problem?
I attached the SHM and snapEdge dictionaries...

Thanks,
Ivan
Attached Files
File Type: txt snapEdge.txt (2.6 KB, 18 views)
File Type: txt shmDict.txt (9.8 KB, 13 views)
ivan_cozza is offline   Reply With Quote

Old   November 23, 2010, 02:00
Default
  #118
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Quote:
Originally Posted by macbeth View Post
can snapEdge detect the end of a surface as an edge?
Yes. All ends of the surface are automatically detected as edges.

By setting 'includeInterior yes' you will also add more lines to the
list of features.

ivan_cozza: I get that error also sometimes.
What I do then is to use foamToVTK -faceSet wrongOrientedFaces and look at the faces
in paraview. Sometimes I dont see anything wrong with them and the simulation runs fine anyway.
But if you want to get rid of the error you can reduce the amount of snapping.
Instead of moving the points 100% to the edge, you can move it lets say 95%.
You will not see the difference, but checkMesh will be happy.
niklas is offline   Reply With Quote

Old   November 23, 2010, 02:28
Default
  #119
Senior Member
 
Ivan Flaminio Cozza
Join Date: Mar 2009
Location: Torino, Piemonte, Italia
Posts: 210
Rep Power: 18
ivan_cozza is on a distinguished road
Send a message via MSN to ivan_cozza
Quote:
Originally Posted by niklas View Post
ivan_cozza: I get that error also sometimes.
What I do then is to use foamToVTK -faceSet wrongOrientedFaces and look at the faces
in paraview. Sometimes I dont see anything wrong with them and the simulation runs fine anyway.
But if you want to get rid of the error you can reduce the amount of snapping.
Instead of moving the points 100% to the edge, you can move it lets say 95%.
You will not see the difference, but checkMesh will be happy.
Thanks for the quick answer, Niklas!
How can I reduce the amount of snapping?
This afternoon I will have a test on this modifications, then I will move to the boundary layer problem (snappy went quite crazy in extruding the boundary layers on this geo...)!!!

Ivan
ivan_cozza is offline   Reply With Quote

Old   November 23, 2010, 02:39
Default
  #120
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 29
niklas will become famous soon enoughniklas will become famous soon enough
Quote:
Originally Posted by ivan_cozza View Post
How can I reduce the amount of snapping?
Just reduce the number of iterations.
niklas is offline   Reply With Quote

Reply

Tags
edges, jagged edges, snappyhexmesh


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 sticking point natty_king OpenFOAM Meshing & Mesh Conversion 11 February 20, 2024 09:12
[snappyHexMesh] snappyHexMesh does not create any mesh except one for the reference cell Arman_N OpenFOAM Meshing & Mesh Conversion 1 May 20, 2019 17:16
[snappyHexMesh] sHM layer process keeps getting killed MBttR OpenFOAM Meshing & Mesh Conversion 4 August 15, 2016 03:21
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 09:38
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 21:11


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