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

[Salome] Hybrid meshes with boundary layers

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   June 21, 2023, 10:11
Default Hybrid meshes with boundary layers
  #1
Member
 
Giorgio
Join Date: Mar 2023
Posts: 46
Rep Power: 3
giorgianig is on a distinguished road
Dear all,

I am modeling a network of pipes, here is a simplified geometry that contains the issue:


I would like to mesh the three straight pipes with structured hexahedra and the Ts with unstructured thetrahedra. I have make a partition with 10 solids (3 Ts and 7 straight pipes) :


I start meshing using submeshes from the central T with Netgen 3D-2D-1D, applying boundary layers on walls, and propogating on pipes with 3D extrusion, everything seems to go smoothly

There is the boundary layer on the walls as wanted

However, when I try to export to OpenFoam (I use salomeToOpenFOAM.py because there are piramids in the mesh), the export fails

and some defaultPatches are generated in the mesh tree:

I think those defaultPatches are generating the export error, and I think they are generated because the mesh is not conformal. I visualized these patches, here is where they are located:

and here is the shape

So those patches are genereated at the interface pipe/T when the T mesh is generated AFTER the pipe mesh. Using a clip also it is clear the mesh is not conformal.

Before the T


After the T:


Does anyone know how to fix it and generate a valid mesh?
Thanks in advance
giorgianig is offline   Reply With Quote

Old   June 21, 2023, 10:34
Default
  #2
Senior Member
 
Join Date: Dec 2021
Posts: 236
Rep Power: 5
Alczem is on a distinguished road
Hey, me again


I tried to mesh several junctions the way you tried, and failed too, it seems impossible to create an extrusion with boundary layers between two junctions.


After seeing the pictures you attached, I think you should give cfMesh a try. It can generate nice boundary layers everywhere, and you can apply a nonuniform stretching to cells in the straight pipes to lower the cell count.
Alczem is offline   Reply With Quote

Old   June 21, 2023, 11:40
Default
  #3
Member
 
Giorgio
Join Date: Mar 2023
Posts: 46
Rep Power: 3
giorgianig is on a distinguished road
Quote:
Originally Posted by Alczem View Post
Hey, me again


I tried to mesh several junctions the way you tried, and failed too, it seems impossible to create an extrusion with boundary layers between two junctions.


After seeing the pictures you attached, I think you should give cfMesh a try. It can generate nice boundary layers everywhere, and you can apply a nonuniform stretching to cells in the straight pipes to lower the cell count.
Hey Alczem, thanks again
This problem is really giving me headhaches!
I'll try out cfMesh right away
Alczem likes this.
giorgianig is offline   Reply With Quote

Old   June 22, 2023, 12:18
Default
  #4
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
You could try to separate your pipe geometry into two distinct entities: the pipe interior and the wall layer. In my experience, it is easier to generate matching meshes, when using tet and extrusion meshing, if you do not bother with boundary layers in the first step.


So, instead of meshing the T-sections using a tet meshing algorithm with a boundary layer hypothesis; you would mesh the interior of the T-section using tets, and then mesh the boundary layer region using an extrusion algorithm.


This increases the complexity of your geometry and the meshing workflow, but in my experience it is not possible to "inform" a boundary layer hypothesis from the outside.



I hope this makes somewhat sense.


Salome is very good at making meshes in a bottom-up approach. Hence, if you separate meshing of the interior and the creation of the boundary layers, you will be able to achieve nice meshes.
Attached Images
File Type: png pipeMeshing.png (12.4 KB, 29 views)
GerhardHolzinger is offline   Reply With Quote

Old   June 23, 2023, 10:03
Default
  #5
Member
 
Giorgio
Join Date: Mar 2023
Posts: 46
Rep Power: 3
giorgianig is on a distinguished road
Quote:
Originally Posted by GerhardHolzinger View Post
You could try to separate your pipe geometry into two distinct entities: the pipe interior and the wall layer. In my experience, it is easier to generate matching meshes, when using tet and extrusion meshing, if you do not bother with boundary layers in the first step.


So, instead of meshing the T-sections using a tet meshing algorithm with a boundary layer hypothesis; you would mesh the interior of the T-section using tets, and then mesh the boundary layer region using an extrusion algorithm.


This increases the complexity of your geometry and the meshing workflow, but in my experience it is not possible to "inform" a boundary layer hypothesis from the outside.



I hope this makes somewhat sense.


Salome is very good at making meshes in a bottom-up approach. Hence, if you separate meshing of the interior and the creation of the boundary layers, you will be able to achieve nice meshes.

Thanks for your reply. It seems unnecessarily complicated. I don't even know how to extract the inner geometry (inside the boundary layer) at the intersection between the pipes.

I mean, this is a trivial geometry, it's unbelievable it cannot be done with a classic procedure...
giorgianig is offline   Reply With Quote

Old   June 23, 2023, 15:57
Default
  #6
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
If you dont mind sharing the Geometry (BREP) I can give it a quick go
__________________
Linnemann

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

Old   June 24, 2023, 11:26
Default
  #7
Member
 
Giorgio
Join Date: Mar 2023
Posts: 46
Rep Power: 3
giorgianig is on a distinguished road
Quote:
Originally Posted by linnemann View Post
If you dont mind sharing the Geometry (BREP) I can give it a quick go
Sure, here it is.

https://www.dropbox.com/scl/fi/una1c...kpspxm472x52fd
giorgianig is offline   Reply With Quote

Old   June 24, 2023, 16:29
Default
  #8
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Hi


Here is the results after about 30min.
The trick is to mesh the Tee first, parallel project the inletFace of the Tee to the internalFace of the Tee.
Project each of the Mesh faces of the Tee to their own face from the geo.
Use the projected mesh to make an extrusion of the face into 3D along a 1D line Mesh.
Make a mesh compund of the Tee and the Vertical Mesh.
Copy that 2 times, copy the internal pipe 1 time and mirror the inlet mesh around the center.
Make a Compund mesh of all these meshes and that will automatically merge internal nodes/faces if they lie on top of each other.


I have provided a link to the Study and the resulting UNV file for you to look at.
checkMesh shows nice values.


https://drive.google.com/file/d/1Ddo...ew?usp=sharing


Code:
Checking geometry... 
    Overall domain bounding box (-300 -10 -10) (300 10 300) 
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1) 
    Mesh has 3 solution (non-empty) directions (1 1 1) 
    Boundary openness (-6.36013e-17 1.32379e-17 -3.5847e-17) OK. 
    Max cell openness = 3.46929e-16 OK. 
    Max aspect ratio = 42.7402 OK. 
    Minimum face area = 0.19949. Maximum face area = 31.8451.  Face area magnitudes OK. 
    Min volume = 0.141434. Max volume = 29.4749.  Total volume = 460177.  Cell volumes OK. 
    Mesh non-orthogonality Max: 60.3271 average: 8.61917 
    Non-orthogonality check OK. 
    Face pyramids OK. 
    Max skewness = 2.06016 OK. 
    Coupled point location match (average 0) OK.

Attached Images
File Type: png Mesh.png (59.5 KB, 21 views)
File Type: png Mesh2.png (117.3 KB, 32 views)
Alczem likes this.
__________________
Linnemann

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

Old   June 26, 2023, 08:22
Default
  #9
Member
 
Giorgio
Join Date: Mar 2023
Posts: 46
Rep Power: 3
giorgianig is on a distinguished road
Quote:
Originally Posted by linnemann View Post
Hi


Here is the results after about 30min.
The trick is to mesh the Tee first, parallel project the inletFace of the Tee to the internalFace of the Tee.
Project each of the Mesh faces of the Tee to their own face from the geo.
Use the projected mesh to make an extrusion of the face into 3D along a 1D line Mesh.
Make a mesh compund of the Tee and the Vertical Mesh.
Copy that 2 times, copy the internal pipe 1 time and mirror the inlet mesh around the center.
Make a Compund mesh of all these meshes and that will automatically merge internal nodes/faces if they lie on top of each other.


I have provided a link to the Study and the resulting UNV file for you to look at.
checkMesh shows nice values.


https://drive.google.com/file/d/1Ddo...ew?usp=sharing


Code:
Checking geometry... 
    Overall domain bounding box (-300 -10 -10) (300 10 300) 
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1) 
    Mesh has 3 solution (non-empty) directions (1 1 1) 
    Boundary openness (-6.36013e-17 1.32379e-17 -3.5847e-17) OK. 
    Max cell openness = 3.46929e-16 OK. 
    Max aspect ratio = 42.7402 OK. 
    Minimum face area = 0.19949. Maximum face area = 31.8451.  Face area magnitudes OK. 
    Min volume = 0.141434. Max volume = 29.4749.  Total volume = 460177.  Cell volumes OK. 
    Mesh non-orthogonality Max: 60.3271 average: 8.61917 
    Non-orthogonality check OK. 
    Face pyramids OK. 
    Max skewness = 2.06016 OK. 
    Coupled point location match (average 0) OK.


Dear linnemann,

Thank you for the explication and the link Indeed, your solution is very interesting, but it does not apply to my real case. In fact, this is a simplified geometry, and in your procedure you exploited the symmetry of it. In my real case I can't do that.



In my case, I cannot avoid to generate the mesh of a T imposing the mesh on one (or more) of the external faces connected to the pipes. In your procedure, you meshed one T (without constraints), and copied that mesh. This cannot be done in a real case where every T is different from the other.

However, seeing what you did, I think I understood some key ingredients I was missing in Salome. Maybe I can mesh a T imposing the mesh on the faces using the 1D projections as you did in this simplified case?
giorgianig is offline   Reply With Quote

Old   June 26, 2023, 10:01
Default
  #10
Member
 
Giorgio
Join Date: Mar 2023
Posts: 46
Rep Power: 3
giorgianig is on a distinguished road
Quote:
Originally Posted by linnemann View Post
Hi


Here is the results after about 30min.
The trick is to mesh the Tee first, parallel project the inletFace of the Tee to the internalFace of the Tee.
Project each of the Mesh faces of the Tee to their own face from the geo.
Use the projected mesh to make an extrusion of the face into 3D along a 1D line Mesh.
Make a mesh compund of the Tee and the Vertical Mesh.
Copy that 2 times, copy the internal pipe 1 time and mirror the inlet mesh around the center.
Make a Compund mesh of all these meshes and that will automatically merge internal nodes/faces if they lie on top of each other.


I have provided a link to the Study and the resulting UNV file for you to look at.
checkMesh shows nice values.


https://drive.google.com/file/d/1Ddo...ew?usp=sharing


Code:
Checking geometry... 
    Overall domain bounding box (-300 -10 -10) (300 10 300) 
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1) 
    Mesh has 3 solution (non-empty) directions (1 1 1) 
    Boundary openness (-6.36013e-17 1.32379e-17 -3.5847e-17) OK. 
    Max cell openness = 3.46929e-16 OK. 
    Max aspect ratio = 42.7402 OK. 
    Minimum face area = 0.19949. Maximum face area = 31.8451.  Face area magnitudes OK. 
    Min volume = 0.141434. Max volume = 29.4749.  Total volume = 460177.  Cell volumes OK. 
    Mesh non-orthogonality Max: 60.3271 average: 8.61917 
    Non-orthogonality check OK. 
    Face pyramids OK. 
    Max skewness = 2.06016 OK. 
    Coupled point location match (average 0) OK.

There is something I don't understand in your procedure: when I display the mesh called InletMesh it shows a 3D mesh, but when I try to edit I can only see a 2D algorithm, as you meshed only the face on the base:



How is it done exactly this 3d extrusion?

Thanks in advance
Attached Images
File Type: jpg Capture d’écran 2023-06-26 151253.jpg (121.8 KB, 10 views)
giorgianig is offline   Reply With Quote

Old   June 26, 2023, 15:00
Default
  #11
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Sure, attached are the steps.


Regarding your real case.
You can do the same with "Extrusion along path" and the projecting the faces where they are in-line.
The face meshes need to match up in order for the merging of nodes on the compound mesh.
So its doable, just takes a bit of time.
Attached Images
File Type: png 010076.png (131.3 KB, 20 views)
File Type: png 010077.png (24.8 KB, 14 views)
giovanni.medici likes this.
__________________
Linnemann

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

Old   June 27, 2023, 09:32
Default
  #12
Member
 
Giorgio
Join Date: Mar 2023
Posts: 46
Rep Power: 3
giorgianig is on a distinguished road
Quote:
Originally Posted by linnemann View Post
Sure, attached are the steps.


Regarding your real case.
You can do the same with "Extrusion along path" and the projecting the faces where they are in-line.
The face meshes need to match up in order for the merging of nodes on the compound mesh.
So its doable, just takes a bit of time.
Well, I am not sure. Every time I try, it fails. The problem resides on the fact that the Netgen 3D algorithms seems incompatible with the imposition of a face mesh. I am able to propagate the mesh from an unstructured to a structured (3d extrusion) one, but not the other way around.
giorgianig is offline   Reply With Quote

Old   June 27, 2023, 09:52
Default
  #13
Member
 
Giorgio
Join Date: Mar 2023
Posts: 46
Rep Power: 3
giorgianig is on a distinguished road
Quote:
Originally Posted by linnemann View Post
Sure, attached are the steps.


Regarding your real case.
You can do the same with "Extrusion along path" and the projecting the faces where they are in-line.
The face meshes need to match up in order for the merging of nodes on the compound mesh.
So its doable, just takes a bit of time.


See this example: I am extruding a mesh in a pipe, I get this



Now I need to mesh the next connected part (this cone):



I projet the 2D mesh from the pipe to the upper face of the cone



this goes well:



Now I want to mesh the cone with an unstructured mesh, keeping the mesh of the face on the top. Here I am not sure what algorithm to use.. If I use Netgen 3D-2D-1D, the final mesh looks like this



See what I mean? The mesh of the top face has changed! Why is it doing that is beyond my comprehension.

If I just mesh using Net 3D-2D-1D WITHOUT projecting the face mesh before, the mesh on the top face looks kind of OK, but the nodes are not matching (which is understandable since the two meshes are completely independent)
giorgianig is offline   Reply With Quote

Old   June 27, 2023, 15:18
Default
  #14
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Hi


You are correct, doing it this way for you case breaks the face mesh when it is projected when it has boundary layers. Without BL it works fine.


There is a way to do it using the "Extrusion 3D" meshing strategy.


Here is a link to the case and the checkMesh output.


https://drive.google.com/file/d/1De3...ew?usp=sharing


Code:
Checking geometry... 
    Overall domain bounding box (0 -49.9013 -49.6057) (700 49.9013 50) 
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1) 
    Mesh has 3 solution (non-empty) directions (1 1 1) 
    Boundary openness (7.93909e-17 3.36127e-18 -1.20437e-17) OK. 
    Max cell openness = 7.47279e-16 OK. 
    Max aspect ratio = 46.4566 OK. 
    Minimum face area = 1.33659. Maximum face area = 316.204.  Face area magnitudes OK. 
    Min volume = 8.42164. Max volume = 973.656.  Total volume = 3.36768e+06.  Cell volumes OK. 
    Mesh non-orthogonality Max: 19.7951 average: 7.36319 
    Non-orthogonality check OK. 
    Face pyramids OK. 
    Max skewness = 0.315532 OK. 
    Coupled point location match (average 0) OK. 

Mesh OK.
Attached Images
File Type: jpg 010078.jpg (43.9 KB, 14 views)
__________________
Linnemann

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

Old   June 28, 2023, 04:44
Default
  #15
Member
 
Giorgio
Join Date: Mar 2023
Posts: 46
Rep Power: 3
giorgianig is on a distinguished road
Quote:
Originally Posted by linnemann View Post
Hi


You are correct, doing it this way for you case breaks the face mesh when it is projected when it has boundary layers. Without BL it works fine.


There is a way to do it using the "Extrusion 3D" meshing strategy.


Here is a link to the case and the checkMesh output.


https://drive.google.com/file/d/1De3...ew?usp=sharing


Code:
Checking geometry... 
    Overall domain bounding box (0 -49.9013 -49.6057) (700 49.9013 50) 
    Mesh has 3 geometric (non-empty/wedge) directions (1 1 1) 
    Mesh has 3 solution (non-empty) directions (1 1 1) 
    Boundary openness (7.93909e-17 3.36127e-18 -1.20437e-17) OK. 
    Max cell openness = 7.47279e-16 OK. 
    Max aspect ratio = 46.4566 OK. 
    Minimum face area = 1.33659. Maximum face area = 316.204.  Face area magnitudes OK. 
    Min volume = 8.42164. Max volume = 973.656.  Total volume = 3.36768e+06.  Cell volumes OK. 
    Mesh non-orthogonality Max: 19.7951 average: 7.36319 
    Non-orthogonality check OK. 
    Face pyramids OK. 
    Max skewness = 0.315532 OK. 
    Coupled point location match (average 0) OK. 

Mesh OK.
Yes of course, but that was just an example. What I need is an unstructured mesh. What do you do if you have a T instead of a cone?
giorgianig is offline   Reply With Quote

Old   June 28, 2023, 05:31
Default
  #16
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
Quote:
Originally Posted by linnemann View Post

You are correct, doing it this way for you case breaks the face mesh when it is projected when it has boundary layers. Without BL it works fine.



This observed behaviour is exactly why I suggested to split-off the geometric region which is to contain the boundary layer. So, that you can create your hybrid mesh of tets and extrusions without the hassle of boundary layers. And then in a second step, extrude your boundary layers radially from the surface of the interior region.


This is a lot of extra work; but Salome is really good at creating meshes in a bottom-up approach as long as the individual steps are simple.
GerhardHolzinger is offline   Reply With Quote

Old   June 28, 2023, 14:34
Default
  #17
Senior Member
 
linnemann's Avatar
 
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27
linnemann will become famous soon enough
Quote:
Originally Posted by giorgianig View Post
Yes of course, but that was just an example. What I need is an unstructured mesh. What do you do if you have a T instead of a cone?
I see your problem now. If I make a Tee after the cone, the project face trick does not work anymore as the BL will cause issues in that instance.

So the best approach IMO is either to make the connection between the parts with AMI and live with the small interpolation errors introduced.
It can be done in Salome, but it will be tedious and error prone.

Or, you do as previously suggested and use cfMesh and live with the higher cellcount. This would be my prefered method.
You will loose some time in solving, but you will gain it back manyfold by not having to deal with the mesh.

Do you want to share the complex shape in post #9? I can give it a quick cfMesh go.
__________________
Linnemann

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

Old   June 29, 2023, 04:47
Default
  #18
Member
 
Giorgio
Join Date: Mar 2023
Posts: 46
Rep Power: 3
giorgianig is on a distinguished road
Quote:
Originally Posted by linnemann View Post
I see your problem now. If I make a Tee after the cone, the project face trick does not work anymore as the BL will cause issues in that instance.

So the best approach IMO is either to make the connection between the parts with AMI and live with the small interpolation errors introduced.
It can be done in Salome, but it will be tedious and error prone.

Or, you do as previously suggested and use cfMesh and live with the higher cellcount. This would be my prefered method.
You will loose some time in solving, but you will gain it back manyfold by not having to deal with the mesh.

Do you want to share the complex shape in post #9? I can give it a quick cfMesh go.
Thank you Niels. Yes, here is the geometry:

https://www.dropbox.com/scl/fi/b7zpl...i9k426iwzt83gf

I have already tried cfMesh. Without anisotropic refinement, it produces a good mesh with about 500K elements. I believe this case could be done with a good resolution with less then 200K. Unfortunately, I think there is a bug in the anisotropic refinement in cfmesh. I posted the issue on a simplified case here:

Anisotropic refinement on box not working

and here

Anisotropic refinement fails

If you could take a look to it and tell me what you think it would be great.

Your help is really appreciated.
Giorgio
giorgianig is offline   Reply With Quote

Old   June 29, 2023, 05:00
Default
  #19
Member
 
Giorgio
Join Date: Mar 2023
Posts: 46
Rep Power: 3
giorgianig is on a distinguished road
Quote:
Originally Posted by GerhardHolzinger View Post
This observed behaviour is exactly why I suggested to split-off the geometric region which is to contain the boundary layer. So, that you can create your hybrid mesh of tets and extrusions without the hassle of boundary layers. And then in a second step, extrude your boundary layers radially from the surface of the interior region.


This is a lot of extra work; but Salome is really good at creating meshes in a bottom-up approach as long as the individual steps are simple.
Dear Gerhard, your approach would certainly work. However, it is not useful to me. What I am doing here is to investigate the possibility of opening a CFD activity in my company using opensource codes. I am trying to find out procedures to approach real cases. These procedures must obviously be competitive with proprietary softwares. I think the approach you propose it's too involved to be competitive.

All in all this turns out to be a big limitation of Salome. The geometry is simple, the strategy is clear, and yet you can't do it. That's a pity since the software is appealing in so many other aspects.
giorgianig is offline   Reply With Quote

Old   June 29, 2023, 10:02
Default
  #20
Senior Member
 
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28
GerhardHolzinger will become famous soon enoughGerhardHolzinger will become famous soon enough
Dear Giorgio,


Even if you need to use a different meshing software for meshing the geometry in question, take this episode as a vital learning experience. If you understand what Salome can easily do, and what not; you may benefit in the future.


Depending on your workflows, you may help your meshing efforts in the geometry creation stage prior to beginning meshing. Sometimes it is easier to accomodate the needs of the meshing software when creating the geometry, rather than working around issues within the meshing software.


The beauty of applying open source software is that you can use apply all of them. With expensive commerical software, you would likely select the most fitting one, and that would be it. With open source, you can simply use them all.
GerhardHolzinger is offline   Reply With Quote

Reply

Tags
boundary layer, hybrid mesh, submeshes


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
Table bounds warnings at: END OF TIME STEP CFXer CFX 4 July 17, 2020 00:44
CFD analaysis of Pelton turbine amodpanthee CFX 31 April 19, 2018 19:02
Domain Imbalance HMR CFX 5 October 10, 2016 06:57
Error finding variable "THERMX" sunilpatil CFX 8 April 26, 2013 08:00
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 16:55


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