|
[Sponsors] |
July 23, 2008, 17:26 |
SnappyHexMesh in 2D case
|
#1 |
New Member
Sylvia Smullin
Join Date: Mar 2009
Posts: 10
Rep Power: 17 |
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 |
|
July 24, 2008, 09:33 |
You cant. The best you could d
|
#2 |
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21 |
You cant. The best you could do is to make a slightly 3D case and use symmetry planes on the spanwise boundaries.
|
|
July 24, 2008, 14:09 |
Thank you for the advice. I tr
|
#3 |
New Member
Sylvia Smullin
Join Date: Mar 2009
Posts: 10
Rep Power: 17 |
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 |
|
July 24, 2008, 14:44 |
If you import a 2D mesh, made
|
#4 |
Senior Member
Francesco Del Citto
Join Date: Mar 2009
Location: Zürich Area, Switzerland
Posts: 237
Rep Power: 18 |
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 |
|
July 25, 2008, 14:51 |
By the way, I also tried symme
|
#5 |
New Member
Sylvia Smullin
Join Date: Mar 2009
Posts: 10
Rep Power: 17 |
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?
|
|
August 25, 2008, 05:59 |
HI Sylvia,
Regarding your e
|
#6 |
Senior Member
mayank gupta
Join Date: Mar 2009
Posts: 110
Rep Power: 17 |
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. |
|
February 11, 2009, 06:36 |
Hello Eugene,
hello FOAMers,
|
#7 |
Member
Andreas Dietz
Join Date: Mar 2009
Location: Munich
Posts: 79
Rep Power: 17 |
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? |
|
February 11, 2009, 06:38 |
one more try for the picture:
|
#8 |
Member
Andreas Dietz
Join Date: Mar 2009
Location: Munich
Posts: 79
Rep Power: 17 |
one more try for the picture:
|
|
February 11, 2009, 06:55 |
Hi Andreas,
No, you cannot
|
#9 |
Senior Member
Eugene de Villiers
Join Date: Mar 2009
Posts: 725
Rep Power: 21 |
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 |
|
July 8, 2009, 18:42 |
|
#10 |
Senior Member
Steve Hansel
Join Date: Jun 2009
Location: Colorado, USA
Posts: 112
Rep Power: 17 |
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 |
|
November 29, 2017, 12:19 |
|
#11 |
Member
Lennart
Join Date: Feb 2016
Posts: 46
Rep Power: 10 |
Apparently, there are a few solutions to use SnappyHexMesh for 2D cases:
http://openfoamwiki.net/index.php/Sn...rate_2D_meshes The simples one seems to be from Alejandro Roger Ull: Dynamic Mesh for a Gear Pump I'll quickly summarize what to do here:
Here's a simple extrudeMeshDict that will do the job: Code:
constructFrom patch; sourceCase "."; sourcePatches (front); exposedPatchName back; flipNormals false; extrudeModel linearNormal; nLayers 1; expansionRatio 1.0; linearNormalCoeffs { thickness 0.01; } mergeFaces false; Last edited by elmo555; November 29, 2017 at 12:59. Reason: Added code |
|
August 15, 2018, 20:41 |
|
#12 |
New Member
Alex
Join Date: Jul 2018
Posts: 2
Rep Power: 0 |
extrudeMesh does
Code:
Writing mesh to "/mnt/c/Users/Avedis/Desktop/Fluids_stuff/flateplate02D/constant/region0" |
|
November 8, 2019, 05:51 |
|
#13 |
Senior Member
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16 |
Maybe it is of interest for someone: in the openfoam.com version 1906 there is a tutorial how to create a 2d mesh from snappy. The procedure is like described above: first create a 3d mesh with snappy and then use the utility extrudeMesh to create a mesh with only one cell in spanwise direction. The tutorial can be found in $FOAM_TUTORIAL/incompressible/overSimpleFoam/aeroFoil
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Pressure instabilities with interDyMFoam for the floatingObject case | nbadano | OpenFOAM Running, Solving & CFD | 15 | October 15, 2021 07:35 |
Reporting a bug in Allrun script on wingMotion case | i.sabahi | OpenFOAM Bugs | 0 | June 10, 2018 10:00 |
Running parallel case after parallel meshing with snappyHexMesh? | Adam Persson | OpenFOAM Running, Solving & CFD | 0 | August 31, 2015 23:04 |
Is Playstation 3 cluster suitable for CFD work | hsieh | OpenFOAM | 9 | August 16, 2015 15:53 |
Simple channel case using cyclicAMI will not converge | cbcoutinho | OpenFOAM Running, Solving & CFD | 3 | August 4, 2015 13:28 |