CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... (
-   -   Extension of fluentMeshToFoam internal cells and faces (

gschaider March 24, 2005 09:23

For some of my simulations I n
For some of my simulations I need the information about the interior BCs that are assigned by Gambit (to calculate surface integrals on them during postprocessing).

I adapted the fluentMeshToFoam-convertor to write out this information: it writes out faceSets, but doesn't modify the grid in any other way.

I also did a similar thing for cellSets (to assign different material properties for different domains).

My question:
- Are these changes of general interest?
- If yes: where do I send them to, so that they can be inserted in the regular OpenFOAM-distribution (writing of the sets is optional)

The other question is the following: if I understood it correctly face and cellSets are just a collection of face/cell-numbers. Some of the mesh-utilities cause the cells to be reordered. Would I have to rewrite these too?

hjasak March 24, 2005 09:29

Heya, 1) Yes, having things

1) Yes, having things zoned up in Gambit may come in handy

2) send it to OpenCFD and it will end up in the next release

3) It is the mesh that enforces the ordering and zones are passive. You may wish to orient the face zones to have front and back (otherwise there may be problems with orientation) but apart from that there's nothing to worry about.

Thanks for the effort, much appreciated,


mattijs March 24, 2005 09:34

Ad 2) send it to me and I'll h
Ad 2) send it to me and I'll have a look at it. Address is m.janssens at

A small testcase would be nice as well - we don't have Gamibt over here.


ali March 26, 2005 12:17

From what I tried, foam does n
From what I tried, foam does not recognize the boundaries at all. So, the 'boundary' file has nothing in it although 'cells', 'points', and 'faces' are all created correctly using fluentMeshToFoam.

So, what should I do to set boundaries? In other codes, one can select the desired faces (using GUI) and set it as a special boundary condition.

However, in foam, the only thing I can think of is than I should state the name and type of boundary and state 'nFaces' and 'startFace', right?

If this is the way to do it, I don't know how to determine the face numbers.

hjasak March 26, 2005 12:24

Heya, You've messed somethi

You've messed something up: fluentMeshToFoam does indeed read boundary data - have a look at:
OpenFOAM-1.1/applications/utilities/mesh/conversion/fluentMeshToFoam/fluentMeshT oFoam.L
line 1088 onwards: patch types, names and faces are read from the fluent file and re-assembled on line 1229.

Also, you can see the mapping for various fluent-to-foam patch types in lines 1134-1206.

The nice thing is that now you've got full source you can find out and tell me what has actually happened! :-)

Looking forward to any bug fixes,


gschaider March 30, 2005 08:38

The gambitMeshToFoam converter
The gambitMeshToFoam converter has been extended to write faceSets and cellSets for interior boundaries and regions that were defined in Gambit.

Mattijs has inserted it into the next release (>1.1)

Should anyone need this feature before that release is released, contact me and I'll send it to you.

helmut April 27, 2005 10:47

I'd like to take up your offer
I'd like to take up your offer of getting this feature now, before the next release. Thanks very much for making it available.


gschaider April 28, 2005 04:16

I have attached the tar-file:
I have attached the tar-file: fluentMeshToFoamWithInternals.tar.gz

helmut August 17, 2005 16:00

Hi, Is there also an extend

Is there also an extended mesh object with read and access functions for the face and cell sets? Once again, I'd be interested ...


gschaider August 22, 2005 07:56

With read&access you mean some
With read&access you mean something like


to set the value of filter for all the cells in the cellSet to filterID? I don't think so. (At least I didn't find anything like that).

The way I'm doing this is:

cellSet filterSet(mesh,filterName,IOobject::MUST_READ,IOob ject::NO_WRITE);

for(cellSet::iterator cell=filterSet.begin();cell!=filterSet.end();cell+ +)

helmut August 29, 2005 09:45

Thanks, this looks very helpfu
Thanks, this looks very helpful.

gschaider September 5, 2005 14:02

Just wanted to say, that the u
Just wanted to say, that the utility posted to this thread on the 28th of April is obsolete, because it's functionality has been incorporated into the 1.2 release.

ghanshyam September 6, 2005 00:52

That is a great news. Thanks f
That is a great news. Thanks for the info. How do we see those internal faces? We tried but could not see those internal faces. Where might be the mistake from our side?


gschaider September 6, 2005 08:23

With "see" you mean "display i
With "see" you mean "display in paraFoam"?

If yes: Unfortunately paraFoam can't display these sets.

What you should see is in the polyMesh-dictionary an additional dictionary named "sets". In this dictionary are files that are named like the cellSets and faceSets.

To display them in a postprocessor you can convert the Geometry with foamToVTK (there is an option for faceSets and cellSets) and display the geometry with the normal paraview.

For examples how to access the resulting sets from a program see my response in this thread or this utility on the wiki sFlow
(there may be other more elegant way)

hani September 20, 2005 07:05

I'm having troubles converting
I'm having troubles converting a Fluent mesh to OpenFoam using FluentMeshToFoam. I get the following messages:
Found unknown block
Embedded blocks in comment or unknown
Found end of section in unknown

The mesh has internal patches, which might cause the problem.

The mesh is available at .zip
if someone would be kind enough to help me have a look at it.

I am aiming at using the internal patches for post-processing. I simply want to output the velocity and pressure fields on those patches. Maybe someone can tell me how to do that.


gschaider September 20, 2005 07:50

Hello Hakan. I noticed, tha
Hello Hakan.

I noticed, that your mesh has a "Binary Section". The meshes I've had experience with were only pure ASCII-texts (to be honest I even don't know how to produce that binary output).

My guess (and the funny characters in the output back that up) is that the converter can't handle meshes that are output as binary (looking at the source-code I'd be surprised if it did)

Try writing the mesh as pure ASCII(text) and convert that.

hani September 20, 2005 08:28

Thanks for your quick reply!
Thanks for your quick reply!

I converted the mesh to ASCII using ICEM (find it at h)
(Note that I did not generate the grid myself, I got it in the binary format.)

Then I got the following error message, which you might be able to help me interpret:

--> FOAM FATAL ERROR : Cannot find match for face 3.
Model: hex model face: 4(3 7 6 2) Mesh faces:
4(891900 891902 891901 891899)
4(891902 891900 532724 532726)
4(891902 532726 532725 891901)
4(532723 532725 532726 532724)
4(532725 891901 891899 532723)
4(891899 891900 532724 532723)
Matched points: 8(532723 532724 891900 891899 891902 532726 -1 891901)

From function create3DCellShape(const label cellIndex, const labelList& faceLabels, const labelListList& faces, const labelList& owner, const labelList& neighbour, const label fluentCellModelID)
in file create3DCellShape.C at line 281.

FOAM aborting


mattijs September 20, 2005 10:25

Hi Håkan, does it convert i
Hi Håkan,

does it convert if you remove the internal patches? Does the mesh have any 'split' hexes? Did you have any luck with 'normal' cellShapes?

gschaider September 20, 2005 11:31

I tried it by editing all the
I tried it by editing all the internal patches (wall_right, wall_left, wall_sides, wall_cyl, cs4b and symmetry) from type ''wall'' to type ''internal''. This doesn't help.

If I import the mesh to Gambit and export it again the exported mesh can be converted (if the interior patches are set correctly).
Don't know whether these meshes are identical, but fluentMeshToFoam reports the same number of points/cells/faces during importing (for the second mesh it reports them in the order points/faces/cells - don't know if this has any importance)

@Mattijs: removed the interior patches as proposed. This doesn't help either.

mattijs September 20, 2005 13:28

> reports them in the order po
> reports them in the order points/faces/cells
No importance, just inconsistency.

You convert successfully from Gambit with gambitToFoam? Or does Gambit again write Fluent format?

From the original message it seems it has not matched all of the points of a hex.

Anything special about the mesh? Does it work if you put all outside faces in one patch (and have no internal patches and/or gaps in the mesh)?

All times are GMT -4. The time now is 14:39.