CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: snappyHexMesh and Others

jagged, ragged edges...

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   August 18, 2010, 17:12
Default
  #61
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 471
Rep Power: 11
bastil is on a distinguished road
Niklas,

really great tool missed it so far. This will reduce my reasons from not so often using FOAM from two to one final issue (hopefully 1.6-ext will fix this ggi issues!)
Have you ever considered putting snapEdge to the openfoam-extend repository? I think this would make sense. I will come back with some feedback soon. I have quite complex gemometry to run on.

Regards Bastian

Edit:
- I use Nastran-Files instead of stl, will this work?
- Do I need some .eMesh-File containing the features? Or is this decided my snapEdge using an angle
- From the Ahmed-Pictures from openfoam_user I guess he uses explicit featuere refinement with .eMesh-File in sHM?

Last edited by bastil; August 18, 2010 at 18:04.
bastil is offline   Reply With Quote

Old   August 19, 2010, 01:58
Default
  #62
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 20
niklas will become famous soon enoughniklas will become famous soon enough
Quote:
Originally Posted by johannes
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
Oohh, this is a very nice test case.
I am doing a complete re-write of snapEdge at the moment to better handle internal features.
I will let you know once I have it working.

Quote:
Originally Posted by bastil
Niklas,

really great tool missed it so far. This will reduce my reasons from not so often using FOAM from two to one final issue (hopefully 1.6-ext will fix this ggi issues!)
Have you ever considered putting snapEdge to the openfoam-extend repository? I think this would make sense. I will come back with some feedback soon. I have quite complex gemometry to run on.

Regards Bastian

Edit:
- I use Nastran-Files instead of stl, will this work?
- Do I need some .eMesh-File containing the features? Or is this decided my snapEdge using an angle
- From the Ahmed-Pictures from openfoam_user I guess he uses explicit featuere refinement with .eMesh-File in sHM?
I dont have any nastran files so it doesnt work at the moment, but it should be easy to add.
N
niklas is offline   Reply With Quote

Old   August 19, 2010, 07:54
Default
  #63
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 471
Rep Power: 11
bastil is on a distinguished road
Quote:
Originally Posted by niklas View Post
I dont have any nastran files so it doesnt work at the moment, but it should be easy to add.
Fine. I will start looking into this. Is there something else I can do to support this project? I am definitly interested in it. My special interests include parallelization or integration into sHM as step 3 out of for (refine, snap, edgeSnap, layers).

Regards Bastian
bastil is offline   Reply With Quote

Old   August 20, 2010, 04:55
Default
  #64
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 471
Rep Power: 11
bastil is on a distinguished road
Niklas.

here is my first feedback from what I have seen from snapEdge:
  • It seems to run with Nastran-Files instead of stl-Files without any modification since the triSurface-Class of OpenFOAM supports both.
  • It is very slow: For my test model it spends hours in the following loop:
Code:
    forAll(stlPoints, isp)
        {
            addToList(globalStlPoints[is], stlPoints[isp]);
        }
I will investigate further and also try to put it into sHM and maybe parallelize it.

Regards Bastian
bastil is offline   Reply With Quote

Old   August 20, 2010, 07:08
Default
  #65
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 20
niklas will become famous soon enoughniklas will become famous soon enough
Quote:
Originally Posted by bastil View Post
It seems to run with Nastran-Files instead of stl-Files without any modification
nice.

dont bother trying to investigate the code. i have already re-written it completely and Im using your
case to test it on.

N
niklas is offline   Reply With Quote

Old   August 20, 2010, 07:23
Default
  #66
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 471
Rep Power: 11
bastil is on a distinguished road
Quote:
Originally Posted by niklas View Post
dont bother trying to investigate the code. i have already re-written it completely and Im using your case to test it on.
Niklas: Sorry I can not send you my case I have to do the test here with us. Can you send me you new code, please? Otherways I will start improving old code?
Some more points:
  • Did you consider hosting the tool at openfoam-extend
  • Are there plans to integrate this into sHM and for parallelisation?
  • How can I support your work?
Regards Bastian
bastil is offline   Reply With Quote

Old   August 20, 2010, 07:44
Default
  #67
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 20
niklas will become famous soon enoughniklas will become famous soon enough
Quote:
Originally Posted by bastil View Post
Niklas: Sorry I can not send you my case I have to do the test here with us. Can you send me you new code, please? Otherways I will start improving old code?
sorry, my mistake. it wasnt you that sent me the case it was johannes.
Im not going to release a half-done code full of commented info-statements.
You can improve the old code if you want, but the new version handles corners
and internal features in a totally different way and the old algorithm will never
be able to handle this in as a robust way as the new one.
Of course, that wasnt my intention either when I first started this project.

Quote:
Originally Posted by bastil View Post
[*]Did you consider hosting the tool at openfoam-extend
yes and no i wont.
Its completely free, so if you want you can just take it and claim it as your own and
include it there yourself if you want

Quote:
Originally Posted by bastil View Post
[*]Are there plans to integrate this into sHM and for parallelisation?
nope, I have talked to opencfd and in the future this utility will become obsolote anyways.

Quote:
Originally Posted by bastil View Post
[*]How can I support your work?
if it doesnt work, maybe you can send me the geometry

N
niklas is offline   Reply With Quote

Old   August 20, 2010, 07:57
Default
  #68
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 300
Rep Power: 9
openfoam_user is on a distinguished road
Hi Niklas,

thanks a lot for improving your great tool !

Once you have rewritten your code I will try it with my geometry.

Best regards,

Stephane.
openfoam_user is offline   Reply With Quote

Old   August 20, 2010, 08:00
Default
  #69
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 471
Rep Power: 11
bastil is on a distinguished road
Thanks Niklas for the quick answer.


Quote:
Originally Posted by niklas View Post
nope, I have talked to opencfd and in the future this utility will become obsolote anyways.
That means future releases will include feature lines written by OpenCFD?

Quote:
Originally Posted by niklas View Post
if it doesnt work, maybe you can send me the geometry
Difficult but I will try my best. I will also come up with code proposals if I have.

Regards Bastian

Last edited by bastil; August 20, 2010 at 08:33.
bastil is offline   Reply With Quote

Old   September 1, 2010, 02:26
Default
  #70
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 20
niklas will become famous soon enoughniklas will become famous soon enough
I have updated the snapEdge utility and you can just download it from the wiki.
Its not 100% done with what I want it be able to do, but it is definitely usable and better
than the old version.

I have been using the available stl's to test it one and have gotten all of them to work.
I will add all of the screenshots to the wiki when the wiki works properly.

The most difficult case is the one from johannes, mainly because the stl is in such a poor shape
that I had to improve it. I've attached 2 pics of before and after of that case here
Attached Images
File Type: jpg geo1.jpg (95.6 KB, 121 views)
File Type: jpg geo2.jpg (96.8 KB, 119 views)
niklas is offline   Reply With Quote

Old   September 1, 2010, 13:24
Default Good news
  #71
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 471
Rep Power: 11
bastil is on a distinguished road
Hi Niklas,

definitly good news. I will give it a try soon.
The only thing missing now is the integration into snappy, maybe I will try this myself.

Regards Bastian
bastil is offline   Reply With Quote

Old   September 2, 2010, 15:12
Default
  #72
Member
 
Johannes Baumann
Join Date: Mar 2009
Location: Baden-Wuerttemberg, Germany
Posts: 42
Rep Power: 8
johannes is on a distinguished road
Hi Niklas,

great job, thanks a lot for the improved snapEdge version.

Yeah I know, the case I uploaded is quite complex, but judging from the screenshots after the recent update, snapEdge seems to work quite well with such a geometry.

I did a re-run of my testcase using the new snapEdge version but still could not get a flawless mesh since some chamfers remained. Nevertheless the overall result was a lot better than before - just had a few skewed faces reported by checkMesh.

I played around with different values for tolerance and relaxation - with limited success. Would it be possible to send me the snapEdgeDict you used to run my case?

You mentioned a low stl quality and you're right because I turned down the quality settings when creating the stl files to reduce filesize. As you certainly know, most CAD systems have a conversation or facet tolerance and an angle tolerance for specifying the quality of an stl geometry; do you have a general rule for setting these values (maybe in respect to the desired surface cell size)?

Thanks + best regards,
Johannes
johannes is offline   Reply With Quote

Old   September 2, 2010, 15:16
Default
  #73
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 471
Rep Power: 11
bastil is on a distinguished road
Niklas,

I did some tests on my (really complex) geometries. It definitely looks much better now - great.
Only remaining bottleneck I have is the execution time wich is about 1 hour for one iteration. I have to look into this.

Regards Bastian

Last edited by bastil; September 3, 2010 at 02:38.
bastil is offline   Reply With Quote

Old   September 3, 2010, 02:33
Default
  #74
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 20
niklas will become famous soon enoughniklas will become famous soon enough
@johannes

I dont know what it was with your geometry, but if I extract the stl feature-lines it results in features on what seems to be planar surfaces. This can cause problems beacuse the mesh dont have any features there and
if your tolerance is too large it can grab the mesh features that belong to other stl features.

And it is not possible with this method to capture all the features perfectly.
If you look at the following animation maybe you will understand why.
http://openfoam.nequam.se/cases/snapTest.avi
What you see is that the feature line covered by the faces with an angle of 45 deg to the left attracts
the upper line and to the right it switches and attracts the lower line.
Where these lines meet there is an edge that just grows smaller and smaller and
in order to prevent bad faces I have limited the edges to go below 1/10 of the smallest edge length

set relaxation to 0.1 and play with the number of iterations, I used these angle settings.

featureAngle 20;
excludeEdgeAngle 70;
parallelAngle 30.0;

maybe I should add that I couldnt get it to work with the geometry you sent me, but I had to
treat it in ANSA and also that it works better if you make the mesh abit finer, some parts just have
1-2 cells between the features

@bastil
ahh, now I understand why you want to run it in parallell.
I havent tested it in parallell myself so I dont know if it will work.
It should work (in principle), but I dont know how it will treat the mesh processor boundaries.
It is possible that I have to add some specieal treatment there in order to remove false features.

After each iteration I am using the movePoints functionality which is overkill, but I
use it to make life simpler when calculating face-normals (and because I want to add
a smoother on the entire mesh later)
what you can try to do is to move it outside the loop (in snapEdge.C)
Code:
        //mesh.movePoints(newPoints);
        //mesh.checkMesh();
        Info << "Done!" << endl;
    }
mesh.movePoints(newPoints);
niklas is offline   Reply With Quote

Old   September 3, 2010, 05:27
Default
  #75
Member
 
norman1981's Avatar
 
Norman Del Puppo
Join Date: Mar 2009
Location: Hinwil, CH
Posts: 57
Rep Power: 8
norman1981 is on a distinguished road
Quote:
Originally Posted by bastil View Post
Hi Niklas,

definitly good news. I will give it a try soon.
The only thing missing now is the integration into snappy, maybe I will try this myself.

Regards Bastian
Hi Everyone,

first of all, thank you Niklas for sharing this tool. I am working on ship hydrodynamics, I tried many times in the past to generate grid good enough to capture yacht fins or transom edges using snappyHexMesh without success, therefore I'll give a try to your tool and I will let you know (I hope you'll have some time to give me some advices if I'll need some help )
Anyway, yesterday I integrated your last snapEdge version into snappyHexMesh for fun. I referred to the the snappyHexMesh version that comes with OpenFOAM-1.5-dev (I am using this OF version) . If someone has a heavy working snapEdge test case to give me I would like to test this snapEdgeHexMesh tool before saying it is working and sharing it

Kind regards

Norman

Last edited by norman1981; September 3, 2010 at 07:16.
norman1981 is offline   Reply With Quote

Old   September 3, 2010, 09:28
Default
  #76
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 471
Rep Power: 11
bastil is on a distinguished road
Quote:
Originally Posted by norman1981 View Post
Anyway, yesterday I integrated your last snapEdge version into snappyHexMesh for fun. I referred to the the snappyHexMesh version that comes with OpenFOAM-1.5-dev (I am using this OF version) . If someone has a heavy working snapEdge test case to give me I would like to test this snapEdgeHexMesh tool before saying it is working and sharing it
Great work Norman. I would be highly interested in this. I am sorry I can not share my case but I would propose to use the motorbike snappy testcase which is similar to what I do. Maybe refine the mesh and try running the whole thing (casellate, snap with edges and layers) in parallel.
I can also offer you to install your "beta" version here, run some tests and provide you with a feedback afterwards. In that case you can sent me your beta "snapEdgeHexMesh"

Regards Bastian
bastil is offline   Reply With Quote

Old   September 3, 2010, 09:37
Default
  #77
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 471
Rep Power: 11
bastil is on a distinguished road
Quote:
Originally Posted by niklas View Post
@bastil
ahh, now I understand why you want to run it in parallell.
Thanks for you proposals Niklas. I will give it a try. The reason for running it in parallel is not just speed. We run the whole process in parallel because of memory limitations and we cant (and dont want) to include a serial process in here.

Regards Bastian
bastil is offline   Reply With Quote

Old   September 3, 2010, 11:03
Default
  #78
Member
 
Johannes Baumann
Join Date: Mar 2009
Location: Baden-Wuerttemberg, Germany
Posts: 42
Rep Power: 8
johannes is on a distinguished road
Hi Niklas,

thanks for your explanations and the video. I think I know what you mean.

Regarding the planar surfaces on the stl geometry, that's an issue from the stl creation process I (have to) use, because my CAD system is only able to convert volume bodies into an stl file but not surfaces. This means I have to extrude all the surfaces in normal direction in order to create volumes.

Now if the extrusion thickness is chosen too small compared to the snapEdge tolerance, snapEdge could be attracted by stl features on the 'opposite' side of the stl volume body.
I'll check with an increased stl thickness and will also try your angle settings.

Best regards,
Johannes
johannes is offline   Reply With Quote

Old   September 4, 2010, 12:03
Default
  #79
Senior Member
 
Ziad Boutanios
Join Date: Mar 2009
Location: Montréal, Canada
Posts: 113
Rep Power: 8
ziad is on a distinguished road
Hi Johannes,

I create my stl files using salome GEOM and it is capable of exporting individual surfaces into ascii/binary stl files. GEOM won't import stl files though.

Ziad
ziad is offline   Reply With Quote

Old   September 4, 2010, 15:07
Default
  #80
Member
 
Johannes Baumann
Join Date: Mar 2009
Location: Baden-Wuerttemberg, Germany
Posts: 42
Rep Power: 8
johannes is on a distinguished road
Hi Ziad,

thanks for your input, nice to know it works with Salome. As long as there's an import feature for step or iges files I'll give it a try. Another option would be to edit the volume body stl file and delete all unnecessary faces.

Basically, I would like the geometry processing workflow to be a as simple and streamlined as possible without involving too many different software tools.
Btw: My existing procedure was working without problems for standard sHM meshing so far.

Best regards,
Johannes
johannes is offline   Reply With Quote

Reply

Tags
edges, jagged edges, snappyhexmesh

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SnappyHexMesh for internal Flow vishwa OpenFOAM Native Meshers: snappyHexMesh and Others 23 August 6, 2014 03:50
external flow with snappyHexMesh chelvistero OpenFOAM 11 January 15, 2010 20:43
setting boundary conditions on internal edges Renate Stump FLUENT 4 November 7, 2008 11:55
Edges in Gambit Naghman Khan FLUENT 3 October 3, 2007 06:36
Simple Meshed Edges Problem Rich Main CFD Forum 1 February 9, 2005 02:38


All times are GMT -4. The time now is 11:36.