CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Native Meshers: snappyHexMesh and Others

snappyHexMesh: create boundary layer in a bent tube

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 2, 2011, 08:32
Default snappyHexMesh: create boundary layer in a bent tube
  #1
New Member
 
Brahim Aakti
Join Date: Mar 2009
Location: Lucerne, Switzerland
Posts: 23
Rep Power: 8
brahim is on a distinguished road
Hi all

I'm trying to mesh a "simple" bent tube using sHM. My goal is to resolve the boundary layer a bit... Therefore I tried three different approaches:
  1. standard procedure: define the layers in the dict file and rund sHM at once
  2. changing the bc type of inlet and outlet to empty before adding the layers
  3. adding the layers using the utility refineWallLayer
Unfortunatly, none of these approaches succeeded!
In the attachment you will find the "overview" of the geometry and the results of the three approaches. The third one looks quite nice, but the checkMesh fails because of "incorrect orientation of faces" and "edges not aligned with or perpendicular to non-empty directions".
Does anyone know what I am doing wrong?
Any help and hints are very appreciated!

Thanks - Brahim.
Attached Images
File Type: jpg geom.jpg (9.3 KB, 200 views)
File Type: jpg ver1.jpg (42.2 KB, 245 views)
File Type: jpg ver2.jpg (40.5 KB, 231 views)
File Type: jpg ver3.jpg (30.4 KB, 235 views)
brahim is offline   Reply With Quote

Old   September 2, 2011, 09:51
Default
  #2
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Stockholm, Sweden
Posts: 359
Rep Power: 12
romant is on a distinguished road
Hej,

exactly what you have written under step two is wrong.

The type empty is used for 2D meshes only. You need to set this to wall. Then checkMesh will not give you an error.
__________________
~roman
romant is offline   Reply With Quote

Old   September 5, 2011, 03:23
Default
  #3
New Member
 
Brahim Aakti
Join Date: Mar 2009
Location: Lucerne, Switzerland
Posts: 23
Rep Power: 8
brahim is on a distinguished road
Hi Roman

Thanks for your hint.
BC type wall is the default setting. So, when I "change" the bc type to wall, procedure 1 and procedure 2 are exactly the same. The mesh I get then is the one on the second picture (tube-ver1.jpg). But I would like to have a mesh like the one in the fourth picture (tube-ver3.jpg)
Any other hints are very welcome!

Brahim.
brahim is offline   Reply With Quote

Old   September 5, 2011, 03:33
Default
  #4
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Stockholm, Sweden
Posts: 359
Rep Power: 12
romant is on a distinguished road
Quote:
Originally Posted by brahim View Post
Hi Roman

Thanks for your hint.
BC type wall is the default setting. So, when I "change" the bc type to wall, procedure 1 and procedure 2 are exactly the same. The mesh I get then is the one on the second picture (tube-ver1.jpg). But I would like to have a mesh like the one in the fourth picture (tube-ver3.jpg)
Any other hints are very welcome!

Brahim.
I am not quite sure you can, but you could refine the region with a refinement region (check the options for inside and outside), since it is only the first cell that does not have layers, this could at least give you the layers by refinement.
__________________
~roman
romant is offline   Reply With Quote

Old   September 5, 2011, 04:31
Default
  #5
New Member
 
Brahim Aakti
Join Date: Mar 2009
Location: Lucerne, Switzerland
Posts: 23
Rep Power: 8
brahim is on a distinguished road
Quote:
Originally Posted by romant View Post
I am not quite sure you can, but you could refine the region with a refinement region (check the options for inside and outside), since it is only the first cell that does not have layers, this could at least give you the layers by refinement.
Hi Roman

Could you please give me more information about the refinement region? I don't know, what you mean by "refine the region with a refinement region"? Is it somehow possible to define a box for further refinement?
In the attachment you will find the snappyHexMeshDict I used.

Thanks a lot for your help!!!
Attached Files
File Type: txt snappyHexMeshDict.txt (10.6 KB, 131 views)
brahim is offline   Reply With Quote

Old   September 5, 2011, 04:36
Default
  #6
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Stockholm, Sweden
Posts: 359
Rep Power: 12
romant is on a distinguished road
Hej,

I can see in your snappyHexMeshDict, there is already a refinementBox defined (line 38), which later on (line 129) is used. Since I don't know what the over all bounding box of your geometry is, i can't tell you what the refinement box should include. But the example of one is included in your snappyHexMeshDict.

You can use paraFoam and under display you can show the axis with measurements. From there you can deduce where you want to have a refinement box ( I guess at the inlet) and then chose how much more refined this should become (play with the levels I guess).
__________________
~roman
romant is offline   Reply With Quote

Old   September 5, 2011, 07:50
Default
  #7
New Member
 
Brahim Aakti
Join Date: Mar 2009
Location: Lucerne, Switzerland
Posts: 23
Rep Power: 8
brahim is on a distinguished road
Hi Roman

I defined a refinement box and played around with the levels, but without any success. The mesh still looks like in the second picture...
brahim is offline   Reply With Quote

Old   September 5, 2011, 07:54
Default
  #8
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Stockholm, Sweden
Posts: 359
Rep Power: 12
romant is on a distinguished road
with the refinement box you will not get layers, but rather more cells that could then be on the same level as your layers in the rest of the domain.

depending on your application, you might not need the layers in the first cell (since only that one is actually affected) however, you can also just add an extension to the geometry, so that there are more cells before your real geometry starts, which means that were your real geometry starts, you will definitely have layers.
__________________
~roman
romant is offline   Reply With Quote

Old   September 5, 2011, 08:37
Default
  #9
New Member
 
Brahim Aakti
Join Date: Mar 2009
Location: Lucerne, Switzerland
Posts: 23
Rep Power: 8
brahim is on a distinguished road
For a simple test case, your suggested work around would work. But it is a "work around" and I think that there must be a proper solution... As you can see in this thread: Boundary layers on an inlet/outlet for a pipe it should be possible to create a nice boundary layer. There they changed the bc type from inlet/outlet to empty... But in my case, this procedure did not work!
Does someone has other ideas, how to fix that problem?
brahim is offline   Reply With Quote

Old   September 5, 2011, 08:45
Default
  #10
Senior Member
 
romant's Avatar
 
Roman Thiele
Join Date: Aug 2009
Location: Stockholm, Sweden
Posts: 359
Rep Power: 12
romant is on a distinguished road
Quote:
Originally Posted by brahim View Post
Hi all

I'm trying to mesh a "simple" bent tube using sHM. My goal is to resolve the boundary layer a bit... Therefore I tried three different approaches:
  1. standard procedure: define the layers in the dict file and rund sHM at once
  2. changing the bc type of inlet and outlet to empty before adding the layers
  3. adding the layers using the utility refineWallLayer
Unfortunatly, none of these approaches succeeded!
In the attachment you will find the "overview" of the geometry and the results of the three approaches. The third one looks quite nice, but the checkMesh fails because of "incorrect orientation of faces" and "edges not aligned with or perpendicular to non-empty directions".
Does anyone know what I am doing wrong?
Any help and hints are very appreciated!

Thanks - Brahim.

Sorry, maybe I should have read your post more carefully. Since your third approach works, I suggest to change the type definition back from empty to wall after you have done the meshing. checkMesh should not give any errors and you then end up with the mesh that you want.

You might need to specify the patches/boundaries differently afterwards anyway, because some boundary conditions don't work on a wall.

you will find the new boundary conditions for the ready made mesh under lastTimeDirectory/polyMesh/boundary
__________________
~roman
romant is offline   Reply With Quote

Old   September 5, 2011, 09:43
Default
  #11
New Member
 
Brahim Aakti
Join Date: Mar 2009
Location: Lucerne, Switzerland
Posts: 23
Rep Power: 8
brahim is on a distinguished road
Quote:
Originally Posted by romant View Post
Sorry, maybe I should have read your post more carefully. Since your third approach works, I suggest to change the type definition back from empty to wall after you have done the meshing. checkMesh should not give any errors and you then end up with the mesh that you want.

You might need to specify the patches/boundaries differently afterwards anyway, because some boundary conditions don't work on a wall.

you will find the new boundary conditions for the ready made mesh under lastTimeDirectory/polyMesh/boundary
Hi Roman,

changing the bc type in the boundary file does not change the mesh... I still get the error message
Code:
Error in face pyramids: 104 faces are incorrectly oriented
For the first four time steps, the checkMesh gives "OK" which means: adding the first two layers works fine. But I definitely need more than just 2 layers.
brahim is offline   Reply With Quote

Reply

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SnappyHexMesh - no layer added bejbro OpenFOAM Mesh Utilities 4 October 16, 2014 19:24
Wind turbine simulation Saturn CFX 34 October 16, 2014 05:27
Import problem ARC Open Source Meshers: Gmsh, Netgen, CGNS, ... 0 February 27, 2010 11:56
how to create boundary layer in icem cfd? jayesh CFX 3 November 24, 2005 10:00
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 16:55


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