|
[Sponsors] |
[snappyHexMesh] snappyHexMesh 2D axisymmetric |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 17, 2020, 11:10 |
snappyHexMesh 2D axisymmetric
|
#1 |
Member
Join Date: Apr 2018
Location: UK
Posts: 78
Rep Power: 8 |
Hi,
I have created a 2D axisymmetric wedge and meshed it using blockMesh. The result is a uniform mesh having one cell thickness. The problem is that I have two parallel wall boundaries in my setup (imagine a gap or channel) and I would like to refine the cells in the near-wall regions so I can calculate the wall shear stress. Ideally, I would like to control the height of the first cell next to the wall. I have looked at the snappyHexMesh setup and there is an option to refine the mesh, however this divides each cell into 2^3 = 8 cells. This is a problem for my setup as I need my wedge to be only 1 cell thick. Can anyone confirm whether this can be done in snappyHexMesh and how? If not, what other utilities in OpenFOAM can I use to refine the wall region e.g. refineWallLayer utility? It would be great if someone can point me in the right direction |
|
April 20, 2020, 04:25 |
|
#2 |
Senior Member
Gerhard Holzinger
Join Date: Feb 2012
Location: Austria
Posts: 342
Rep Power: 28 |
There is no way to create a 2D mesh using snappyHexMesh alone, since it cuts cells in all three spatial directions.
However, just proceed as if this was not the case. Since you need a 2D mesh, you can create one again from the front or back patch of your mesh. Thus, follow this rough workflow. * Create your back-ground mesh using blockMesh, in your case this would be the 2D wedge. * Perform all the refinements using snappy; do not care about the mesh becoming 3D. * extrude the front or back patch of the mesh, and discard the old mesh Attached, you find a 2D "cylinder in cross-flow mesh" which was created using blockMesh, snappyHexHesh and extrudeMesh. |
|
April 20, 2020, 16:00 |
|
#3 |
Member
Join Date: Apr 2018
Location: UK
Posts: 78
Rep Power: 8 |
Hi Gerhard,
Thank you for the reply and the suggestion. With your guidance I have a better idea of how this can be done using extrudeMesh now, but I am having a bit of a problem with snappyHexMesh. 1. The user guide only describes setup for an external flow, whereas in my case flow through the channel is internal flow, and I do not need to 'remove' any cells.Do you have any tips with regards to this? |
|
April 21, 2020, 03:11 |
|
#4 |
Senior Member
Niels Nielsen
Join Date: Mar 2009
Location: NJ - Denmark
Posts: 556
Rep Power: 27 |
Hi
For such a "simple" case I would go with Salome instead. There you can mesh it in 2D and control the boundary layers and then revolve the mesh by 1 in thickness.
__________________
Linnemann PS. I do not do personal support, so please post in the forums. |
|
April 21, 2020, 04:23 |
|
#5 |
Senior Member
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13 |
Hi,
If you want to create a simple rectangular mesh with boundary layer refinements, it is easy with blockMesh and you don't need snappyHexMesh. Look 5.3.1.4 Multi-grading of a block here. SnappyHexMesh you will need if you want to add complex obstacles in the channel. Then you cut these obstacles out of the channel mesh. Best, Mikko |
|
April 21, 2020, 06:32 |
|
#6 |
Member
Join Date: Apr 2018
Location: UK
Posts: 78
Rep Power: 8 |
Hi all,
Thanks for the replies. I have made some progress with regards to generating a .stl file of my blockMesh geometry by using the OpenFOAM utility surfaceMeshTriangulate that extracts a surface from the polyMesh. @ linnemann: I have never used Salome before so I feel that the effort in figuring that out would be similar to understanding sHM. @ flowkersma/Mikko: I have tried using multi-grading of a block in the past but I was under the impression that snappyHexMesh would provide more control of the boundary layer refinement (e.g. boundary layer thickness, first cell thickness, expansion ratios etc.), although of course more effort and more expensive than blockMesh. In blockMesh there are only a few controls, but perhaps they are the essentials. Furthermore, I'm following a paper in which 'the initial grid is successively refined 5 times with further refinement near the walls', so that hinted towards sHM. Perhaps I'm misunderstanding this successive refinement? It's straightforward to refine in blockMesh but of course it would not be automated... |
|
April 21, 2020, 07:05 |
|
#7 |
Senior Member
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13 |
With blockMesh you have much more control over the refinements than with snappyHexMesh. You can control the first cell size, the expansion ratio and the boundary layer thickness. Actually, some years ago I made a video to show the (then new) multi-grading feature of blockMesh. SwiftBlock is merely a GUI for blockMesh.
SnappyHexMesh should be used for complex geometries but blockMesh is better for simple geometries because you have much more control of your mesh and less automagic things happening. |
|
April 22, 2020, 07:04 |
|
#8 |
Member
Join Date: Apr 2018
Location: UK
Posts: 78
Rep Power: 8 |
Hi Flowkersma,
Thanks for the quick reply and for sharing the video. I had a second look at multigrading and it seems this is the most convenient option The remaining issue is how to control the various sizes in my mesh. I have found this blockMesh grading calculator on the wiki https://openfoamwiki.net/index.php/S...ng_calculation which is helpful. But I'd like to know how the various parameters are calculated e.g. total expansion ratio, number of cells, cell to cell expansion ratio. The user-guide only seems to provide that the expansion ratio is the size of the last cell to the first cell but not how this varies based on the number of cells... Do you happen to know how these are calculated or a source that explains this? Thanks! |
|
April 22, 2020, 08:54 |
|
#9 |
Senior Member
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13 |
Hi,
BlockMesh uses geometric series for the grading which is commonly used for boundary layer meshes. Expansion ratio can be determined from this simple equation: where is the ratio between the last and the first cell, r is the expansion ratio and N is the number of cells. The length of the BL mesh is given by: |
|
April 24, 2020, 06:05 |
|
#10 |
Member
Join Date: Apr 2018
Location: UK
Posts: 78
Rep Power: 8 |
Hi Flowkersma,
Thanks for the equations. I have compared this to the results from the grading calculator on the Wiki several times and they are slightly off, e.g. number of cells is off by about 3 cells... Could you perhaps direct me to a reference for these equations so I can look into it further? |
|
April 24, 2020, 06:09 |
|
#11 |
Senior Member
Mikko
Join Date: Jul 2014
Location: The Hague, The Netherlands
Posts: 243
Rep Power: 13 |
||
Tags |
refinement, snappyhexmesh, wall |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[CAD formats] Creating waterproof STL using snappyHexMesh or salome | Tobi | OpenFOAM Meshing & Mesh Conversion | 58 | May 13, 2020 07:01 |
[snappyHexMesh] Running snappyHexMesh in parallel - optimizing | peterhess | OpenFOAM Meshing & Mesh Conversion | 2 | January 3, 2018 03:54 |
[snappyHexMesh] Tutorial crashes: snappyHexMesh floating point exception. | jasv | OpenFOAM Meshing & Mesh Conversion | 4 | May 10, 2016 03:55 |
snappyHexMesh axisymmetric multiRegion | Henning86 | OpenFOAM Running, Solving & CFD | 0 | October 23, 2014 13:05 |
[snappyHexMesh] stitchMesh and snappyHexMesh | gdbaldw | OpenFOAM Meshing & Mesh Conversion | 0 | December 23, 2009 03:09 |