Difference between revisions of "BlockMesh"
(replaced "all versions" with the actual versions...) |
(→Graphical User Interfaces for visualizing and designing {{tt|blockMeshDict}}: section done) |
||
Line 57: | Line 57: | ||
;{{tt|paraFoam -block}}: Introduced in OpenFOAM 2.0.0, this argument for the {{tt|paraFoam}} script requires that the respective OpenFOAM plugin is built for ParaView. This means that ParaView has to be built from source code or to use the Deb/RPM packages provided by the OpenFOAM Foundation. | ;{{tt|paraFoam -block}}: Introduced in OpenFOAM 2.0.0, this argument for the {{tt|paraFoam}} script requires that the respective OpenFOAM plugin is built for ParaView. This means that ParaView has to be built from source code or to use the Deb/RPM packages provided by the OpenFOAM Foundation. | ||
+ | |||
+ | ;{{tt|blockMesh -blockTopology}}: Already explained in the section [[#Using blockMesh to export blockMeshDict to .obj|Using {{tt|blockMesh}} to export {{tt|blockMeshDict}} to {{tt|.obj}}]] | ||
+ | |||
+ | ;{{tt|pyFoamDisplayBlockMesh.py}}: This Python script provides a way to visually inspect the current {{tt|blockMeshDict}} settings in 3D. It is part of [[Contrib/PyFoam|PyFoam]], which relies on VTK and Qt for the graphical interface. For more information, see section [[Contrib/PyFoam#pyFoamDisplayBlockMesh.py|pyFoamDisplayBlockMesh.py]] in the page [[Contrib/PyFoam]]. | ||
+ | |||
+ | ;SwiftBlock: This is also a Python script, but it's a powerful add-on for Blender, which provides an interactive way to design the {{tt|blockMeshDict}} directly in 3D. For more information, see the respective wiki page: [[Contrib/SwiftBlock]] | ||
+ | |||
+ | ;HexBlocker: This is a dedicated application for visually editing in 3D the {{tt|blockMeshDict}} file. For more information, see this forum page: [http://www.cfd-online.com/Forums/openfoam-meshing/114773-hexblocker-gui-blockmeshdict-alpha-release.html HexBlocker a GUI for blockMeshDict, alpha release] | ||
[[Category:Mesh generation utilities]] | [[Category:Mesh generation utilities]] |
Revision as of 14:14, 19 April 2014
Contents
1 Introduction
blockMesh is one of the most basic mesh generators in OpenFOAM. It relies on a single dictionary file blockMeshDict, usually placed inside the folder constant/polyMesh. The latest official documentation on how to use blockMesh can be found on the OpenFOAM User Guide and online at the OpenFOAM Foundation website at this page: 5.3 blockMesh
Feel free to contribute to this page!
1.1 Synopsis
blockMesh [OPTIONS]
1.2 Description
As the name implies, blockMesh helps the user build the mesh with blocks. It relies on a single dictionary file blockMeshDict, usually located at constant/polyMesh/blockMeshDict. Inside that dictionary file should be defined:
- all of the reference vertices of mesh;
- all of the building blocks for the mesh, each block composed of:
- 8 vertices (repeat vertices, for collapsing edges);
- grading definition;
- cell count over each major axis;
- optionally, one can assign special edge definitions for specific edges on blocks, such as arcs and splines;
- assign faces of blocks to patch names;
- and finally, be able to define special face merging, but associating/merging patches.
The following options can be used with blockMesh:
-case DIR
- Execute the command on the case directory DIR. If not provided, use the current directory.
-dict FILE
- Read dictionary from specified location.
-blockTopology
- Write block edges and centres as .obj files, for visual inspection elsewhere.
-noFunctionObjects
- Skip the execution of the functionObjects
-region NAME
- Generate the mesh only for a specific region (e.g. for multi-region simulations).
-help
- Display the help and exit
2 Tips
On this chapter are listed links and direct tips on using snappyHexMesh.
2.1 Using blockMesh to export blockMeshDict to .obj
Before there were any nice graphical user interfaces for visually designing and inspecting the blockMeshDict files, blockMesh can interpret the dictionary file and export it to an .obj file, which can be opened by any compatible 3D software, such as ParaView, JavaView and so on. There steps are as follows:
- Use the -blockTopology argument to dump out a blockTopology.obj file:
blockMesh -blockTopology
- The vertex numbering in this file is consistent with that of the vertices in the blockMeshDict file.
- The file blockTopology.obj can be visualized in the following 3D software:
- Visualize directly with JavaView;
- Visualize directly in ParaView or convert the file to VTK if you prefer:
objToVTK blockTopology.obj blockTopology.vtk
- Import in Blender.
- (fell free to add more...)
2.2 Graphical User Interfaces for visualizing and designing blockMeshDict
- paraFoam -block
- Introduced in OpenFOAM 2.0.0, this argument for the paraFoam script requires that the respective OpenFOAM plugin is built for ParaView. This means that ParaView has to be built from source code or to use the Deb/RPM packages provided by the OpenFOAM Foundation.
- blockMesh -blockTopology
- Already explained in the section Using blockMesh to export blockMeshDict to .obj
- pyFoamDisplayBlockMesh.py
- This Python script provides a way to visually inspect the current blockMeshDict settings in 3D. It is part of PyFoam, which relies on VTK and Qt for the graphical interface. For more information, see section pyFoamDisplayBlockMesh.py in the page Contrib/PyFoam.
- SwiftBlock
- This is also a Python script, but it's a powerful add-on for Blender, which provides an interactive way to design the blockMeshDict directly in 3D. For more information, see the respective wiki page: Contrib/SwiftBlock
- HexBlocker
- This is a dedicated application for visually editing in 3D the blockMeshDict file. For more information, see this forum page: HexBlocker a GUI for blockMeshDict, alpha release
- OpenFOAM Version 1.0
- OpenFOAM Version 1.1
- OpenFOAM Version 1.2
- OpenFOAM Version 1.3
- OpenFOAM Version 1.4
- OpenFOAM Version 1.5
- OpenFOAM Version 1.6
- OpenFOAM Version 1.7
- OpenFOAM Version 2.0
- OpenFOAM Version 2.1
- OpenFOAM Version 2.2
- OpenFOAM Version 2.3
- OpenFOAM-Extend Version 1.4-dev
- OpenFOAM-Extend Version 1.5-dev
- OpenFOAM-Extend Version 1.6-ext
- FOAM-Extend Version 3.0
- Mesh generation utilities