CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Writing y (

christian May 14, 2007 07:03

How do I write y+ (so that I c
How do I write y+ (so that I can plot y+ in paraFoam) when not running LES?

Best regards,
Christian Svensson

mattijs May 15, 2007 03:29

Have a look at the checkYPlus
Have a look at the checkYPlus postprocessing utility.

christian May 15, 2007 03:40

This is what I've done. From w
This is what I've done. From what I can see checkYPlus only reports the y+ values, it doesn't write them to a file so that I can plot them in paraFoam. How can I do this? yPlusLES has this feature.


gschaider May 15, 2007 04:07

Two possibilities (first is be
Two possibilities (first is better):

a) Adopt the difference between checkYPlus and yPlusLES into a new utility
b) use the two utilities I'm posting below (behave like original checkYPlus, with the -write option yPlus gets written to a field (only for wall-patches) checkYPlusIncompressible.tgz checkYPlusCompressible.tgz

christian August 23, 2007 07:08

When using the yPlusLES utilit
When using the yPlusLES utility I don't get any values in the yPlus file. It simply says:

type calculated;
value uniform 0;

What is wrong? Grateful for a quick response.

Best regards,
Christian Svensson

hadi August 23, 2007 07:37

Hi christian, I am new to o
Hi christian,

I am new to openFoam too, but maybe i can help!
Did you modify yPlusLES utility?
Are u trying to calculate a mean value over a boundary?


christian August 23, 2007 07:41

No I haven't modified the yPlu
No I haven't modified the yPlusLES utility. I'm running it in its original shape. However, I don't get any result data in the yPlus file of the time step directory.

hadi August 23, 2007 08:03

Your yPlus value is uniform ov
Your yPlus value is uniform over the boundary and is equal to zero:
type calculated;
value uniform 0;!!
In this utility you calculate yPlus as following :
if (typeid(currPatch) == typeid(wallFvPatch))
yPlus.boundaryField()[patchi] =
Y+ = Y*sqrt(nueff*gradU)/nu
usually u get "value uniform 0" on a boundary; when it is not a wall.
Try wallGradU utility to see if u will have the same problem.
Can you tell me about the geometry and boundary conditions

christian August 23, 2007 08:20

wallGradU gives me a lot of ve
wallGradU gives me a lot of vector values for each of my boundaries as expected.

The geometry is a pipe containing plate with a hole, like a throttle. The pipe and throttle are walls with a uniform 0 velocity. The inlet is mapped from a RANS computation and the outlet is a pressure outlet.

Can't understand why I don't get any yPlus values using yPlusLES???

christian August 23, 2007 08:33

I realised what was wrong. In
I realised what was wrong. In my boundary file, the type of my wall boundaries was set to "patch". When I changed them to "wall" everything works fine. Thanks for taking the time to help me.

/ Christian

paka September 27, 2007 21:47

I'm using rasInterFoam solver
I'm using rasInterFoam solver and I want to calculate y+ for tested cases. Could anyone help here?
When I try to run it, first it says p field is missing. This is not a problem, cause I use an utility which calculates real pressure producing "p" field. Then in the next step it says there is trouble in what follows:

Create mesh for time = 0

Time = 0
Reading field p

Reading field U

Reading/calculating face flux field phi

--> FOAM FATAL IO ERROR : keyword transportModel is undefined in dictionary "/share/kiwiraid/krystian/OpenFOAM/krystian-1.4/run/tutorials/icoFoam/cavity/./c onstant/transportProperties"

file: /share/kiwiraid/krystian/OpenFOAM/krystian-1.4/run/tutorials/icoFoam/cavity/./co nstant/transportProperties from line 25 to line 25.

From function dictionary::lookupEntry(const word& keyword) const
in file db/dictionary/dictionary.C at line 146.

FOAM exiting

Which clearly shows that transportProperties file differs from what was assumed initially.

Could anyone please provide some tip what to fix in order to make it run with rasInterFoam solver or interFoam solver (definition files for transport properties are the same) or perfectly modify the code so it will be workable with mentioned solvers?

BTW. For what solvers was checkYPlus tool done initially? I tried to run with some of other solvers including LES, but something is still wrong. I'm using OpenFOAM 1.4 version. Might it be a problem that checkYPlus doesn't work with newer versions?

Many very thanks,

paka September 27, 2007 21:54

Actually, there is some proble
Actually, there is some problem reading 'p' field too. Hmm... So any input is greatly welcomed.


hadi September 28, 2007 03:58

Hello Krystian, Which utili
Hello Krystian,

Which utility did you use to calculate y+?


paka September 28, 2007 05:11

I tried to use checkYPlus, how
I tried to use checkYPlus, however didn't work as I mentioned. Just in case I also tried to use the other related tool, made for LES, and also the one for incompressible flow attached in this topic. Neither of those worked.

hadi September 28, 2007 06:02

If you want to calculate y+. y
If you want to calculate y+. you should be running a turbulent solver, it will not work for icoFoam since it is a solver for laminar flow, try to use turbFoam, or the adequate turbulent solver for your case.
About rasInterFoam, i don't know this solver but apparently you don't have a P file, i am not sure if u can modify it.

CheckYPlus does not work for LES solvers!


paka September 28, 2007 16:32

Yes, I figured that out that c
Yes, I figured that out that checkYPlus in not for LES, there is other tool for LES.

Even if the p field is created, then I think appears problem with transportProperties dictionary, since it specifies two phases.

Any other input? thanks,

mighelone October 14, 2007 11:16

Hello! I'm trying to compile
I'm trying to compile the checkYPlusCompressible utility posted in this discussion with OpenFOAM 1.4.1, but I obtain the following errors:

Making dependency list for source file checkYPlusCompressible.C
SOURCE=checkYPlusCompressible.C ; g++ -m32 -Dlinux -DDP -Wall -Wno-strict-aliasing -Wextra -Wno-unused-parameter -Wold-style-cast -O3 -DNoRepository -ftemplate-depth-40 -I/home/michele/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude -I/home/michele/OpenFOAM/OpenFOAM-1.4.1/src/thermophysicalModels/specie/lnInclud e -I/home/michele/OpenFOAM/OpenFOAM-1.4.1/src/thermophysicalModels/combustion/lnIn clude -I/home/michele/OpenFOAM/OpenFOAM-1.4.1/src/thermophysicalModels/basic/lnInclude -I/home/michele/OpenFOAM/OpenFOAM-1.4.1/src/thermophysicalModels/chemistryModel/ lnInclude -I/home/michele/OpenFOAM/OpenFOAM-1.4.1/src/turbulenceModels -I/home/michele/OpenFOAM/OpenFOAM-1.4.1/src/transportModels -IlnInclude -I. -I/home/michele/OpenFOAM/OpenFOAM-1.4.1/src/OpenFOAM/lnInclude -fPIC -pthread -c $SOURCE -o Make/linuxGccDPOpt/checkYPlusCompressible.o
checkYPlusCompressible.C: In function 'int main(int, char**)':
checkYPlusCompressible.C:171: error: no matching function for call to 'Foam::fixedValueFvPatchField<double>::fixedValueF vPatchField(const Foam::fvPatch&, Foam::Field<double>&)'
/home/michele/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/fixedValueFvPat chField.C:87: note: candidates are: Foam::fixedValueFvPatchField<type>::fixedValueFvPa tchField(const Foam::fixedValueFvPatchField<type>&, const Foam::DimensionedField<type,>&) [with Type = double]
/home/michele/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/fixedValueFvPat chField.C:76: note: Foam::fixedValueFvPatchField<type>::fixedValueFvPa tchField(const Foam::fixedValueFvPatchField<type>&) [with Type = double]
/home/michele/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/fixedValueFvPat chField.C:66: note: Foam::fixedValueFvPatchField<type>::fixedValueFvPa tchField(const Foam::fixedValueFvPatchField<type>&, const Foam::fvPatch&, const Foam::DimensionedField<type,>&, const Foam::fvPatchFieldMapper&) [with Type = double]
/home/michele/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/fixedValueFvPat chField.C:53: note: Foam::fixedValueFvPatchField<type>::fixedValueFvPa tchField(const Foam::fvPatch&, const Foam::DimensionedField<type,>&, const Foam::dictionary&) [with Type = double]
/home/michele/OpenFOAM/OpenFOAM-1.4.1/src/finiteVolume/lnInclude/fixedValueFvPat chField.C:41: note: Foam::fixedValueFvPatchField<type>::fixedValueFvPa tchField(const Foam::fvPatch&, const Foam::DimensionedField<type,>&) [with Type = double]
make: *** [Make/linuxGccDPOpt/checkYPlusCompressible.o] Error 1

Does someone have compiled this utility with the latest OpenFOAM release?


gschaider October 15, 2007 04:13

Well. That removes the calcula
Well. That removes the calculation/writing of yPlus for the wall-patches (that code had to be changed for 1.4.1). I will post an updated version later in the day.


mighelone October 15, 2007 06:08

thank you Bernhard! I don't
thank you Bernhard!

I don't understand the real function of the code that I've commented, but the remaining part of the utility satisfies my needs, since it checks the value of Yplus on every bondary wall, creating a YPlus field in time directory.


gschaider October 15, 2007 14:50

Hi Michele! The 1.4.1-ready
Hi Michele!

The 1.4.1-ready code can be downloaded via Subversion with the command
svn checkout r/utilities/postProcessing/YPlusWithWrite

You're right. I'm not quite sure of the purpose of the offending code (seems I was trying to be too clever (trying to make sure that the wall-Patches are fixedValue-patches). But I'll have a look, before I remove it.


All times are GMT -4. The time now is 05:37.