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

[snappyHexMesh] SHM: sharp edge resolving problem with explicit feature edges

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 9, 2017, 15:22
Default SHM: sharp edge resolving problem with explicit feature edges
  #1
Member
 
Piotr Ładyński
Join Date: Apr 2017
Posts: 55
Rep Power: 9
piotr.mecht is on a distinguished road
I'm trying to prepare some mesh from simple geometry with snappyHexMesh. Without defining feature edge refinement every sharp edge turns round after meshing. With (explicitly defined) feature edges refinements too much of cells remain on edges during castellation, so snapped mesh looks 'framed'. What parameter should i control to resolve my edges correctly?
Attached Images
File Type: png STLmeshed.png (47.9 KB, 563 views)
File Type: png featureExtract.png (61.8 KB, 588 views)
File Type: png noFeatureExtractCastelated.png (28.8 KB, 500 views)
File Type: png noFeatureExtract.png (50.7 KB, 493 views)
Attached Files
File Type: txt snappyHexMeshDict.txt (10.1 KB, 110 views)
piotr.mecht is offline   Reply With Quote

Old   December 9, 2017, 15:47
Default
  #2
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 14
HakikiCanakkaleli is on a distinguished road
surfaceFeatureExtract?

Plus, in your snappyHexMeshDict, there is a conflicting setting:

Quote:
//- Detect (geometric) features by sampling the surface
implicitFeatureSnap false;

//- Use castellatedMeshControls::features
explicitFeatureSnap false;
At least one of them should be turned on.
HakikiCanakkaleli is offline   Reply With Quote

Old   December 9, 2017, 16:11
Default
  #3
Member
 
Piotr Ładyński
Join Date: Apr 2017
Posts: 55
Rep Power: 9
piotr.mecht is on a distinguished road
That commented out features{} geometry was obtained exactly with surfaceFeatureExtract (devided into 2 files with blender). When i use this part of code, it works like this: low refinement around that features leaves rounded edges, higher refinement leads to my undesired frame along the edges/
piotr.mecht is offline   Reply With Quote

Old   December 9, 2017, 16:13
Default
  #4
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 14
HakikiCanakkaleli is on a distinguished road
It seems that I edited my answer as you have been writing your answer. Please consider it. In addition increase the number of iterations of the entry below:

Quote:
nFeatureSnapIter 10;
If you have already used 'surfaceFeatureExtract', you also need to turn on 'explicitFeatureSnap' and turn off 'implicitFeatureSnap' as this dominates the explicit one.
HakikiCanakkaleli is offline   Reply With Quote

Old   December 9, 2017, 16:17
Default
  #5
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 14
HakikiCanakkaleli is on a distinguished road
OK, I have been looking at your Dict entirely now.

Code:
file "wallEdges.obj";
should be
Code:
file "wallEdges.eMesh";
HakikiCanakkaleli is offline   Reply With Quote

Old   December 9, 2017, 16:53
Default
  #6
Member
 
Piotr Ładyński
Join Date: Apr 2017
Posts: 55
Rep Power: 9
piotr.mecht is on a distinguished road
Thanks for your answer.
I used explicitFeatureSnap as true (just unchecked this on my trial and error attempts). implicitFeatureSnap just doesn't work for me, when i use this instead of explicit[..] my output mesh is the same as my bounding box from blockMesh.
Unfortunately increasing nFeatureSnapIter to 20 didn't help much. Changing *.obj files to *.eMesh format makes no difference.
piotr.mecht is offline   Reply With Quote

Old   December 9, 2017, 17:26
Default
  #7
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 14
HakikiCanakkaleli is on a distinguished road
Have you visually checked eMesh files? What were your surfaceFeatureExtract settings? And could you please share the last snappyHexMeshDict in which no settings were in conflict? Plus, could you please share 'surfaceCheck *.stl' output, if possible?
HakikiCanakkaleli is offline   Reply With Quote

Old   December 10, 2017, 05:09
Default
  #8
Member
 
Piotr Ładyński
Join Date: Apr 2017
Posts: 55
Rep Power: 9
piotr.mecht is on a distinguished road
There they are
Attached Images
File Type: png eMeshBeforeDivision.png (4.6 KB, 268 views)
Attached Files
File Type: txt surfaceFeatureExtractDict.txt (1.2 KB, 67 views)
File Type: txt surfaceCheckLog.txt (2.3 KB, 39 views)
File Type: txt snappyHexMeshDict.txt (10.4 KB, 71 views)
piotr.mecht is offline   Reply With Quote

Old   December 11, 2017, 12:57
Default
  #9
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 14
HakikiCanakkaleli is on a distinguished road
Why do you convert ".eMesh" files to ".obj", and try to use them in "features"? I think this is not a valid action. Plus, could you please further refine the resolution of your STL file?
HakikiCanakkaleli is offline   Reply With Quote

Old   December 11, 2017, 13:49
Default
  #10
Member
 
Piotr Ładyński
Join Date: Apr 2017
Posts: 55
Rep Power: 9
piotr.mecht is on a distinguished road
I converted eMesh to obj, because obj was valid import format for Blender (which i used to separate edges). SHM returns:
Valid extensions are : 7 ( bdf eMesh featureEdgeMesh inp nas obj vtk )

i simply followed reasoning from this tutorial https://youtu.be/n9xYN59v3po?t=915 from Tobias Holzman (worked for him).

When i try to use features directly from eMesh (without distinguishing edge groups) effect is quite the same.

Since last time i tried: refining stl, increasing initial box division, reducing distance of bounding box from boundaries, refining features much more. Still with no sharp cuboid output.
(Attachments: refined stl and snapped mesh result)
Attached Images
File Type: png refinedSTL.png (33.2 KB, 237 views)
File Type: png Geometry2.png (24.8 KB, 241 views)
piotr.mecht is offline   Reply With Quote

Old   December 11, 2017, 13:52
Default
  #11
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 14
HakikiCanakkaleli is on a distinguished road
Can you create the box with blockMesh and the half-ellipsoid volume with snappyHex?
HakikiCanakkaleli is offline   Reply With Quote

Old   December 11, 2017, 14:04
Default
  #12
Member
 
Piotr Ładyński
Join Date: Apr 2017
Posts: 55
Rep Power: 9
piotr.mecht is on a distinguished road
Yes i know, but it's not my point. I'm not really interested in this particular channel. I'm trying to learn how to properly prepare desired mesh in sHM from cad model. I assumed that i should run correctly some simple evaluation cases before my complex heat exchanger geometry, but i got stuck at this point.
piotr.mecht is offline   Reply With Quote

Old   December 11, 2017, 14:08
Default
  #13
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 14
HakikiCanakkaleli is on a distinguished road
I see. I have never considered snappyHexMeshing without blockMesh. One more thought: Can you make the refinement level for the box edges zero? May be the issue is the castellation level therein.
HakikiCanakkaleli is offline   Reply With Quote

Old   December 11, 2017, 14:30
Default
  #14
Member
 
Piotr Ładyński
Join Date: Apr 2017
Posts: 55
Rep Power: 9
piotr.mecht is on a distinguished road
Edges don't look like picture frame in that case, but they are rounded. That's why i wanted to refine edges in the first place. When i used feature edges distortions are visible on castellated level, so it's probably something on this level.
Attached Images
File Type: png Edges55.png (36.6 KB, 208 views)
File Type: png Edges56.png (25.5 KB, 177 views)
File Type: png castellated1111.png (5.5 KB, 157 views)
piotr.mecht is offline   Reply With Quote

Old   December 12, 2017, 06:34
Default
  #15
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 14
HakikiCanakkaleli is on a distinguished road
IMHO, with any software, the user needs to understand how that software was created to work, and not simply expect it to work the way they think it should work. I believe your frustration level would be greatly diminished if you change your meshing paradigm towards blockMesh+snappyHex. Otherwise, I yield. :] Thanks anyways for raising an interesting question!
HakikiCanakkaleli is offline   Reply With Quote

Old   December 14, 2017, 14:39
Default
  #16
New Member
 
Andrés Tapia
Join Date: May 2017
Location: Santiago, Chile.
Posts: 1
Rep Power: 0
andrestg85 is on a distinguished road
I had a similar problem a few months ago. I finally discovered that you have to make a blockmesh bigger than the stl file that you want to model, and in that case almost all the edges will be very close to the original stl file.

I read that you are not using blockmesh, but maybe you can fix the problem just making a bigger blockmesh (or similar) before using SHM.

Also you can play activating/deactivating the elements of features line on SHM:
Code:
features
    (
//        {file "canal.eMesh"; level 0;}   
//        {file "fondo.eMesh"; level 0;}
    );
in generall, when i deactivate the features i get rounded edges.
Abhinav_Nagarajan likes this.
andrestg85 is offline   Reply With Quote

Old   December 17, 2017, 09:35
Default
  #17
Member
 
Piotr Ładyński
Join Date: Apr 2017
Posts: 55
Rep Power: 9
piotr.mecht is on a distinguished road
I think i've finally solved my problem with snappyHexMesh. After increasing tolerance field in snapControls up to 1.0 my snapped edges got sharp (pics.).

I also reconstructed my geometry with blockMesh (just for fun). I wasn't satisfied with 8 or 9 hex blocks effect, so i tried to build my case from some more hexes, but the more hex field i distinguished, the harder it was to match cell grading in each block (and much easier to make some mistakes). I'll leave blockMesh for really the simpliest cases (simple cannels with no obstacles in the middle).

@andrestg85 I actually used blockMesh to create my bounding box and it had some offset from my geometry. I tried to pick different values, but my results weren't any better (when bounding box was really close there were almost no redundant cells on the edges, but I still wasn't satisfied with this round shape in the middle).
Attached Images
File Type: png snappedMesh.png (24.7 KB, 337 views)
File Type: png snapped2.png (62.8 KB, 370 views)
Gerry Kan likes this.
piotr.mecht is offline   Reply With Quote

Old   April 27, 2020, 05:23
Default
  #18
New Member
 
Mathias Sřnderskov Schaltz
Join Date: Nov 2018
Location: Denmark
Posts: 4
Rep Power: 8
MathiasSonderskov is on a distinguished road
Hi @piotr.mecht,

How did your blockMeshDict and snappyHexMeshDict end up looking? I've got same issues.

Quote:
Originally Posted by piotr.mecht View Post
I think i've finally solved my problem with snappyHexMesh. After increasing tolerance field in snapControls up to 1.0 my snapped edges got sharp (pics.).

I also reconstructed my geometry with blockMesh (just for fun). I wasn't satisfied with 8 or 9 hex blocks effect, so i tried to build my case from some more hexes, but the more hex field i distinguished, the harder it was to match cell grading in each block (and much easier to make some mistakes). I'll leave blockMesh for really the simpliest cases (simple cannels with no obstacles in the middle).

@andrestg85 I actually used blockMesh to create my bounding box and it had some offset from my geometry. I tried to pick different values, but my results weren't any better (when bounding box was really close there were almost no redundant cells on the edges, but I still wasn't satisfied with this round shape in the middle).
MathiasSonderskov is offline   Reply With Quote

Old   May 3, 2020, 03:31
Default
  #19
Member
 
Piotr Ładyński
Join Date: Apr 2017
Posts: 55
Rep Power: 9
piotr.mecht is on a distinguished road
Quote:
Originally Posted by MathiasSonderskov View Post
Hi @piotr.mecht,

How did your blockMeshDict and snappyHexMeshDict end up looking? I've got same issues.

Can't remember what the problem was back then, I don't have these kind of issues today Nevertheless I've found the files on my old laptop.
Attached Files
File Type: zip files01.zip (6.4 KB, 78 views)
MathiasSonderskov likes this.
piotr.mecht is offline   Reply With Quote

Old   May 8, 2020, 20:59
Default Sharp edges with snappyHexMesh
  #20
New Member
 
Aaron B.
Join Date: Nov 2019
Posts: 6
Rep Power: 6
buesinaw is on a distinguished road
Would you mind providing the stl files and obj files called in your snappyHexMeshDict file?

kanau.stl
wallEdges.obj
obstacleEdges.obj

Thank you for considering this request.

Last edited by buesinaw; May 8, 2020 at 21:03. Reason: Forget to request all files called in snappyHexMeshDict
buesinaw is offline   Reply With Quote

Reply

Tags
shm, surfacefeatureextract


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
how to set periodic boundary conditions Ganesh FLUENT 15 November 18, 2020 07:09
[cfMesh] layer addiction on sharp edges student666 OpenFOAM Community Contributions 1 October 27, 2020 19:22
[snappyHexMesh] sHM layer process keeps getting killed MBttR OpenFOAM Meshing & Mesh Conversion 4 August 15, 2016 04:21
[snappyHexMesh] Manually define feature edges in SHM palgroth OpenFOAM Meshing & Mesh Conversion 0 July 9, 2014 05:22
OpenFOAM with Cygwin kitchener OpenFOAM Installation 6 April 25, 2006 00:09


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