CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Meshing & Mesh Conversion (https://www.cfd-online.com/Forums/openfoam-meshing/)
-   -   [snappyHexMesh] snappyHexMesh: create boundary layer in a bent tube (https://www.cfd-online.com/Forums/openfoam-meshing/92103-snappyhexmesh-create-boundary-layer-bent-tube.html)

brahim September 2, 2011 08:32

snappyHexMesh: create boundary layer in a bent tube
 
4 Attachment(s)
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.

romant September 2, 2011 09:51

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.

brahim September 5, 2011 03:23

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.

romant September 5, 2011 03:33

Quote:

Originally Posted by brahim (Post 322880)
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.

brahim September 5, 2011 04:31

1 Attachment(s)
Quote:

Originally Posted by romant (Post 322884)
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!!!

romant September 5, 2011 04:36

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).

brahim September 5, 2011 07:50

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... :(

romant September 5, 2011 07:54

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.

brahim September 5, 2011 08:37

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: http://www.cfd-online.com/Forums/ope...tlet-pipe.html 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?

romant September 5, 2011 08:45

Quote:

Originally Posted by brahim (Post 322651)
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

brahim September 5, 2011 09:43

Quote:

Originally Posted by romant (Post 322936)
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.


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