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

[snappyHexMesh] snappyHexMesh feature edge

Register Blogs Community New Posts Updated Threads Search

Like Tree18Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 19, 2011, 14:04
Default snappyHexMesh feature edge
  #1
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 460
Rep Power: 18
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Hi all;
I'm trying to mesh a simple circular cylinder but I'm having the classical snappyHexMesh troubles with the free end edge.
Now, I saw this news on the openfoam website:
http://www.openfoam.com/news/snappyH...ature-edge.php

It could help me out a lot. How does that work? Any idea? Could not find anything on the user guide…

Thank you!
lovecraft22 is offline   Reply With Quote

Old   June 19, 2011, 15:23
Default
  #2
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi lovecraft22,

I was thinking about this myself... It's here: "tutorials/mesh/snappyHexMesh/flange"
Keep in mind that you must have at least OpenFOAM 2.0.0!

Check the Allrun script on that folder for more details.

And next time you want to find a file, here's two example commands:
Code:
find . -name "snappy*Dict"
find . -iname "snappy*dict"
Best regards,
Bruno

PS: must... stop... drooling.... since OpenFOAM 1.5 that people have been waiting for this feature... me included
__________________
wyldckat is offline   Reply With Quote

Old   June 19, 2011, 15:32
Default
  #3
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
since OpenFOAM 1.5 that people have been waiting for this feature... me included
Yes I agree. I think we should use this thread to exchange experience with this new feature - how does it work,...?

Regards Bastian
bastil is offline   Reply With Quote

Old   June 19, 2011, 15:55
Default
  #4
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Hi Bastian,

OK, to sum up:
  • This command automagically extracts the feature edges:
    Code:
    surfaceFeatureExtract -includedAngle 150 -writeObj constant/triSurface/flange.stl flange
    It creates the file constant/triSurface/flange.eMesh.
  • It also creates a lot of debug related data, such as *.obj files, ./flange and constant/extendedFeatureEdgeMesh/flange.extendedFeatureEdgeMesh
  • In system/snappyHexMeshDict is defined that:
    Code:
    // Explicit feature edge refinement
        // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
        // Specifies a level for any cell intersected by its edges.
        // This is a featureEdgeMesh, read from constant/triSurface for now.
        features
        (
            {
                file "flange.eMesh";
                level 0;
            }
        );
The rest is the usual must refine here and there in snappyHexMeshDict

Tip - Try running:
Code:
surfaceFeatureExtract -help
Best regards,
Bruno

PS: who needs drugs, when one can drool so easily......
romant, nimasam, mgdenno and 11 others like this.
__________________
wyldckat is offline   Reply With Quote

Old   June 19, 2011, 16:10
Default
  #5
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 460
Rep Power: 18
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Thank you wyldckat, can't see any difference though…
I did the same ad the tutorial with my cylinder without any difference with or without the feature edge…
lovecraft22 is offline   Reply With Quote

Old   June 19, 2011, 16:20
Default
  #6
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 460
Rep Power: 18
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Did you manage to get it working with nice results?

Any way to check whether the edge was picked up correctly? Paraview doesn't seem to like this .eMesh file…
CFD-Henning likes this.

Last edited by lovecraft22; June 19, 2011 at 16:37.
lovecraft22 is offline   Reply With Quote

Old   June 19, 2011, 16:37
Default
  #7
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Attached are a few pictures showing details about the snapped edges...

Note: I'm not using the official OpenFOAM mesh reader for ParaView, I'm using the internal reader in ParaView 3.8.0... so there might be some referential discrepancies, therefore that might be the reason why the STL seems a bit offset from the resulting mesh.

edit: there's plenty of files with info about the edges, but currently I have no clue how to visualize them. I haven't built the official plug-ins yet, so I haven't check them yet either

edit2: Just tested with the official plugins and I've confirmed that the snapping isn't perfect, so the attached pictures are validated. There might be some tolerance variable somewhere... or additional refinement is necessary.

Best regards,
Bruno
Attached Images
File Type: jpg pic01.jpg (61.6 KB, 1309 views)
File Type: jpg pic02.jpg (36.6 KB, 1105 views)
File Type: jpg pic03.jpg (32.1 KB, 1021 views)
File Type: jpg pic04.jpg (82.0 KB, 998 views)
File Type: jpg pic05.jpg (39.2 KB, 841 views)
__________________

Last edited by wyldckat; June 19, 2011 at 19:45. Reason: because lovecraft22 edited his post at the exact same time :) | see "edit2:" as well.
wyldckat is offline   Reply With Quote

Old   June 20, 2011, 05:31
Default
  #8
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Bruno,

Quote:
Originally Posted by wyldckat View Post


  • // Specifies a level for any cell intersected by its edges.
    // This is a featureEdgeMesh, read from constant/triSurface for now.
    features
    (
    {
    file "flange.eMesh";
    level 0;
    }
    );[/CODE]

This is old staff. This eMesh file is used to refine to a specified level (0 in your case which means no refinement at all) at all explicit feature edges given in the file. This has already been possible before. I think the following parameter is the one, did you use it in your test?
Code:
//- Highly experimental and wip: number of feature edge snapping
//  iterations. Leave out altogether to disable.
nFeatureSnapIter 10;
What I am not sure is if it only works with both a eMesh-File and the parameter nFeatureSnapIter > 0 or if the eMesh-File is not required in case you wanto do to snapping to edges but no additional edge refinement.. However, since level 0 does not really make sense for refinement (since it does not refine at all) I guess that the eMesh-File is required for feature edge snapping.

Regards Bastian
bastil is offline   Reply With Quote

Old   June 20, 2011, 06:49
Default
  #9
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

Quote:
Originally Posted by lovecraft22 View Post
Any way to check whether the edge was picked up correctly? Paraview doesn't seem to like this .eMesh file…
I've just spotted something interesting: JavaView
This application can be used to open ".obj" files, as indicated here:
Quote:
Originally Posted by http://www.openfoam.com/features/mesh-conversion.php
writeMeshObj For mesh debugging: writes mesh as three separate OBJ files which can be viewed with e.g. javaview
As I said before, *.obj files are generated in the tutorial case.

I haven't tested JavaView yet... hopefully it might open eMesh files as well... but I doubt it, since last I looked, it was an OpenFOAM format.

@Bastian:
Quote:
Originally Posted by bastil View Post
I think the following parameter is the one, did you use it in your test?
I only skimmed through the files and only picked up on the big things... I didn't see that option, nor have I tried to figure out how it all works...

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   June 20, 2011, 14:04
Default
  #10
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 460
Rep Power: 18
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Yu can load the .obj files in paraview…
lovecraft22 is offline   Reply With Quote

Old   June 20, 2011, 14:52
Default
  #11
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 460
Rep Power: 18
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
Quote:
Originally Posted by bastil View Post
Code:
//- Highly experimental and wip: number of feature edge snapping
//  iterations. Leave out altogether to disable.
nFeatureSnapIter 10;
What I am not sure is if it only works with both a eMesh-File and the parameter nFeatureSnapIter > 0 or if the eMesh-File is not required in case you wanto do to snapping to edges but no additional edge refinement.. However, since level 0 does not really make sense for refinement (since it does not refine at all) I guess that the eMesh-File is required for feature edge snapping.

Regards Bastian
You're right Bastian, that's the key parameter!
Here's the difference between having it set to 10 (on the left) and having it commented out (on the right):

lovecraft22 is offline   Reply With Quote

Old   June 21, 2011, 04:15
Default
  #12
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Quote:
Originally Posted by lovecraft22 View Post
You're right Bastian, that's the key parameter!
Here's the difference between having it set to 10 (on the left) and having it commented out (on the right):
Thanks. Pictures are missing but its ok. The only question left: Did you additionally use an eMesh file (I think so) or did it work without? I suspect that the eMesh files is required to "mark" the features to snap to.

Regards Bastian
bastil is offline   Reply With Quote

Old   June 21, 2011, 05:01
Default
  #13
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 460
Rep Power: 18
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
I can see the pictures, try opening the url directly.

I haven't tested without the eMesh file. I'll do that when I'll get back home in 10 hours al let you know.
lovecraft22 is offline   Reply With Quote

Old   June 21, 2011, 15:46
Default
  #14
Senior Member
 
lore
Join Date: Mar 2010
Location: Italy
Posts: 460
Rep Power: 18
lovecraft22 is on a distinguished road
Send a message via Skype™ to lovecraft22
I commented out these lines
Code:
{
file "flange.eMesh";
level 0;
}
and I did not get the same nice result in the cylinder free end. So this .eMesh file is quite important…
lovecraft22 is offline   Reply With Quote

Old   June 22, 2011, 04:53
Default
  #15
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!
Quote:
Originally Posted by lovecraft22 View Post
Any way to check whether the edge was picked up correctly? Paraview doesn't seem to like this .eMesh file…
I believe I've found how to make them readable in ParaView:
Quote:
Originally Posted by http://www.openfoam.com/docs/user/standard-utilities.php
surfaceFeatureConvert Convert between edgeMesh formats
That page deserves a very close reading... there are so many new goodies in OpenFOAM 2.0

Ah, and the directory listing can also help get our attention on some more genuine pearls: http://foam.sourceforge.net/docs/cpp/dirs.html

Quote:
Originally Posted by lovecraft22 View Post
Yu can load the .obj files in paraview…
I forgot about that...

Best regards,
Bruno
__________________

Last edited by wyldckat; June 23, 2011 at 06:26. Reason: see "I forgot"... and I had a typo..
wyldckat is offline   Reply With Quote

Old   June 22, 2011, 18:46
Default
  #16
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Quote:
Originally Posted by wyldckat View Post
Greetings to all!

I believe I've found how to make them readable in ParaView:
More important than imprting the features to keep into Paraview (btw. what format do you need to convert it to?) is to check which of thease features are really captured by the snapping process and which are not. Maybe this could be done by finding the features (with the same angle) on the final mesh and compare theses edges with the initial once? Ideas how to do that?

Regards Bastian
bastil is offline   Reply With Quote

Old   June 23, 2011, 06:23
Default
  #17
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
I made a post-and-run yesterday so I didn't give any details, nor did I have a compiled OpenFOAM 2.0.0/x at hand.

Now that I have a build at hand and a bit more time:
  1. Formats on the Directories link I gave before: edgeFormats
  2. When it doesn't tell you, use bananas:
    Code:
    surfaceFeatureConvert flange.eMesh flange.banana
    (...)
    Unknown file extension for writing : banana
    Valid types: ( eMesh inp obj vtk )
    I chose vtk for ParaView
    And somehow NAS doesn't seem to be on the list... I believe inp is a STARCD format.
  3. We have to give it the full or relative path for each file, so there isn't any smart system for loading from dictionary as in snappyHexMesh.
As for:
Quote:
Originally Posted by bastil View Post
is to check which of thease features are really captured by the snapping process and which are not. Maybe this could be done by finding the features (with the same angle) on the final mesh and compare theses edges with the initial once? Ideas how to do that?
Sadly I'm not experienced enough to figure this out

All I know is that from the tutorial we can easily have access to the edges used by snappyHexMesh, namely:
  • We can see the eMesh from the converted format.
  • We can see the object files .obj exported by surfaceFeatureExtract.
The rest for now is visual analysis. I think some of the edges that have bad snaps are due to lack of resolution, but I'm possibly/probably wrong Such example is Björn's blog post: http://www.discretizer.org/ from June 18, 2011.

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Old   December 9, 2011, 10:57
Default
  #18
New Member
 
Sebastian Herbst
Join Date: Oct 2011
Location: Germany
Posts: 4
Rep Power: 15
sebasthe is on a distinguished road
Hi there!

I am new to OpenFOAM and tried my very best but I stuck at a question about snappyHexMesh which could belong to this thread.

What I am trying to do for a first step is to build a triangular geometry which later will be used to construct a rod bundle geometry. But unfortunately as you see in the pictures I attached there is a problem with sharp edges.

What I tried:
- with and without featureEdgeRefinement
- gave it a try with a slightely modified geometry (rounded edges -> see picture)
- tried to adjust a lot of parameters in the snappyHesMeshDict (without success)
-I created the .stl by myself but also tried an CAD export without improvements.
- checked my boundary file: inlet and outlet are empty while the sides of my block are set as wall boundaries.

I found a thread from last year which is about a tool called snapEdge. But in case I got that right, by now OF2.0.1 (which I use) originaly brings those functions. So there is no need for snapEdge anymore. Please correct me if I am wrong. :-)

I hope I provided all relevant information and am looking forward for any tips and hints.

Thank you in advance :-)

cheers
Sebastian

snappyHexMeshDict:
snappyHexMeshDict.txt


Pictures:
triagle_block.jpg triagle_round_edges.jpg triagle_sharp_edges_1.jpg triagle_sharp_edges_2.jpg
sebasthe is offline   Reply With Quote

Old   December 12, 2011, 12:32
Default
  #19
Senior Member
 
BastiL
Join Date: Mar 2009
Posts: 530
Rep Power: 20
bastil is on a distinguished road
Quote:
Originally Posted by sebasthe View Post
I found a thread from last year which is about a tool called snapEdge. But in case I got that right, by now OF2.0.1 (which I use) originaly brings those functions. So there is no need for snapEdge anymore. Please correct me if I am wrong. :-)
Sebastian, you are right about the fact that OF2.0.1 snappyHexMesh comes with featureEdgeHandling. The corners of you triangle look fine but the sides are the problem - how is the "box" constructed?

Regards Bastian
bastil is offline   Reply With Quote

Old   December 12, 2011, 17:49
Default
  #20
Retired Super Moderator
 
Bruno Santos
Join Date: Mar 2009
Location: Lisbon, Portugal
Posts: 10,981
Blog Entries: 45
Rep Power: 128
wyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to allwyldckat is a name known to all
Greetings to all!

@Sebastian: My guess is that surfaceFeatureExtract didn't give you a good ".eMesh". A bad angle will result in bad line references for snapping
Open the ".obj" files in ParaView, namely the ones that were placed in your case folder after running surfaceFeatureExtract. Check if there are any/all necessary lines for actually snapping the edges If not, try another angle!

Best regards,
Bruno
__________________
wyldckat is offline   Reply With Quote

Reply


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] Failed Edge Snap with box geometry and correct feature capture thiagomarinho OpenFOAM Meshing & Mesh Conversion 7 May 7, 2022 10:19
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
[snappyHexMesh] snappyHexMesh: Feature snapping of thin membrane edge gooofy OpenFOAM Meshing & Mesh Conversion 7 September 19, 2016 05:29
[snappyHexMesh] snappyHexMesh doesn't do feature edge snapping wc34071209 OpenFOAM Meshing & Mesh Conversion 1 May 7, 2014 17:47
fluent add additional zones for the mesh file SSL FLUENT 2 January 26, 2008 12:55


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