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   July 13, 2010, 11:10
Default
  #41
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
you only have to move the 3/polyMesh/points to the constant/polyMesh directory.
T.koda likes this.
niklas is offline   Reply With Quote

Old   July 14, 2010, 08:06
Default
  #42
Member
 
Johannes Baumann
Join Date: Mar 2009
Location: Baden-Wuerttemberg, Germany
Posts: 43
Rep Power: 17
johannes is on a distinguished road
@ Stephane:

Thanks for your input! It works indeed, so the fpe problem is solved.

@ Niklas:

After disabling smoothing, snapEdge runs fine but I'm still not getting nice edges over the patch.

At the moment I'm testing with different tolerances of 0.2 to 0.8. I also reduced relaxation to 0.9 but the effect was hardly visible.

I'll try to recreate the stl geometry I used for this test to reduce filesize so that I can send it to you or upload it somewhere to provide you with a 'challenging' testcase.

Quote:
Originally Posted by niklas View Post
Finally...As I say on the wiki, sometimes it works and sometimes not, but I've always been able to improve the feature representation and its just a little tool I wrote for me without the intention of releasing it, but as I discovered that I wasnt alone with this problem I thought I'd share it with the rest of you hoping that you'd find some use for it.
So bare that in mind that its very much a work-in-progress.
Yeah, that's very ok for me. Since the featureEdge component of sHM still seems to be in an very early state, it's great to have such a tool at all, especially with the option for improving whole patches and not only patch edges. So thanks again for sharing and your support!

Best regards,
Johannes
johannes is offline   Reply With Quote

Old   July 14, 2010, 10:02
Default
  #43
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'm playing with your case and there are faces that are more on the gas inlets than on the walls, but they still belong to the walls, so this will never work.
I've increased the cell resolution at the inlets and that improves the starting mesh alot
and makes life alot easier for snapEdge, but for some weird reason, that I
havent figured out yet, it just ignores some of the edges.
niklas is offline   Reply With Quote

Old   July 15, 2010, 12:59
Default
  #44
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
Can you download the latest version from the wiki and try these settings.
If you want it better around the capillaries/walls intersection you have to refine it more.
Attached Files
File Type: gz snapEdgeDict.gz (860 Bytes, 82 views)
File Type: gz snappyHexMeshDict.gz (3.4 KB, 59 views)
niklas is offline   Reply With Quote

Old   July 26, 2010, 08:55
Default
  #45
Member
 
Juho Peltola
Join Date: Mar 2009
Location: Finland
Posts: 89
Rep Power: 17
juho is on a distinguished road
Quote:
Originally Posted by niklas View Post
Can you download the latest version from the wiki and try these settings.
If you want it better around the capillaries/walls intersection you have to refine it more.
Thank you and sorry it took me a while to respond, I've been on vacation and out of town. The new version of snapEdge seems to work fine, but only if I use the capillaries.stl to define the edge. If I use the gasInlets.stl the checkMesh fails. Is there a logic behind this behaviour?

I still have a couple of troublesome cells in the two-phase simulation, but those are snappyHexMesh issues and not related to snapEdge.
juho is offline   Reply With Quote

Old   July 28, 2010, 08:35
Default
  #46
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 juho View Post
Is there a logic behind this behaviour?
nope, there shouldnt be any difference.
niklas is offline   Reply With Quote

Old   July 29, 2010, 05:49
Default
  #47
New Member
 
GRD
Join Date: Jun 2009
Posts: 28
Rep Power: 17
g.redondo is on a distinguished road
Great job Niklas,

I was wondering how do you handle layers of prisms. My guess is that it would be better first to run SHM without prisms, then snapEdge and last SHM for prisms (don't know if possible). Otherwise snapEdge would deform the first layer. Anyway, what's your opinion or best practice about this?

Regards,

Gonzalo
g.redondo is offline   Reply With Quote

Old   July 29, 2010, 06:05
Default
  #48
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
Hi Gonzalo,

yes, you are right.

First use sHM without prism layers, then snapEdge and finally sHM with only layers.

I will soon put pictures about it with the ahmed body. Work in progress ...

Regards,

Stephane.
openfoam_user is offline   Reply With Quote

Old   July 29, 2010, 06:11
Default
  #49
New Member
 
GRD
Join Date: Jun 2009
Posts: 28
Rep Power: 17
g.redondo is on a distinguished road
Great, waiting for it!

Regards,

Gonzalo
g.redondo is offline   Reply With Quote

Old   July 29, 2010, 08:40
Default
  #50
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
Hi Niklas,

this morning I have updated the GIT version of OpenFOAM-1.7.x.

And I have the following error message when using snapEdge:

----------------------------------

[110]cfs10-sanchi /shared/sanchi/OpenFOAM/sanchi-1.7.x/ahmed12.5deg25072010 % snapEdge
/*---------------------------------------------------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.7.x |
| \\ / A nd | Web: www.OpenFOAM.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
Build : 1.7.x-40d9ee1a008d
Exec : snapEdge
Date : Jul 29 2010
Time : 13:34:44
Host : cfs10
PID : 8370
Case : /shared/sanchi/OpenFOAM/sanchi-1.7.x/ahmed12.5deg25072010
nProcs : 1
SigFpe : Enabling floating point exception trapping (FOAM_SIGFPE).

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Create time

Create mesh for time = 2



--> FOAM FATAL IO ERROR:
keyword stlFileName is undefined in dictionary "/shared/sanchi/OpenFOAM/sanchi-1.7.x/ahmed12.5deg25072010/constant/snapEdgeDict"

file: /shared/sanchi/OpenFOAM/sanchi-1.7.x/ahmed12.5deg25072010/constant/snapEdgeDict from line 18 to line 62.

From function dictionary::lookupEntry(const word&, bool, bool) const
in file db/dictionary/dictionary.C at line 395.

FOAM exiting

-----------------------

Regards,

Stephane.
openfoam_user is offline   Reply With Quote

Old   July 29, 2010, 14:22
Default
  #51
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
Sorry Niklas,

it was just a problem of my OpenFOAM-1.7.x version.

Now your tool works again.

Stephane.
openfoam_user is offline   Reply With Quote

Old   July 30, 2010, 11:00
Default
  #52
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
Attached are some pictures (front view) about the mesh generation process with snappyHexMesh and the snapEdge tool developed by Niklas Nordin.

The geometry is the Ahmed body.

First step : cell splitting at feature edges and surfaces (sHM)
Second step : snapping to features on STL surfaces (snapEdge)
Third step : add layers (sHM)

I have add 10 layers of cells with snappyHexMesh (addLayers).
The final mesh has 6.8 M cells.
At the end the checkMesh utility gives MESH OK.

Best Regards,

Stephane.
Attached Images
File Type: jpg FRONTVIEW-Phase1.jpg (94.2 KB, 248 views)
File Type: jpg FRONTVIEW-Phase2.jpg (94.4 KB, 232 views)
File Type: jpg FRONTVIEW-Phase3.jpg (97.1 KB, 242 views)
openfoam_user is offline   Reply With Quote

Old   July 30, 2010, 11:01
Default
  #53
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
More pictures (rear view).

Stephane.
Attached Images
File Type: jpg REARVIEW-Phase1.jpg (93.0 KB, 138 views)
File Type: jpg REARVIEW-Phase2.jpg (94.1 KB, 135 views)
File Type: jpg REARVIEW-Phase3.jpg (96.5 KB, 171 views)
openfoam_user is offline   Reply With Quote

Old   July 30, 2010, 12:34
Default
  #54
New Member
 
GRD
Join Date: Jun 2009
Posts: 28
Rep Power: 17
g.redondo is on a distinguished road
Nice!

It would be really nice if you can explain the process show your Dict files for each step. This could be added to the wiki.

Regards,

Gonzalo
g.redondo is offline   Reply With Quote

Old   August 15, 2010, 20:57
Default example case?
  #55
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 334
Rep Power: 18
phsieh2005 is on a distinguished road
Hi,

The snapEdge utility looks like a very useful tool. I tried a simple geometry. All patches were set to Walls just to test. I used the same stl for both snappyHexMesh and snapEdge. But, there basically are no differences before and after snapEdge. I probably did something wrong. Can someone post a simple example case or provide some more detailed explanation? Thanks!

Pei
phsieh2005 is offline   Reply With Quote

Old   August 16, 2010, 03:54
Default
  #56
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
if you only have 1 patch (walls) you probably didnt use

includeInterior yes;

with only 1 patch you do not have any feature edges that defines the boundary of the patch, since
the patch must be a closed surface.
niklas is offline   Reply With Quote

Old   August 16, 2010, 04:02
Default
  #57
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 314
Rep Power: 18
openfoam_user is on a distinguished road
Hi,

I have attached a cube.tar.gz file. Do the following commands:

tar xvzf cube.tar.gz
cd cube
blockMesh
snappyHexMesh
ln -s constant/triSurface/cube.stl
snapEdge
paraFoam

and compare times 1, 2 and 3 for CUBE
and you will see that the edges are at the end (time 3) correct !

Have a look at the files:

/cube/system/snappyHexMesh
/cube/constant/snapEdge

Hope it will help you.

PS : I use OpenFOAM-1.7.x (last available git version)

Best regards,
Stephane.
Attached Files
File Type: gz cube.tar.gz (8.5 KB, 74 views)
openfoam_user is offline   Reply With Quote

Old   August 16, 2010, 09:55
Default
  #58
Senior Member
 
Pei-Ying Hsieh
Join Date: Mar 2009
Posts: 334
Rep Power: 18
phsieh2005 is on a distinguished road
Thanks niklas and openfoam_user!

The new cube.tar.gz example worked great!

I am wondering about few things:

1. what is the general rule for specifying the tolerance value?
2. if I have 6 faces, but only 3 patches. For example, inlet, outlet, and walls. How to prepare the stl for it? Should I have 3 stl files, ie., inlet.stl, outlet.stl, and walls.stl? Or, 1 stl, but, with inlet/outlet/walls specified inside the stl?
3. can I perform snapEdge several times? That is, do inlet first, then, outlet, then walls. Each with a different snapEdgeDict? The cell size for each feature might be different.

Pei
phsieh2005 is offline   Reply With Quote

Old   August 16, 2010, 10:23
Default
  #59
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 phsieh2005 View Post
1. what is the general rule for specifying the tolerance value?
if you have includeInterior no, then you should set something 'large'..i use 10.0.
If you have includeInterior yes, then it will definitely not work with a value larger than 1.0.
The program just checks for proximity of lines. so if you have a (square) face covering a feature it can
attract both lines on opposite sides of the feature line, thus making the face of zero size.

Quote:
Originally Posted by phsieh2005 View Post
2. if I have 6 faces, but only 3 patches. For example, inlet, outlet, and walls. How to prepare the stl for it? Should I have 3 stl files, ie., inlet.stl, outlet.stl, and walls.stl? Or, 1 stl, but, with inlet/outlet/walls specified inside the stl?
it doesnt matter, the 2 methods are equivalent.

Quote:
Originally Posted by phsieh2005 View Post
3. can I perform snapEdge several times? That is, do inlet first, then, outlet, then walls. Each with a different snapEdgeDict? The cell size for each feature might be different.
yup, just make sure to set startFrom latestTime in system/controlDict.
usually I just set
snapPatches ( inlet outlet);
and ignore the features on the walls.
using includeInterior no is faaar more robust than setting it to yes.
niklas is offline   Reply With Quote

Old   August 18, 2010, 14:00
Default
  #60
Member
 
Johannes Baumann
Join Date: Mar 2009
Location: Baden-Wuerttemberg, Germany
Posts: 43
Rep Power: 17
johannes is on a distinguished road
Hi Niklas,

I'm still trying to get an improved mesh using snapEdge's includeInterior feature. At first sight the resulting mesh looks quite well but there are still some skips and the checkMesh result always shows at least two missed tests.

If you have some time left it would be great if you could have a look at my case (see attached .tar.gz file with my actual settings and files) and maybe you're able to locate a potential for improvement (e.g. snapEdge or sHM parameters, stl file precision, etc...).

I know that you're still working on snapEdge, so I don't expect a 'perfect' mesh, a checkMesh result without errors would be absolutely ok.

Many thanks in advance!

Best regards,
Johannes
Attached Files
File Type: gz snapEdgeTest.tar.gz (67.4 KB, 35 views)
johannes 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 10:12
[snappyHexMesh] snappyHexMesh does not create any mesh except one for the reference cell Arman_N OpenFOAM Meshing & Mesh Conversion 1 May 20, 2019 18:16
[snappyHexMesh] sHM layer process keeps getting killed MBttR OpenFOAM Meshing & Mesh Conversion 4 August 15, 2016 04:21
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 10:38
[snappyHexMesh] snappyHexMesh won't work - zeros everywhere! sc298 OpenFOAM Meshing & Mesh Conversion 2 March 27, 2011 22:11


All times are GMT -4. The time now is 18:40.