CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Meshing Format & General Technical (
-   -   How to use the socalled bcellShapeb tools (

Luckyluke (Luckyluke) January 5, 2005 23:03

I can not find a step-by-step
I can not find a step-by-step instruction for the using of 'cellShape' in the file 'UserGuide.pdf'. I want to use non-hex
mesh in my simulation(triangular for 2D or tet for 3D). How should I write my dictionary file and which utility may be called?

Please help me. I want to become familar with the great OpenFOAM!

Hrvoje Jasak (Hjasak) January 6, 2005 02:10

Not quite sure what you are t
Not quite sure what you are trying to do: the code does not care about the cell shape at run-time, so the only problem you may have is getting the mesh into foam.

If none of the converters will do the job for you, you may need to write one yourself and here is some guidance:
- all meshes is foam (well, almost) are 3-D. If you want a "2-D" mesh of triagnles, you should create a flat 1-layer cell mesh of triangular prisms.
- the mesh is defined by 4 files:
points: (x y z) point locations
faces: for each face, an order list of point labels. There is an immportant ordering rule for this (read the manual)
cells: for each cell, a list of faces
boundary: list of boundary patches (see ordering rules and manual for explanation

There is also a nice hepler constructor in polyMesh that allows you to create a mesh using cell shapes for cases like yours instead of calculating the faces and their ordering yourselves. You will need the following info:
points: as above
cells: list of cell shapes in terms of vertices, something like hex(55 23 84 77 11 14 16 71)
boundary: list of boundary faces for each patch.

I am pretty certain that cell shape definitions are in the manual (at least they were there a while back) - if there is a problem please let me know. Incidentally, I have written a detailed instruction on writing mesh converters a couple of years ago, so this should be in the manual as welll...

Please study the code in existing converters and read the relevant comments in polyMesh.H and createPolyMesh.C

Good luck,


All times are GMT -4. The time now is 02:52.