CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Mesh Utilities

SnappyHexMesh in 2D case

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

Reply
 
LinkBack Thread Tools Display Modes
Old   July 23, 2008, 16:26
Default I am trying to look at an airf
  #1
sjs
New Member
 
Sylvia Smullin
Join Date: Mar 2009
Posts: 10
Rep Power: 8
sjs is on a distinguished road
I am trying to look at an airfoil shape in 2D. Geometry is like the airfoil in a big box, with wind along the chord direction. I set up "empty" patches on the walls perpendicular to the span of the airfoil. This works fine. However, then when I try to use snappyHexMesh to mesh nicely around the foil shape, it doesn't work. With a blockdict specifying only 1 cell in that span direction, snappyHexMesh won't work (it does work if I don't have empty patches on those boundary). If I make 2 cells in the span direction, snappyHexMesh works, however when I try to run icoFoam, I get this error:

This mesh contains patches of type empty but is not 1D or 2D by virtue of the fact that the number of faces of this empty patch is not divisible by the number of cells.

Suggestion for how I can use this excellent snappyHexMesh tool for a 2D case?

Thank you.
Sylvia
sjs is offline   Reply With Quote

Old   July 24, 2008, 08:33
Default You cant. The best you could d
  #2
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
You cant. The best you could do is to make a slightly 3D case and use symmetry planes on the spanwise boundaries.
eugene is offline   Reply With Quote

Old   July 24, 2008, 13:09
Default Thank you for the advice. I tr
  #3
sjs
New Member
 
Sylvia Smullin
Join Date: Mar 2009
Posts: 10
Rep Power: 8
sjs is on a distinguished road
Thank you for the advice. I tried symmetry planes with 1 cell in the span direction. snappyHexMesh failed. So I use 2 cells in the span direction, with symmetry plane boundary conditions. From a physical point of view, how accurate is this for a 2D case? For accuracy, do I just need to use an outside mesher so I can make it more properly 2D (ie empty side planes and only 1 cell in the span direction)? It looks like the naca airfoil example in soniceTurbFoam works fine with empty planes on either side and only one cell in the spanwise direction.

Thanks.
Sylvia
sjs is offline   Reply With Quote

Old   July 24, 2008, 13:44
Default If you import a 2D mesh, made
  #4
Senior Member
 
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 214
Rep Power: 9
fra76 is on a distinguished road
If you import a 2D mesh, made for example with gambit, the converter extrudes it to a 3D mesh with 1 cell in the extrusion direction, with empty planes as boundary conditions. OpenFOAM does not have a 2D solver, but that is the right way of performing 2D simulations.

Francesco
fra76 is offline   Reply With Quote

Old   July 25, 2008, 13:51
Default By the way, I also tried symme
  #5
sjs
New Member
 
Sylvia Smullin
Join Date: Mar 2009
Posts: 10
Rep Power: 8
sjs is on a distinguished road
By the way, I also tried symmetry planes, both on rhoSonicFoam and on icoFoam. Both systems diverged within 0.02 s of integration time. I don't know if this has anything to do with the mesh, but it seemed to work ok with slip boundary conditions (which is not at all what I want) or without the snappyHexMesh (which also is not what I want). Has anyone else tried to use snappyHexMesh extending to side planes with b.c. that are anyting besides slip?
sjs is offline   Reply With Quote

Old   August 25, 2008, 04:59
Default HI Sylvia, Regarding your e
  #6
Senior Member
 
mayank gupta
Join Date: Mar 2009
Posts: 110
Rep Power: 8
mgz1985 is on a distinguished road
HI Sylvia,

Regarding your error with running icoFoam, it is due to the fact of having cells in the 3D. I had the same problem.

To solve 2-D cases in OpenFOAM u need to specify only 1 cell in z-direction of type empty. if snappyHexMesh is adding 2 cells in the z-direction, u r bound to get the error

If u define more than 1 cell in the z-direction u get the above error. I have not worked with snappyHexMesh but i know with my experience of meshing an airfoil, the reason for the above error.
mgz1985 is offline   Reply With Quote

Old   February 11, 2009, 06:36
Default Hello Eugene, hello FOAMers,
  #7
Member
 
lord_kossity's Avatar
 
Andreas Dietz
Join Date: Mar 2009
Location: Munich
Posts: 79
Rep Power: 8
lord_kossity is on a distinguished road
Hello Eugene,
hello FOAMers,

I've got one additional question applying snappyHexMesh for a 2D-case.

For an analysis of lift and drag, i tried to create a 2D-mesh of a car.

I did the following to cheat a bit, since I already knew that snappyHex is not planned to work in 2D.

1) create a blockMesh with one cell in spanwise direction

2) change the level of refinementSurfaces to (0 0) in order to avoid additional cells in spanwise direction

3) snapping runs with standard parameters

4) change surfaceLayers to 2 in addLayersControls

snappyHexMesh runs fine. But it does not insert layers.

For copyright reasons, I can only show a part of the frontend




In order that anybody can run the case, I additionaly attach the blockMeshDict and snappyHexMeshDict for a 2D Cube (one cell in y-direction).





Please let me know, if you are able to insert layers.

Andreas

btw: anybody knows how to get rid of the diagonals in paraview?
lord_kossity is offline   Reply With Quote

Old   February 11, 2009, 06:38
Default one more try for the picture:
  #8
Member
 
lord_kossity's Avatar
 
Andreas Dietz
Join Date: Mar 2009
Location: Munich
Posts: 79
Rep Power: 8
lord_kossity is on a distinguished road
one more try for the picture:


lord_kossity is offline   Reply With Quote

Old   February 11, 2009, 06:55
Default Hi Andreas, No, you cannot
  #9
Senior Member
 
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 12
eugene is on a distinguished road
Hi Andreas,

No, you cannot insert layers in pseudo-2D. At present, layers cannot just stop. They have to gradually go from no layer cells to many layer cells in a step-wise fashion. Thus 1 layer would never be possible.

Eugene
eugene is offline   Reply With Quote

Old   July 8, 2009, 17:42
Default
  #10
Senior Member
 
Steve Hansel
Join Date: Jun 2009
Location: Colorado, USA
Posts: 112
Rep Power: 8
hansel is on a distinguished road
It would be nice to have a utility that would take a 2d (one layer thick) slice out of a 3d mesh. I was hoping flattenMesh would do it, but that's for something else.

For taking a z slice at height Z:

1) Find all faces and edges that cross Z
2) preserve those faces and edges, and discard the others.
3) Run flattenMesh on the results.

hmmm I guess you also have to close the top and bottom. Maybe it's not so simple.

Steve
hansel 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 and Snapping thomasr OpenFOAM Mesh Utilities 5 March 15, 2012 12:07
SnappyHexMesh erik023 OpenFOAM Mesh Utilities 19 October 17, 2010 10:09
Parallel case setup boundry conditions snappyhexmesh oskar OpenFOAM Pre-Processing 5 September 11, 2009 01:12
SnappyHexMesh mp340 OpenFOAM Meshing & Mesh Conversion 1 November 13, 2008 14:30
Cloning a case or creating a new case for 16 processes mellanoxuser OpenFOAM Running, Solving & CFD 0 February 8, 2008 17:52


All times are GMT -4. The time now is 18:46.