CFD Online Logo CFD Online URL
Home > Forums > OpenFOAM Mesh Utilities

SnappyHexMesh and location in background mesh

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

LinkBack Thread Tools Display Modes
Old   September 25, 2008, 10:40
Default Dear all, I have been trying
Posts: n/a
Dear all,
I have been trying to construct a blockmeshdict that specifies a box with airinlet and waterinlet wateroutlet and airoutlet. this acctually consists of two blocks, one on top of the other:

(-50.11 -20.23 -30) //0
(-50.11 20.23 -30) //1
(-50.11 -20.23 0) //2
(-50.11 20.23 0)//3
(-50.11 -20.23 30)//4
(-50.11 20.23 30)//5

(50.12 -20.23 -30)//6
(50.12 20.23 -30)//7
(50.12 -20.23 0)//8
(50.12 20.23 0)//9
(50.12 -20.23 30)//10
(50.12 20.23 30)//11
hex (0 1 3 2 6 7 9 8)
(50 20 30)
simpleGrading (0.5 0.2 1)

hex (2 3 5 4 8 9 11 10)
(50 20 30)
simpleGrading (0.5 5 1)
and i have patches like this:

wall walls
(0 1 7 6)
(0 6 8 2)
(2 8 10 4)
(1 7 9 3)
(3 9 11 5)
(4 5 11 10)
patch win
(0 1 3 2)
patch ain
(2 3 5 4)
patch wout
(6 7 9 8)
patch aout
(8 9 11 10)

now this all looks good and i get the impression that i only end up with one region (i.e. that the patch between is erased and not there).

when i then run snappyHexMesh specifying the position by:

locationInMesh (0.12 10.1 -5.252);

what happens is that it all runs well and i get:

Found point (0.12 10.1 -5.252) in cell 15683 in global region 0 out of 2 regions.
Keeping all cells in region 0 containing point (0.12 10.1 -5.252)

and when i look at the object (a boat) it is located at the bottom of the top block. what to do?
i would like to place it somewhere in between the two blocks and let water flow by it.
what am i doing wrong?
i think it might just be a matter of a stupid mistake but i can not find it now.

thank you
Erik Ekedahl
  Reply With Quote

Old   September 25, 2008, 13:32
Default Hello Erik, good to see, th
New Member
Axel Mohr
Join Date: Mar 2009
Location: Kiel, Schleswig-Holstein, Germany
Posts: 24
Rep Power: 7
alexm is on a distinguished road
Hello Erik,

good to see, that I am not alone ;-)

My blockMeshDict is similar to yours, 12 vertices and 2 blocks. snappyHexMesh identifies these mesh as only one region, without any internal patch.

Is it possible, that your locationInMesh lies inside of the object? If I choose a value like this, two regions are found by snappyHexMesh - but the resulting mesh only contains of a mesh of the object.

The location of an object according to the block is controlled by its coordinates - or by the coordinates of the block. So the best way is to choose the coordinates of the block in hexMeshDict so, that it is placed around the block(s).

Another thing: I have found that snappyHexMesh seems to prefer aspect ratios of about 1. So I don't use any gradings - for me this works much better, especially with complex geometries.

Hope this would help.

Greetings, Axel
alexm is offline   Reply With Quote

Old   September 26, 2008, 03:00
Default i know, it is good! http://www
Posts: n/a
i know, it is good!
allright, anyways, thank you! i was not using an aspect ratio of 1 now will try that in a moment.

i did on the other hand just change a bit in the blockmeshdict so that the bottom box is a bit larger than the top one (i.e. instead of -30 0 and 30 in z-axis i used -30 5 30) and now i got something that looks like a better setup.

i think in fact that no matter what the stl-object snaps to origo in the z-direction, which for me makes no sense but using the setup i just mentioned it might work anyway.

did you get you case running?

i'm pondering on what BC to use for pressure on the waterinlet/outlet.

hope thing goes well and thank you for your advice!

  Reply With Quote

Old   March 22, 2009, 10:16
Default Gmsh+snappyHexMesh
Senior Member
Join Date: Mar 2009
Location: Nanjing/Shanghai/Torino, Nanjing/Shanghai/Piemente, China/Italy
Posts: 164
Rep Power: 7
zhoubinwx is on a distinguished road
Send a message via ICQ to zhoubinwx Send a message via MSN to zhoubinwx Send a message via Skype™ to zhoubinwx
Dear all,

It's great to see your discussions.

I have tested the motorBike case, and I have some idea about it. Now I'd like to implement my simple case: uniform around a cylinder(2D case).

1. I use blockMesh to generate coarse mesh for a domain(4000*2000*1 micrometer), i.e. x: -2000~2000, y:0~2000, z:0~1; Uniform mesh along x-, y- direction. X-direction has 200 cells, y- has 100 cells, and z- has 1 cell; (This means the coarse mesh size is 20 micrometer)

2. I use Gmsh to build the STL format. Now I have 2 questions:
a. Since we need the surface information about the cylinder(object), should I output STL file after I generate 2D mesh or 3D mesh?
b. After Gmsh generates STL information, I could see that there are only "solid Created by Gmsh" and "endsolid Created by Gmsh", Can I define different patch names for the cylinder(front, back, cylinder_surface, and cylinder_axis)?

3. As we could see from:, in snappyHexMesh utility, there must be at least one intersection of a cell edge with the STL surface, i.e. a mesh of one cell will not work. Now my cylinder radius is 1 micrometer, so this means in order to use snappyHexMesh, I must use a background cell which is smaller than 1 micrometer?

Thank you for your attention.

zhoubinwx is offline   Reply With Quote


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
Inside and outside mesh with snappyhexmesh nzy102 OpenFOAM Native Meshers: snappyHexMesh and Others 17 May 8, 2013 17:04
Inside and outside mesh with snappyhexmesh nzy102 OpenFOAM Mesh Utilities 0 August 31, 2008 23:50
Inside and outside mesh with snappyhexmesh nzy102 OpenFOAM Mesh Utilities 0 August 31, 2008 23:44
SnappyHexMesh not generate mesh first time mavimo OpenFOAM Mesh Utilities 4 August 26, 2008 07:08
Dense mesh at certain location Jonathan FLUENT 1 November 24, 2003 12:18

All times are GMT -4. The time now is 13:34.