Contents
1 Introduction
In a nutshell, snappyHexMesh is a mesh generator that takes an already existing mesh (usually created with blockMesh) and chisels it into the mesh you want. But for this, it requires:
- A very well defined dictionary, namely system/snappyHexMeshDict.
- Good geometrical definitions, such as:
- STL/OBJ files with well defined surfaces;
- eMesh feature edge files, that define feature edges that have describe sharp corners.
Note: feature edges only available in:
Configuring both the dictionary file and providing good geometries can be a very arduous task. Therefore, at the moment of this writing (11:06, 18 August 2012 (CEST)), this wiki page will try to point you in the right direction, without describing each and every detail related to using snappyHexMesh. Feel free to contribute to this page!
2 Tutorials and Guides
Here are listed links to tutorials and guides on using snappyHexMesh:
- Official OpenFOAM User Guide, chapter 5.4 - Mesh generation with the snappyHexMesh utility
- A Comprehensive Tour of snappyHexMesh - 7th OpenFOAM Workshop (25 June 2012):
- Original source:
EugenedeVilliers-TrainingSlides.tgz(off-line due to this: openfoamworkshop.org web site under attack) - Local copy here at openfoamwiki.net: Final-AndrewJacksonSlidesOFW7.pdf
- Original source:
- Tutorials by Jens H. at personal blog:
- Tutorials by Tobias H. at personal homepage:
3 Tips
On this chapter are listed links and direct tips on using snappyHexMesh.
3.1 Generate 2D meshes
Instructions/examples on how to generate 2D meshes using snappyHexMesh can be found in at least two places:
- Here at the wiki: Main_ContribExamples/2DsHM
- In the tutorial incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh
3.2 Multi-region meshes
There are a few instructions/examples on how to generate multi-region meshes with snappyHexMesh:
- See the tutorial heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater.
- Instructions on how to remove an external unwanted region: Background Mesh in snappy with multi domain (CHT) post #3
- Note: this happens whenever the base mesh doesn't coincide with the outer limits of the target surface geometry. The tutorial heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater is such an example where the outside of the original STL files coincides with the base mesh.
3.3 Running in parallel
Currently there are several official tutorials on how to use snappyHexMesh in parallel:
- incompressible/windSimpleFoam/turbineSiting - Valid versions:
- incompressible/simpleFoam/turbineSiting - Valid versions:
- incompressible/pisoFoam/les/motorBike/motorBike - Valid versions:
Other tutorials:
- Modified motorBike tutorial to be used as a benchmark case for running in parallel: Runtimes of OpenFOAM vs blueCFD - Valid versions:
3.4 GUI (Graphical User Interfaces)
Currently there are several interactive ways (using GUI) of generating meshes with snappyHexMesh. Here will only be listed the ones that are open-source:
- Discretizer
- Check the Screencasts page for more information.
- SwiftSnap
- A very useful plug-in for Blender for configuring snappyHexMeshDict. There is SwiftBlock for blockMeshDict as well!
- HelyxOS
- A GUI for using OpenFOAM. See the video tutorials:
3.5 Another way of projection of a mesh on an STL surface
Adding boundary layers with snappyHexMesh can sometimes be very stressing, specially when it sometimes stops the layers in the wrong places. Trying to improve this feature was one of several works made in the MSc/PhD course in CFD with OpenSource software, 2011 at Chalmers, namely:
Other important links: