CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Meshing & Mesh Conversion (
-   -   Problem during creation of a new mesh generator (

klaus July 13, 2005 15:44

Hello OpenFoam friends, i a
Hello OpenFoam friends,

i am up to include pre/post-processor modules for foam into my CalculiX-pre/post-processor ( But i encounter problems in situations when two cell-faces match each other, who differ only in the point were the node sequence starts (face 1 starts at point x but face 2 starts at y, for example 0,1,2,3 and 2,1,0,3). Usually just one face who points to the element of higher index is kept. But in this situation (i have a scetch but how can i ship it?) the solver does not work.

I will try to solve the situation with "cyclic faces". One face for each element, but i do not know if it will work.

Has anybody an idea?


mattijs July 14, 2005 05:57

Sketch: I usually dump .obj fi
Sketch: I usually dump .obj files. Are very simple 3D geometry files.
v x y z
f 1 2 3

Download javaview ( or use objToVTK and use Paraview. You can attach the .obj files.

You cannot have two faces inbetween the same two cells. You will have to discard one of them.

Or like you do using cyclics is a solution but a very inefficient one.

Can you do simple geometries already? E.g. two hexes?

klaus July 14, 2005 13:12

Hello Mattijs, thanks for t
Hello Mattijs,

thanks for the reply. Yes i can already create meshes if they are "topologically" simple. That means if the meshed blocks have the same amount of elements at opposide sides. Lets say 10 elements at the bottom and 10 at top. But very often it is usefull to have a mesh-transition from lets say 10 at the bottom to 6 at top. In this case some "top"-faces of elements will join "side"-faces of others. In this case openFoam gives no result.

I had a try with blockMesh were each element was a separate block but also in this case the mesh-transition failed.

By the way the tool which produces the mesh is proven for FEM applications and i use it every day. I just want to add the interface for foam. I can already read the results and create "simple" meshes. But without mesh transition it is hard to realize complicated situations. I know that most CFD-solvers require the "ordered" block-structure but i had the impression that openFoam can deal with arbitrary meshes.


i could send a scetch if you like.

mattijs July 14, 2005 13:23

yes, please send sketch. -
yes, please send sketch.

- can you output a format for which there is converter? e.g. fluentMeshToFoam?

- Foam has no problems with unstructured meshes. And has no concept of 'blocks' so you will have to do the merging to convert a multi block mesh into an unstructured mesh.

- Please attach blockMeshDict that gave problems.

klaus July 14, 2005 16:02

Hi Mattijs, how can i attac
Hi Mattijs,

how can i attach something in the "Message" window of our discussion board? And no, i have no other format available in my tool which foam understands. Concerning CFD i only support duns in the moment.

I wanted to write a propper polyMesh first but because of the problems i wrote a blockMesh file.

But actually i would like to generate a propper polyMesh file still. How can i deal with situations were two matching elements require a different starting-point for the internal face? (The very question)

I care about a smaller blockMeshDict a bit later and will ship it (something has to be done before)


hjasak July 14, 2005 16:08

How can i deal with situations

How can i deal with situations were two matching elements require a different starting-point for the internal face? (The very question)
When Foam does the check on whether two faces are identical, it will search for the appropriate starting point, so the faces (1 2 3 4) and (3 4 1 2) will actually be identical.

However, if you're writing a mesh directly in the FOAM format, this issue does not arise: cells are defined in terms of faces so you never need to ask two faces for equality.

I have written a pretty detailed section on how to make and order elements in your own mesh generators to be used with FOAM - have a search through the manual.

Have fun,


mattijs July 14, 2005 16:18

To attach: \attach{...}
To attach:


Have a look in Documentation->Formatting on the left.

klaus July 15, 2005 18:36

Hello Mattijs and Hrvoje, n
Hello Mattijs and Hrvoje,

now it runs. The hint to:

- set the number of non-orthogonality correctors to 2 (in system/fvSolution)
- halve the time-step.

did the work. Now i can generate bodies with transient element density. Thanks a lot!

My program cgx will be available in about 2 months with the foam handling capabilities. I will write if it had happened.

So long,

You wrote:
"The faces have to be ordered such that on a given cell the faces to
neighbouring higher numbered cells are in increasing order if the
neighbouring cells are in increasing order."

does the utility renumberMesh solve this also?

mattijs July 18, 2005 05:25

Yes renumberMesh does this as
Yes renumberMesh does this as well.

All times are GMT -4. The time now is 06:27.