CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Native Meshers: blockMesh (
-   -   Generating cellSets with blockMesh (

gschaider October 12, 2005 16:28

File under: Solutions nobody a
File under: Solutions nobody asked for

Something missing from the original blockMesh (in my opinion) is the posibility to generate cell sets.
With some minor modifications to the original blockMesh (and the syntax of the dictionaries) I produced a utility that can do this.

The utility (and further descriptions) can be found at: shWithSets

mattijs October 13, 2005 13:19

Nice one. Is it easy to modify
Nice one. Is it easy to modify so it writes cellZones instead (see polyMesh::addZones()) ?

(since zones are preserved across topology changes)

gschaider October 14, 2005 05:37

To be honest, I wasn't aware o
To be honest, I wasn't aware of the cellZones and I'm looking at the documentation. Is my impression correct, that cellZones are cellSets on steroids? In other words, what is the advantage of using cellSets (if there is any)?

But: Yes. It should be doable (I'll have a go at it next week, if I succeed I'll make a similar modification to the fluentMeshToFoam utility)

hjasak October 14, 2005 05:48

Cell zones will give you a uni
Cell zones will give you a unique decomposition of the mesh or a part of it: each cell will only below to zero or one cell zone. Also, there are facitilies to ask the cell which zone it belongs to (well, a bit different, but that's the idea). This is used a lot in topological mesh changes.

In cell sets, you can have several sets containing the same cell.


gschaider October 19, 2005 11:26

I started to generate CellZone
I started to generate CellZones, but they were never added. When looking at polyMesh.C (method addZones) I found a fz.size() where in my opinion a cz.size() should be. My question: Is this a copy/past-typo or is there an interdependence between cell- and faceZones and this guards against cellZones being added without faceZones?`

The code in question:

// Cell zones
if (fz.size())

// Copy the zone pointers
forAll (cz, cI)

cellZones_.writeOpt() = IOobject::AUTO_WRITE;

mattijs October 19, 2005 11:45

Looks like a typo. There is no
Looks like a typo. There is no special interdependence between cell and face zones at this level.

gschaider October 19, 2005 18:10

I thought so. To work around t
I thought so. To work around this the program creates a dummy faceZone of size 0.

The modified utility can be downloaded from the Wiki. In default mode it writes cellSets. If the switch -writeZones is used it writes cellZones instead (plus the dummy faceZone).

Also on the Wiki is a modified version of fluentMeshToFoam that behaves similar (-writeZones writes face- and cellZones instead of sets). This modification isn't completely tested.

Question: How do I visualize cellZones? The foamToVTK-utility generates data for faceZones, but not for cellZones.

mattijs October 20, 2005 05:09

There is no zone visualization
There is no zone visualization in foamToVTK. You can go from zone to set with faceSet (or setSet) and use source zoneToFace.

(You might want to have your blockMesh always write the cellSets, even when writing cellZones)

gschaider October 20, 2005 06:26

@foamToVTK: at least faceZones
@foamToVTK: at least faceZones get converted (like the patches)

@write both: my impression was, that if you have a region you don't need sets and I wanted to keep the amount of data writte to a minimum (not that it matters much).

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