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

[snappyHexMesh] foamyHexMesh boundary layers

Register Blogs Community New Posts Updated Threads Search

Like Tree3Likes
  • 2 Post By zordiack
  • 1 Post By zordiack

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 3, 2014, 04:04
Default foamyHexMesh boundary layers
  #1
Member
 
Pekka Pasanen
Join Date: Feb 2012
Location: Finland
Posts: 87
Rep Power: 14
zordiack is on a distinguished road
Hello everyone, I'm sure some of you have also started to play around with the new meshing utility foamyHexMesh. Since the documentation of this new tool is somewhat let's say vague, I thought I'd share what I have found out about it so far.

The first thing I noticed when running the tutorials that the meshes created with foamyHexMesh were not as nice as the meshes in the announcement pictures, because there were "holes" in the surface. I played around with the settings and noticed that I can get rid of the holes is I tune the following parameter in the file system/collapseDict:

Code:
collapseFacesCoeffs
{
    // The initial face length factor
    initialFaceLengthFactor                 0.2 // changed from the default 0.5;
Changing the value from 0.5 -> 0.2 for example for blob tutorial seems to fix the "holes" problem. There's also tons of other parameters to tune and I tested most of them but only changing this one helped (most likely pure luck, understanding of the inner workings is still missing).

Anyway, I'm currently trying to create a viscous boundary layer for my test case, which is a simple cylinder representing a small piece of pipe. So far I've managed to create boundary layer which is one cell size thick, by setting the parameter surfaceCellSizeCoeff in the file system/foamyHexMeshDict:

Code:
  shapeControlFunctions
    {
        blob
        {
            type                    searchableSurfaceControl;
            priority                1;
            mode                    bothSides;

            surfaceCellSizeFunction uniformValue;
            uniformValueCoeffs
            {
                surfaceCellSizeCoeff 0.5; //first surface layer cell size (relative)

            cellSizeFunction        surfaceOffsetLinearDistance;
            surfaceOffsetLinearDistanceCoeffs
                {
                distanceCellSizeCoeff 10; //ratio between surface and far field?
                surfaceOffsetCoeff   5; //distance from the surface?
                linearDistanceCoeff 5; //distance from the surface?
                }
        }
This however refines the surface cells in all directions, which is not feasible for viscous boundary layers. I'm trying to create refinement only in the surface normal direction, has anyone managed to do that yet? Also, it seems that surfaceCellSizeCoeff affect the density of whole mesh and not just the surface layer, pictures with settings 1 and 0.5 are attached.

Also, where is the utility foamyHexMeshBackGroundMesh? There seems to be source code and documentation for it, but it doesn't get compiled. I'm using the latest git 2.3.x. I'm guessing this utility is needed in order to run foamyHexMesh in parallel, so it's kind of important.

I'm inviting people to share their knowledge of this new promising meshing tool, because there is no documentation for majority of the parameters. I must say the method of foamyHexMesh mesh creation seems ingenious and I'm really looking forward to using it in real cases The mesh it creates for the test case seems nice apart from the missing boundary layers.

PS: Does anyone know the meaning of these in the file system/foamyHexMeshDict:

Code:
backgroundMeshDecomposition
{
    minLevels           0;
    sampleResolution    4;
    spanScale           20;
    maxCellWeightCoeff  20;
}
Attached Images
File Type: jpg foamyhexmesh1.jpg (60.8 KB, 829 views)
File Type: jpg foamyhexmesh2.jpg (64.1 KB, 802 views)
cutter and Romarius like this.

Last edited by zordiack; March 3, 2014 at 04:53. Reason: added another picture
zordiack is offline   Reply With Quote

Old   March 3, 2014, 05:09
Default
  #2
Member
 
Pekka Pasanen
Join Date: Feb 2012
Location: Finland
Posts: 87
Rep Power: 14
zordiack is on a distinguished road
And just now I found these.. I'll post a solution to create boundary layers if I manage to find one.

EDIT, no additional information about the use of surface cellSizeFunctions :/

https://github.com/OpenFOAM/OpenFOAM...amyHexMeshDict

https://github.com/OpenFOAM/OpenFOAM...s/collapseDict
zordiack is offline   Reply With Quote

Old   March 6, 2014, 08:57
Default
  #3
New Member
 
Zeliang Xu
Join Date: Apr 2013
Posts: 5
Rep Power: 13
douglasx is on a distinguished road
Hi Pekka,

Thank you for sharing your experience with foamyHexMesh. I am also new to this new meshing utility and I have been playing around with it. The thing that bothers me the most right now is how does it generate background mesh around geometry? I see there is blockMeshDict file defined, but I do not see where it is displayed, cause the result from meshing is only the geometry surface.

Currently I am trying to do something similar to mixerVessel case to build a bounding box to my ship hull, and I am not sure if this is the right thing to do.
Do you have any idea how this can be done? Any idea will be appreciated.

Thank you very much!

Zeliang
douglasx is offline   Reply With Quote

Old   March 7, 2014, 04:00
Default
  #4
New Member
 
Quentin Coispeau
Join Date: Nov 2013
Posts: 17
Rep Power: 12
Quentin is on a distinguished road
Hi douglasx,

foamyHexMesh only mesh closed geometry

"The main limitation of foamyHexMesh, particularly compared to snappyHexMesh, is that it is a requirement that surface geometry is perfectly closed" on the 2.3.0 release, s you need to construc your block outside. You will find some piece of information here on how to do it with blender.
Quentin is offline   Reply With Quote

Old   March 7, 2014, 08:41
Default
  #5
Member
 
Pekka Pasanen
Join Date: Feb 2012
Location: Finland
Posts: 87
Rep Power: 14
zordiack is on a distinguished road
Well, the I think the background mesh should be constructed using the application foamyHexMeshBackgroundMesh, which is not ready yet. I've filed a bug report about it here. It's intentionally commented out in the makefile, so I'm guessing it's not quite ready yet. The tutorials have background meshes already in place and that's why they are working in parallel.

Regarding the first post I made, I did some test runs with the meshes and I have to say they didn't quite work. There are some bad polygons in the mesh and if I leave the "holes" they generate errors in the flow field so they really are holes in the mesh and not just errors in ParaView, even pushing initialFaceLengthFactor to 0.1 didn't solve all the problems.

As for the boundary layer problem, I haven't figured out a way to generate refinement only in the wall normal direction with foamyHexMesh. Refinement in all directions is possible though. Boundary layers could be generated with refineWallLayer, but I'm sceptical about it's abilities with difficult geometries.

I guess we all have to wait for better documentation and improvements, I still think that foamyHexMesh is going to kick ass in the future
zordiack is offline   Reply With Quote

Old   March 7, 2014, 09:07
Default
  #6
New Member
 
Zeliang Xu
Join Date: Apr 2013
Posts: 5
Rep Power: 13
douglasx is on a distinguished road
Hi Quentin,

Thank you very much for your kind reply. Yes now I am using a box geometry to bound my ship hull and the meshing part works, but the mesh quality is not very high. I guess I will need to look more into the mesh quality controls to try to improve the quality.

Zeliang
douglasx is offline   Reply With Quote

Old   March 7, 2014, 09:18
Default
  #7
New Member
 
Zeliang Xu
Join Date: Apr 2013
Posts: 5
Rep Power: 13
douglasx is on a distinguished road
Hi Pekka,

Thank you for the reply. I was also wondering what openfoam is doing with foamyHexMeshBackgroundMesh because it is not even visible in paraview and changing blockMeshDict does not seem to change anything.

I also believe foamyHexMesh is really promising yet we will have to wait for it to be completed.

Zeliang
douglasx is offline   Reply With Quote

Old   March 7, 2014, 09:28
Default
  #8
New Member
 
Quentin Coispeau
Join Date: Nov 2013
Posts: 17
Rep Power: 12
Quentin is on a distinguished road
I'm also working on ship hull and begin to get reasonnably good result with snappyHexMesh, except for the boundary layer part in which i'm still working (but makig progress). The main problem i encounter is that for water the first cell height should be very thin even for y+ = 30+ (10^-5 to 10^-4 m) and Snappy don't like that. I just gave a small look at foamyHexMesh and I find nothing which would be a boundary layer subdict.

the utility refineWallBoundary give me a very good visually result but create strongly non-ortho cells ( up to 179 ) from an original mesh with maxOrtho = 65, and I'm trying to smooth the mesh created with refineWallBoundary (presently by running again the snapping part of snappyHexMesh) but maybe there is an other utility made to "clean" a mesh" ?
Quentin is offline   Reply With Quote

Old   March 11, 2014, 16:20
Default
  #9
Member
 
laurentL
Join Date: Oct 2011
Location: new caledonia
Posts: 73
Rep Power: 14
laurent98 is on a distinguished road
Hi Foamers,
could it be that Boundary layers are not need anymore???

@quentin, i found that BL with SHM are not add were the surface .stl are not smooth enough , for example, if very small long triangles (quality close to 0),make big angle >120deg . the application surfaceFeatureExtract detect them...
so i try to use surfaceClean but it crash often (triangle equilateral quality=1)
i would like to make stl file like the DTCHull in multiphase/LTSInterFoam tutorial.
hope this help LL
laurent98 is offline   Reply With Quote

Old   September 23, 2014, 14:30
Default
  #10
Member
 
Pekka Pasanen
Join Date: Feb 2012
Location: Finland
Posts: 87
Rep Power: 14
zordiack is on a distinguished road
If someone comes across this thread, this is the most complete reference to the options I've found this far:

https://github.com/OpenFOAM/OpenFOAM...amyHexMeshDict
zordiack is offline   Reply With Quote

Old   March 3, 2016, 06:09
Default Mesh a .stl file using foamyHexMesh
  #11
New Member
 
Subhasree
Join Date: Mar 2014
Location: IIT Bombay, India
Posts: 25
Rep Power: 12
Subhasree is on a distinguished road
Hi everyone!,

I am a beginner in openFOAM, and have used snappyHexMesh to create hex dominant mesh around a .stl file. Although the mesh looks better now after a lot of modifications but I am unable to improve its skewed cells.

I came across foamyHexMesh and would like to use it for meshing my current model...Just to check out if it can solve my previous problem. I started foamyHexMesh by flange and blob tutorial and then mixer vessel. But the surfaceFeactureExtract is not working properly for all the .stl file in mixer vessel. Am getting this error:

Feature line extraction is only valid on closed manifold surfaces.


--> FOAM FATAL ERROR:
Cannnot read "/home/subhasree/OpenFOAM/OpenFOAM-2.4.0/tutorials/mesh/foamyHexMesh/mixerVessel/constant/triSurface/spargerInlet.stl"

From function triSurface::read(const fileName&, const word&, const bool)
in file triSurface/triSurface.C at line 372.

FOAM exiting


The flange and blob tutorial problems are also having snappyHexMesh file..Can anyone tell me why is that required?

what is the requirement of blockMeshDict file in flange and blob tutorial, since it is doing surface mesh.

I could not find any documentation for this mesh utility, thus it would be really helpful if somebody can suggest how may I proceed...


Thanks!!!
Subhasree is offline   Reply With Quote

Old   January 15, 2018, 09:45
Default foamyHexMesh refinement
  #12
Member
 
Join Date: Oct 2017
Posts: 52
Rep Power: 8
gouravjee is on a distinguished road
Hello Foamers
I am working on Darcy-Brinkman Model for porous media.I have prepared my mesh using foamyHexMesh utility.
I am having trouble in refining the mesh mesh size for my case file.
can anyone suggest ways of doing it.

thanks in Advance....
gouravjee is offline   Reply With Quote

Old   August 7, 2019, 16:42
Default
  #13
New Member
 
Gavin Ridley
Join Date: Jan 2019
Location: Tennessee, USA
Posts: 25
Rep Power: 7
gridley2 is on a distinguished road
Hi, I'm wondering if anyone on here has had luck with getting foamyHexMesh to work over these four years? The lack of documentation is irritating, also, it seems to segfault quite easily if input parameters aren't set up how it likes, even in OpenFOAM-7.


It seems like a fantastic tool if it were easier to understand!
gridley2 is offline   Reply With Quote

Old   August 20, 2019, 02:18
Default
  #14
Member
 
Pekka Pasanen
Join Date: Feb 2012
Location: Finland
Posts: 87
Rep Power: 14
zordiack is on a distinguished road
Quote:
Originally Posted by gridley2 View Post
Hi, I'm wondering if anyone on here has had luck with getting foamyHexMesh to work over these four years? The lack of documentation is irritating, also, it seems to segfault quite easily if input parameters aren't set up how it likes, even in OpenFOAM-7.


It seems like a fantastic tool if it were easier to understand!

I've been checking on the commits occasionally, but the lack of wall normal boundary layer refinement has still put me off using it seriously.

As far as I understand, it's still not possible to create boundary layers with foamyHexMesh (at least not in the traditional sence). Yes, one can refine the mesh in all directions at the wall, but this is not practical in real life meshes.

And the lack of documentation is kind of bad, although source code is much better commented now than it used to be so there are quite many hints in there. I'm also kind of waiting and hoping that there would be more development into foamyHexMesh, but we'll have to wait and see since OpenFOAM financing seems to be hard as it is :/


BR, Pekka P.
gridley2 likes this.
zordiack is offline   Reply With Quote

Old   January 2, 2020, 11:55
Default
  #15
New Member
 
Per Jørgensen
Join Date: Mar 2012
Posts: 20
Rep Power: 14
perjorgen is on a distinguished road
Quote:
Originally Posted by zordiack View Post
I've been checking on the commits occasionally, but the lack of wall normal boundary layer refinement has still put me off using it seriously.

As far as I understand, it's still not possible to create boundary layers with foamyHexMesh (at least not in the traditional sence). Yes, one can refine the mesh in all directions at the wall, but this is not practical in real life meshes.

And the lack of documentation is kind of bad, although source code is much better commented now than it used to be so there are quite many hints in there. I'm also kind of waiting and hoping that there would be more development into foamyHexMesh, but we'll have to wait and see since OpenFOAM financing seems to be hard as it is :/


BR, Pekka P.

You can add the boundary layers with snappyHexMesh using

castellatedMesh false;
snap false;
addLayers true;



mesh.jpg



I am struggling with the same problem you had with holes in the mesh. I traced the problem to the collapseEdges -collapseFaces step. How did you solve it? I am in Denmark - could it be a regional setting?


Best regards,

Per
perjorgen 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
3D Windturbine simulation in SU2 k.vimalakanthan SU2 15 October 12, 2023 05:53
Multiphase flow - incorrect velocity on inlet Mike_Tom CFX 6 September 29, 2016 01:27
Error - Solar absorber - Solar Thermal Radiation MichaelK CFX 12 September 1, 2016 05:15
RPM in Wind Turbine Pankaj CFX 9 November 23, 2009 04:05
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 15:55


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