CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM (
-   -   How to create faceSet/cellSet with wall faces exceeding a user-defined y+ value (

florian_krause May 27, 2011 05:17

How to create faceSet/cellSet with wall faces exceeding a user-defined y+ value
Dear all,
my issue is the following. I have a quite complex 3D geometry and I am using simpleFoam and the kOmegaSST model. I am calculating the y+ value of the wall adjacent cells with my plusPostRANS utility, see

Suppose I have a grid with: y+_max = 2, y+_min = 0.002 and y+_avg = 0.5. In order to locate the region of all the wall faces (or wall adjacent cell) with y+>1.0 I would like to store either the wall faces or the wall adjacent cells in a faceSet or a cellSet respectively.

The corresponding code snippet of the plusPostRANS utility is

forAll(patches, patchi)
const fvPatch& currPatch = patches[patchi];

if (typeid(currPatch) == typeid(wallFvPatch))
yPlusTemp.boundaryField()[patchi] =

const scalarField& YpTemp = yPlusTemp.boundaryField()[patchi];

So my question is the following: Within the loop, how can I store the wall faces or wall adjacent cells, which have y+>1, into a faceSet or cellSet respectively. With this I would be able to nicely locate them in Paraview using the include sets option. As you can see, I have the y+ values stored in a scalarField YpTemp on which I perform for instance the min and max operations.

As always, any help is appreciated!

Best regards,

Bernhard May 27, 2011 07:04

Did you consider the option to write the value of y+ to a volScalarField. I think that is much more easy to post-process in paraview.

florian_krause May 27, 2011 08:26

Hello Bernhard,
indeed, thats possible, although I would prefer to create a seperated faceSet or cellSet as it is done when failing a checkMesh check. The reason is, that I would have to play around with contour scaling (max. = user-defined y+ limit) and colors. For me the much more elegant way is to create a faceSet/cellSet, although its maybe slightly more complicated to code. Thatswhy I asked for it and not the volScalarField :)

Anyway for the time being I will create a volScalarField.

Thanks and best regards,

Bernhard May 27, 2011 08:37

In paraview, you can use the treshold value, and select only the cells with y+ in a certain range of specified values. This has the same effect as specifying a cellSet. This is the route that I would follow probably.

florian_krause May 27, 2011 08:47

you are right, that should give the same... thanks for the hint! I will give it a try.


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