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

[snappyHexMesh] feature edges ignored for a pipe

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By Yann
  • 1 Post By AtoHM
  • 1 Post By linnemann
  • 1 Post By linnemann

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 28, 2022, 09:47
Default feature edges ignored for a pipe
  #1
Member
 
Wolfram Schneider
Join Date: Jan 2018
Location: Germany
Posts: 57
Rep Power: 8
Wolfram is on a distinguished road
Hi all,

I am trying to mesh a cylinder with a propeller inside. sHM ignores the feature edges provided by the in- and outlet of the cylinder, while inner feature edges provided by the propeller are captured properly.

Screenshot 2022-07-28 140823.jpg

The error message by sHM is shown below:

Code:
Refinement phase
----------------

Found point (0 0 0.05) in cell 43665 on processor 0
Reading external feature lines.
Refinement level 2 for all cells crossed by feature "rrInlet.eMesh" (72 points, 72 edges).
Read feature lines in = 0.06 s


Feature refinement iteration 0
------------------------------

Marked for refinement due to explicit features    : 0 cells.
Determined cells to refine in = 0 s
Selected for feature refinement : 0 cells (out of 135000)
Stopping refining since too few cells selected.


Surface refinement iteration 0
Wolfram is offline   Reply With Quote

Old   July 29, 2022, 02:49
Default
  #2
Senior Member
 
M
Join Date: Dec 2017
Posts: 642
Rep Power: 12
AtoHM is on a distinguished road
What refinement levels are you setting for the surfaces and edges?
AtoHM is offline   Reply With Quote

Old   July 29, 2022, 02:59
Default
  #3
Member
 
Wolfram Schneider
Join Date: Jan 2018
Location: Germany
Posts: 57
Rep Power: 8
Wolfram is on a distinguished road
Quote:
Originally Posted by AtoHM View Post
What refinement levels are you setting for the surfaces and edges?
I tried levels from 2 to 6. Unfortunately, the edges are not snapped regardless of the refinement (for sure, the influence of "chopped" is less obvious)
Wolfram is offline   Reply With Quote

Old   July 29, 2022, 03:25
Default
  #4
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,066
Rep Power: 26
Yann will become famous soon enough
Hi Wolfram,

Could you post your snappyHexMeshDict so we can have a look?

Yann
Yann is online now   Reply With Quote

Old   July 29, 2022, 03:33
Default
  #5
Member
 
Wolfram Schneider
Join Date: Jan 2018
Location: Germany
Posts: 57
Rep Power: 8
Wolfram is on a distinguished road
Quote:
Originally Posted by Yann View Post
Hi Wolfram,

Could you post your snappyHexMeshDict so we can have a look?

Yann
Sure, many thanks for your help in advance.

snappyHexMeshDict.txt
Wolfram is offline   Reply With Quote

Old   July 29, 2022, 04:15
Default
  #6
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,066
Rep Power: 26
Yann will become famous soon enough
Thanks!

Have you tried switching from implicitFeatureSnap to explicitFeatureSnap? AFAIK you have to be in explicit mode in order to use the parameters defined in the features subdictionary for snapping.

Code:
        // Detect (geometric only) features by sampling the surface
        // (default=false).
        implicitFeatureSnap false;

        // Use castellatedMeshControls::features (default = true)
        explicitFeatureSnap true;
It does not explain why the features are not refined though, as the parameters seem to be read by snappy according to your log file.

How do you visualize the eMesh files in paraView ?

The snapping issue on the cylinder also might be related to the use of separate STL files rather than one single STL for the whole cylinder. This is probably another thing worth trying.

Yann
AtoHM likes this.
Yann is online now   Reply With Quote

Old   July 29, 2022, 04:36
Default
  #7
Senior Member
 
M
Join Date: Dec 2017
Posts: 642
Rep Power: 12
AtoHM is on a distinguished road
Another thought: resolveFeatureAngle seems offly high. Try 30.
Yann likes this.
AtoHM is offline   Reply With Quote

Old   July 29, 2022, 04:42
Default
  #8
Member
 
Wolfram Schneider
Join Date: Jan 2018
Location: Germany
Posts: 57
Rep Power: 8
Wolfram is on a distinguished road
Quote:
Originally Posted by AtoHM View Post
Another thought: resolveFeatureAngle seems offly high. Try 30.
true. I am sorry, the uploaded file is from a "trial". The resolveFeatureAngle was examined with values from 5 - 91
Wolfram is offline   Reply With Quote

Old   July 29, 2022, 06:17
Default
  #9
Senior Member
 
Nico
Join Date: Jan 2022
Location: Germany
Posts: 122
Rep Power: 6
Hr_kules is on a distinguished road
Hey,

you couldtry to use a single eMesh file. I have noticed i a log file that always only one was used and this one wasn't even the desired region. Apaprt from that make sure that the stl used to extract the eMesh is also closed that way you should be able to utilize the eMesh.

And try to use the explicit snapping! Hope i could help.
Hr_kules is offline   Reply With Quote

Old   July 30, 2022, 13:21
Default
  #10
Member
 
Wolfram Schneider
Join Date: Jan 2018
Location: Germany
Posts: 57
Rep Power: 8
Wolfram is on a distinguished road
Quote:
Originally Posted by Hr_kules View Post
Hey,

you couldtry to use a single eMesh file. I have noticed i a log file that always only one was used and this one wasn't even the desired region. Apaprt from that make sure that the stl used to extract the eMesh is also closed that way you should be able to utilize the eMesh.

And try to use the explicit snapping! Hope i could help.
Hi,

I tried to use the single eMesh. It is the circle in the screenshot. Unfortunately the error is persistent.
Wolfram is offline   Reply With Quote

Old   August 1, 2022, 01:19
Default
  #11
Senior Member
 
M
Join Date: Dec 2017
Posts: 642
Rep Power: 12
AtoHM is on a distinguished road
Another shot in the dark: strange things can happen during the run, if the prescribed locationInMesh hits a face or node. Your choice seems likely to hit one of these on the background mesh or refined mesh during the castellatedMesh process.
To avoid this, use slightly off float numbers, in your case (0.00013 -0.00031 0.050012) for example. Maybe this fixes things.
AtoHM is offline   Reply With Quote

Old   August 1, 2022, 02:28
Default
  #12
Member
 
Wolfram Schneider
Join Date: Jan 2018
Location: Germany
Posts: 57
Rep Power: 8
Wolfram is on a distinguished road
Quote:
Originally Posted by Yann View Post
Thanks!

Have you tried switching from implicitFeatureSnap to explicitFeatureSnap? AFAIK you have to be in explicit mode in order to use the parameters defined in the features subdictionary for snapping.

Code:
        // Detect (geometric only) features by sampling the surface
        // (default=false).
        implicitFeatureSnap false;

        // Use castellatedMeshControls::features (default = true)
        explicitFeatureSnap true;
It does not explain why the features are not refined though, as the parameters seem to be read by snappy according to your log file.

How do you visualize the eMesh files in paraView ?

The snapping issue on the cylinder also might be related to the use of separate STL files rather than one single STL for the whole cylinder. This is probably another thing worth trying.

Yann
Hi Yann,

the eMesh file is shown in my screenshot. It looks reasonable. I used 3 separate stl files to define the entire cylinder in order to obtain three different patches (inlet, wall, outlet)
Wolfram is offline   Reply With Quote

Old   August 1, 2022, 06:13
Default
  #13
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,066
Rep Power: 26
Yann will become famous soon enough
Quote:
Originally Posted by Wolfram View Post
Hi Yann,

the eMesh file is shown in my screenshot. It looks reasonable. I used 3 separate stl files to define the entire cylinder in order to obtain three different patches (inlet, wall, outlet)
Hi Wolfram,

You can concatenate the 3 stl into one in order to have 1 single STl containing the different patches you need for your case.
Have a look at this post, it looks a bit similar to your issue: snappyHexMesh - 90° edges problem

Problem has been solved by using one single closed STL rather than several separate files.

Yann
Yann is online now   Reply With Quote

Old   August 2, 2022, 03:58
Default
  #14
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 555
Rep Power: 27
linnemann will become famous soon enough
Hi

I have no issues with meshing a pipe both with Implicit and Explicit feature edges.
Implicit is even a tad better. I'm using OpenFOAM 2206

If you want to use multiple STL files remember that in the surfaceFeatureExtractDict file to enable the line in bold.
Otherwise it will not generate edges at the open end of the pipe.
I like to use separate STL files to better control what edges get refined and which don't.

Forgot to ask, which version of OF are you using?
If its 4.1 which is listed in the uploaded dict then snappy was not good at snapping at the time.
EDIT: Just tried with 4.1 and it worked just fine.

Code:
wallOuter.stl
{
    extractionMethod    extractFromSurface;

    extractFromSurfaceCoeffs
    {
        includedAngle   150;
    }

    subsetFeatures
    {
        // Keep nonManifold edges (edges with >2 connected faces)
        nonManifoldEdges       no;

        // Keep open edges (edges with 1 connected face)
        openEdges       yes;
    }

        writeObj                yes;
}
You can use Holzmann excellent material as starting point.
https://holzmann-cfd.com/community/t...meshing-a-pipe
Attached Images
File Type: jpg Explicit.jpg (92.8 KB, 13 views)
File Type: jpg Implicit.jpg (92.7 KB, 13 views)
File Type: jpg MultiStl.jpg (197.6 KB, 11 views)
Yann likes this.
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.

Last edited by linnemann; August 2, 2022 at 05:27.
linnemann is offline   Reply With Quote

Old   August 3, 2022, 11:16
Default
  #15
Member
 
Wolfram Schneider
Join Date: Jan 2018
Location: Germany
Posts: 57
Rep Power: 8
Wolfram is on a distinguished road
Quote:
Originally Posted by linnemann View Post
Hi

I have no issues with meshing a pipe both with Implicit and Explicit feature edges.
Implicit is even a tad better. I'm using OpenFOAM 2206

If you want to use multiple STL files remember that in the surfaceFeatureExtractDict file to enable the line in bold.
Otherwise it will not generate edges at the open end of the pipe.
I like to use separate STL files to better control what edges get refined and which don't.

Forgot to ask, which version of OF are you using?
If its 4.1 which is listed in the uploaded dict then snappy was not good at snapping at the time.
EDIT: Just tried with 4.1 and it worked just fine.

Code:
wallOuter.stl
{
    extractionMethod    extractFromSurface;

    extractFromSurfaceCoeffs
    {
        includedAngle   150;
    }

    subsetFeatures
    {
        // Keep nonManifold edges (edges with >2 connected faces)
        nonManifoldEdges       no;

        // Keep open edges (edges with 1 connected face)
        openEdges       yes;
    }

        writeObj                yes;
}
You can use Holzmann excellent material as starting point.
https://holzmann-cfd.com/community/t...meshing-a-pipe

Many thanks for your input.

I am playing now for hours, among other things with the files from Tobias as mentioned

I tried now an combined stl-file which I merged with the "cat" command. Still the edges are not captured ...

Were you able to call the surfaceFeatureExtractDict within foam-extend4.1? Typing "surfaceFeatureExtract" in fe41 does not work, thus I created the .eMesh-files with OF2012 - maybe this is the problem???

Edit: In OF2012 the edges are captured o.O
Wolfram is offline   Reply With Quote

Old   August 4, 2022, 07:34
Default
  #16
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 555
Rep Power: 27
linnemann will become famous soon enough
Hi


Over the years I have really just decided to stick with the OpenFOAM.com version.


At a certain time .ORG, .COM and EXTEND was pretty much compatible.
Nowadays they have diverged enough that you need to tinker with many of the standard files to switch between them.


RANT BEGIN
See for example moving meshes, CGI (extend), AMI (com) and now NCC (org).
Why could they not just rework AMI so we could continue using the same setup?
Guess that's what happens when egos meet opensource collaboration.
RANT END



I only ever switch from COM version if there is a feature I really need from the other.
jherb likes this.
__________________
Linnemann

PS. I do not do personal support, so please post in the forums.
linnemann is offline   Reply With Quote

Old   August 4, 2022, 08:05
Default
  #17
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,066
Rep Power: 26
Yann will become famous soon enough
Quote:
Originally Posted by linnemann View Post
At a certain time .ORG, .COM and EXTEND was pretty much compatible.
Nowadays they have diverged enough that you need to tinker with many of the standard files to switch between them.
This is also true here on the forum. It gets harder to help people as the answer might vary according to the version used in the initial post, and I guess it must also be confusing for new users searching the forum and finding answers they cannot apply on the version they use.
Yann is online now   Reply With Quote

Old   August 5, 2022, 06:11
Default
  #18
Member
 
Wolfram Schneider
Join Date: Jan 2018
Location: Germany
Posts: 57
Rep Power: 8
Wolfram is on a distinguished road
Quote:
Originally Posted by linnemann View Post
Hi


Over the years I have really just decided to stick with the OpenFOAM.com version.


At a certain time .ORG, .COM and EXTEND was pretty much compatible.
Nowadays they have diverged enough that you need to tinker with many of the standard files to switch between them.


RANT BEGIN
See for example moving meshes, CGI (extend), AMI (com) and now NCC (org).
Why could they not just rework AMI so we could continue using the same setup?
Guess that's what happens when egos meet opensource collaboration.
RANT END



I only ever switch from COM version if there is a feature I really need from the other.

Well, I was also comfortable with the .com version. But for steady turbomachinery applications I am dependent on "mixingPlanes".
As far as I know, foam-extend is the only version offering this functionality?

Were you able to employ the "surfaceFeatureExtractDict" within foam-extend? Right now, this seems to be the biggest obstacle for me of using sHM in foam-extend.
Wolfram is offline   Reply With Quote

Old   August 5, 2022, 07:09
Default
  #19
Senior Member
 
M
Join Date: Dec 2017
Posts: 642
Rep Power: 12
AtoHM is on a distinguished road
Too lazy to really look into it (I use it with -ESI versions and it works nicely), but I think the command is named differently in -dev version "surfaceFeatures"? And it seems there are more differences for the -extend version?
.eMesh with foam-extend. surfaceFeatureExtract does not work.
AtoHM 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] SHM: sharp edge resolving problem with explicit feature edges piotr.mecht OpenFOAM Meshing & Mesh Conversion 21 May 9, 2020 14:56
[snappyHexMesh] Extract feature edges in paraview strakakl OpenFOAM Meshing & Mesh Conversion 2 August 29, 2019 13:57
need help about double pipe heat exchanger with chtMultiRegionSimpleFoam wuyangzhen OpenFOAM 10 December 12, 2017 00:19
[surface handling] SurfaceFeatureExtract Foam::error::printStack donQi OpenFOAM Meshing & Mesh Conversion 1 August 15, 2013 00:43
Double Walled Pipe Boundary dahvqaz FLUENT 2 December 5, 2012 10:14


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