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   June 24, 2010, 09:35
Default
  #21
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 300
Rep Power: 10
openfoam_user is on a distinguished road
Niklas,

it works with tolerance 0.85 !

Now I will try it with layers around the cube.

And with a more complex geometry.

Great tool !

Stephane.
openfoam_user is offline   Reply With Quote

Old   June 30, 2010, 04:29
Default
  #22
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 300
Rep Power: 10
openfoam_user is on a distinguished road
Hi Niklas,

I am trying to use our tool for the ahmed body.

Attached is a picture of the rear part of the body.

Is it possible to improve the surface mesh ?

Regards,

Stephane.
Attached Images
File Type: jpg pict1.jpg (97.4 KB, 208 views)
openfoam_user is offline   Reply With Quote

Old   June 30, 2010, 04:51
Default
  #23
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 21
niklas will become famous soon enoughniklas will become famous soon enough
does this work better?
Attached Files
File Type: c snapEdge.C (7.8 KB, 76 views)
niklas is offline   Reply With Quote

Old   June 30, 2010, 05:49
Default
  #24
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 300
Rep Power: 10
openfoam_user is on a distinguished road
Hi Niklas,

I have done a smaller case with just the rear part.

2 kind of problems remain:

1. at the corners of the oblique edges
2. on the oblique edges

Have a look at the attached picture.

Regards,

Stephane.
Attached Images
File Type: jpg cube_split_1.jpg (56.6 KB, 191 views)
openfoam_user is offline   Reply With Quote

Old   June 30, 2010, 06:33
Default
  #25
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 21
niklas will become famous soon enoughniklas will become famous soon enough
To me it just looks like its a tolerance issue.
can you mail me the case so I can play with it.

N
niklas is offline   Reply With Quote

Old   June 30, 2010, 07:16
Default
  #26
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 300
Rep Power: 10
openfoam_user is on a distinguished road
what's your mail address ?
openfoam_user is offline   Reply With Quote

Old   June 30, 2010, 07:32
Default
  #27
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 21
niklas will become famous soon enoughniklas will become famous soon enough
Quote:
Originally Posted by openfoam_user View Post
what's your mail address ?
niklas dot nordin at nequam dot se
niklas is offline   Reply With Quote

Old   June 30, 2010, 09:48
Default
  #28
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 300
Rep Power: 10
openfoam_user is on a distinguished road
Niklas,

yes it works.

No I will try it for the complete ahmed body.

Thanks,

Stephane.
openfoam_user is offline   Reply With Quote

Old   June 30, 2010, 10:27
Default
  #29
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 300
Rep Power: 10
openfoam_user is on a distinguished road
for the ahmed body some minor problems remain:

- the corner is not correct (first picture)
- near the head of the ahmed body (second picture) there is one cell with 3 edges instead of 4
- the form of the cells at the oblique edge (first picture) could be improved to obtain cells like square

stephane
Attached Images
File Type: jpg pict2.jpg (66.2 KB, 143 views)
File Type: jpg pict3.jpg (95.9 KB, 146 views)
openfoam_user is offline   Reply With Quote

Old   July 5, 2010, 14:03
Default
  #30
Member
 
Johannes Baumann
Join Date: Mar 2009
Location: Baden-Wuerttemberg, Germany
Posts: 42
Rep Power: 9
johannes is on a distinguished road
Hi Niklas,

from what I saw in this thread you did a nice job with your snapEdge tool!

I would also like to give it a try but there's a small problem which has something to do with my stl creation workflow:

Currently, the only way for me to create stls for snappy out of CAD geometry is to use multiple stl files so that every bc surface is represented by a seperate stl file. Unfortunately, snapEdge seems to be only working with one single stl which includes named sections.

Would it be possible to extend snapEdge to be able to use multiple stl files? That would be really great! But if it's just too much work to do, I'll be satisfied with the current snapEdge features and will try to change my stl creation process.

Many thanks in advance!

Best regards,
Johannes
johannes is offline   Reply With Quote

Old   July 6, 2010, 02:19
Default
  #31
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 21
niklas will become famous soon enoughniklas will become famous soon enough
That should be pretty easy.
In the meantime, if you want to try it you can process 1 stl at a time.
It writes the points to a new time directory, so if you have
startFrom latestTime;
It should be fine.

N
niklas is offline   Reply With Quote

Old   July 7, 2010, 02:42
Default
  #32
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 21
niklas will become famous soon enoughniklas will become famous soon enough
Can you try this. I dont have a case to try it on so if it doesnt work it would be great
if you could provide me with one.

http://openfoam.nequam.se/cases/snapEdge.tgz
niklas is offline   Reply With Quote

Old   July 7, 2010, 07:54
Default
  #33
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 300
Rep Power: 10
openfoam_user is on a distinguished road
Hi Niklas,

is this new version of snapEdge only for multiple stl files or also for single stl file ?

Stephane.
openfoam_user is offline   Reply With Quote

Old   July 7, 2010, 07:58
Default
  #34
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 21
niklas will become famous soon enoughniklas will become famous soon enough
Quote:
Originally Posted by openfoam_user View Post
is this new version of snapEdge only for multiple stl files or also for single stl file ?
It handles mutliple stl files as well as a single stl....like this:

stlFileNames
(
wedge.stl
);
niklas is offline   Reply With Quote

Old   July 9, 2010, 07:10
Default
  #35
Member
 
Johannes Baumann
Join Date: Mar 2009
Location: Baden-Wuerttemberg, Germany
Posts: 42
Rep Power: 9
johannes is on a distinguished road
Hi Niklas,

thank you very much for the new snapEdge version. I haven't had time to test it yet, but I think I'll have within the next few days.

Of course I can put together a small test case if it doesn't work out of the box.

Best regards,
Johannes
johannes is offline   Reply With Quote

Old   July 11, 2010, 11:30
Default
  #36
Member
 
Juho Peltola
Join Date: Mar 2009
Location: Finland
Posts: 82
Rep Power: 9
juho is on a distinguished road
Hi,

First I would like to thank Niklas for his work on snapEdge and sharing the tool!

I've been testing snappyHexMesh on a geometry where I think it would be a good tool and it proved a very useful, except for the lack of feature edge snapping. Therefore I was delighted to find the snapEdge-tool here and I've been testing it on my case. The tool is easy to use and seem to mostly takes care of the feature edge preservation. However, a couple of notes:

- My geometry consists of several stl-files. The snapping results seemed better if I only included the stl-file on one side of the edge to be snapped, instead of including them all.

- A more troublesome note. after running snapEdge my mesh fails checkMesh on face orientation:

Checking geometry...
Overall domain bounding box (-0.0256 -0.009 -0.0256) (0.0256 0.035 0.0256)
Mesh (non-empty, non-wedge) directions (1 1 1)
Mesh (non-empty) directions (1 1 1)
Boundary openness (-7.67448e-17 -1.92442e-17 -2.87288e-16) OK.
Max cell openness = 3.26249e-16 OK.
Max aspect ratio = 3.5401 OK.
Minumum face area = 5.79544e-10. Maximum face area = 1.54916e-06. Face area magnitudes OK.
Min volume = 2.88102e-12. Max volume = 1.38403e-09. Total volume = 8.936e-05. Cell volumes OK.
Mesh non-orthogonality Max: 49.7654 average: 9.28351
Non-orthogonality check OK.
***Error in face pyramids: 68 faces are incorrectly oriented.
<<Writing 68 faces with incorrect orientation to set wrongOrientedFaces
Max skewness = 1.64219 OK.

Failed 1 mesh checks.

Is this a bug or am I doing something wrong?



A picture of the geometry:


Here's a picture of the snappyHexMesh result:
http://tinypic.com/r/303l8xd/3

and the snapEdge result:
http://tinypic.com/r/24xjl38/3

-Juho
juho is offline   Reply With Quote

Old   July 11, 2010, 17:41
Default
  #37
Member
 
Johannes Baumann
Join Date: Mar 2009
Location: Baden-Wuerttemberg, Germany
Posts: 42
Rep Power: 9
johannes is on a distinguished road
Hi Niklas,

I tried snapEdge with multiple stl files and it's working as expected!

Now I just have to play around with the settings in the snapEdgeDict since most of the meshes I used for testing failed several checkMesh tests after edge-snapping.

I like the 'includeInterior' feature of edge-snapping inside a patch (e.g. for a large wall patch) but noticed that it sometimes reduces mesh quality at fillets - although there should be no need for snapping at these locations. But this might be fixed with adjusting of some settings.

One additional remark on the includeInterior switch: I had to use 'true' and 'false' instead of 'yes' and 'no' to make snapEdge work. No real problem, though.

There might be an issue with relatively large patches and/or stl files. I tried a patch with about 80k cells and a corresponding stl file of 135 MB and got a floating point exception during the 'Smoothing patch faces...' phase. I'm currently testing different settings since it works once in while but creates a low quality mesh. I'll keep you updated on this.

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

Old   July 12, 2010, 02:23
Default
  #38
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 300
Rep Power: 10
openfoam_user is on a distinguished road
Hi Johannes,

just set nSmootherIterations 0

and the 'Smoothing patch faces' will disappears.

Stephane.
openfoam_user is offline   Reply With Quote

Old   July 12, 2010, 02:45
Default
  #39
Super Moderator
 
niklas's Avatar
 
Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 21
niklas will become famous soon enoughniklas will become famous soon enough
Juho:

Sometimes I get those bad faces as well. Snapping the edges all the way to feature-lines sometimes cause this and what I do then is to set the relaxation to something lower than 1. This will not yield an exact feature representation, but visibly you can hardly see any difference and
thats 'good enough' for me. It all depends on how the mesh produced by snappyHexMesh looks. Sometimes an inlet patch can be more or less on the adjacent wall and the neighbouring face can be more or less on the inlet and that creates some problem. Ideally I'd like to have the program move the faces to/from patches if the are too far
outside, but that's something for the future


Johannes:
If you are using includeInterior its important that you dont set tolerance to something larger than 1 as this will 'attract' edges that are really too far away. I've tried to improve this by checking the angle between the face-edge and feature line so that it doesnt snap
edges that are perpendicular to the feature-line, but its more
or less a question of tolerance.

I recommend you dont do any smoothing, its something I'm working on and its not very good atm. Just set the smoother iterations to 0.
I should have commented out that section.

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.

N

Edit:
Oh and if you have any problems with a case I'd really like to have it so I can improve snapEdge,
as almost all of my stl's are quite simple
pipes.
niklas is offline   Reply With Quote

Old   July 13, 2010, 08:58
Default
  #40
Senior Member
 
stephane sanchi
Join Date: Mar 2009
Posts: 300
Rep Power: 10
openfoam_user is on a distinguished road
Hi Niklas,

it would be nice to have the -overwrite option as for snappyHexMesh.

After having used your snapEdge tool I have the following files:

/3/meshPhi.gz
/3/polyMesh/points.gz

Do I have to put both file into the directory :

/constant/polyMesh/

Regards,

Stephane.
openfoam_user 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 22:11.