CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   How to calculate y-plus? (https://www.cfd-online.com/Forums/openfoam-solving/116358-how-calculate-y-plus.html)

Blanco March 23, 2015 02:43

Hi Xinguang,

I don't have experience with sonicFoam, but I think for sure you need to define mu and mut -> cinematic viscosity with varying density, laminar and turbulent, in order to perform your compressible simulation. In the results you will get the rho field and it will be used by yPlusRAS to calculate y+ values.

JasonWang3 March 23, 2015 07:15

Hi Andrea

As you said, yPlusRAS could give the yplus at the wall after I generate the rho fields. But the value is quite small than I expected, since I calculate yplus using the yplus calculator:
http://geolab.larc.nasa.gov/APPS/YPlus/
yPlusRAS give the value of 0.03 compare with 1 of the yplus calculator.

But in the website, there is no information about the calculation. So I think I should calculate the yplus by hand to compare with the results of OF.

Thanks for your reply.

Blanco March 25, 2015 10:59

Hi Xinguang,

yes you can check at a wall what is the y+ value "by hand", but I'm pretty sure you will find that OF is using the right formula. Check my post #37

HTML Code:

http://www.cfd-online.com/Forums/openfoam-solving/116358-how-calculate-y-plus-2.html#post530569
and check your wall boundary. The y+ formula in OF is exactly the one used in every calculator.

Best,

Andrea

jaydeepKhajure September 8, 2015 04:22

yPlusRAS error
 
Hello,

Currently I am running the case in OpenFOAM 2.3.0. I am having a problem calculating the y plus value. My case is in sonicfoam having Re 3e6 and I am using K-Epsilon RAS model. However, after post processing I type the command yPlusRAS in terminal, I get following error message,

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Create time

Create mesh for time = 0

Time = 0
Calculating wall distance

Writing wall distance to field y

Reading field U

Reading/calculating face flux field phi



--> FOAM FATAL IO ERROR:
cannot open file

file: /home/cae/OpenFOAM/cae-2.3.0/run/jaydeep/Pen_3D_4.5/constant/transportProperties at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 87.

FOAM exiting

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Can anybody suggest a possible solution to overcome this error message ?

Thanks and Regards
jaydeep

Blanco September 8, 2015 04:51

OF doesn't find the transportProperties file inside the correct path. Check if it's there, OF needs to check what RANS model you are using and what are the nu or mu values.

JasonWang3 September 8, 2015 05:45

Quote:

Originally Posted by jaydeepKhajure (Post 562909)
Hello,

Currently I am running the case in OpenFOAM 2.3.0. I am having a problem calculating the y plus value. My case is in sonicfoam having Re 3e6 and I am using K-Epsilon RAS model. However, after post processing I type the command yPlusRAS in terminal, I get following error message,

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Create time

Create mesh for time = 0

Time = 0
Calculating wall distance

Writing wall distance to field y

Reading field U

Reading/calculating face flux field phi



--> FOAM FATAL IO ERROR:
cannot open file

file: /home/cae/OpenFOAM/cae-2.3.0/run/jaydeep/Pen_3D_4.5/constant/transportProperties at line 0.

From function regIOobject::readStream()
in file db/regIOobject/regIOobjectRead.C at line 87.

FOAM exiting

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Can anybody suggest a possible solution to overcome this error message ?

Thanks and Regards
jaydeep

copy a transportProperties file to the constant folder

try yPlusRAS -compressible -time [time folder]

Before this, change the mut wall bc to mutLowReWallfunction, which is used to calculate the yPlus value.

hamide December 8, 2015 03:34

hello friends
i'm new in openFoam. i want to calculate y-plus in openFoam. i don't know how!!!
it's turbulent duct flow with Re=3e+5
would you please help me?

JasonWang3 December 8, 2015 04:39

change wall bc in the mut file as mutLowReWallFunction, and in the terminal 'yPlusRAS (-compressible) (-time)'.

Hope it is helpful.

hamide December 8, 2015 04:46

Quote:

Originally Posted by JasonWang3 (Post 576759)
change wall bc in the mut file as mutLowReWallFunction, and in the terminal 'yPlusRAS (-compressible) (-time)'.

Hope it is helpful.




i don't have mut file!!!!
i have p,u,nut,k and epsilon File

JasonWang3 December 8, 2015 06:50

In the nut file, nutLowReWallFunction, then type in yPlusRAS

Elham June 15, 2016 23:56

yPlusLES is very small
 
Hi,

I am doing simulaion inside a channel with Re=4900 based on channel half width. The channel is 10mm*60mm*10mm. The mesh is 50*300*50. The flow direction is in y-direction. I use yPlusLES utility but I get weird results. the yPlus in all over the domain, near or far from the wall, is very small, let's say maximum 3.
I also calculated
UPlus=U_mean/Utau
Utau=sqrt(gardP*h)
h=half channel width
I put gradp in respect to spanwise direction. I am not pretty sure that this gradP is correct. I got it by adding gradP in controlDict.

Thanks for any comment.

Bashar December 17, 2016 12:01

Hi,
I am little confused! So, I am running an LES simulation flow past plate with Re=50000. If I use the yPlusLES will this give me ystar or yplus? I am using pimpleFoam.Also if I want to comput the y+ around the plate and not the full domain , how can I do that?


Sent from my iPhone using CFD Online Forum mobile app

Bashar December 19, 2016 14:40

Thanks , I found the answer.
In my version , 3.0.1, I used yPlus command to get it.
Thanks a lot.

crazzy.pirate43 May 23, 2017 11:46

How can I calculate y+ without any SGS model in LES?
 
Hi everybody,

So now, How can I calculate y+ without any SGS model in LES? as I have no nuEff

piu58 May 23, 2017 13:29

Quote:

Originally Posted by crazzy.pirate43 (Post 649973)
Hi everybody,

So now, How can I calculate y+ without any SGS model in LES? as I have no nuEff

You only need the wall shear stress for that. Calculate the wall forces, and analyse the shear stress over your surface. With that you may get your y+ coordinate by

y^{+}={\frac {y\,u_{\tau }}{\nu }}

You get the friction velocity using the wall shear stress.
u_{\tau }={\sqrt {\frac {\tau _{w}}{\rho }}}

With this calculated for a point you may express the y-value of the first cell center. This is the y+ values the tools in OF give.

crazzy.pirate43 May 23, 2017 14:59

Dear Uwe,
thanks a lot for the quick reply. I think I managed to get it by put turbulenceProperties file as a laminar in the studied case after the run and just put the utility command yPlus

Thanks

LThomes July 10, 2017 07:31

Hello everyone,
I'm simulating the flow past a sphere using k-omega SST model and I'm trying to calculate the yPlus on the sphere. I tried to type "yPlusRAS" in the terminal, as you said, but it gives me the following message:
Code:

[ofuser@default c9]$ yPlusRAS
bash: yPlusRAS: command not found

I'm using OpenFOAM v1612+ for Windows.
Can anybody help me?

LThomes July 10, 2017 08:07

Quote:

Originally Posted by LThomes (Post 656459)
Hello everyone,
I'm simulating the flow past a sphere using k-omega SST model and I'm trying to calculate the yPlus on the sphere. I tried to type "yPlusRAS" in the terminal, as you said, but it gives me the following message:
Code:

[ofuser@default c9]$ yPlusRAS
bash: yPlusRAS: command not found

I'm using OpenFOAM v1612+ for Windows.
Can anybody help me?

In my OpenFOAM version I have to type pimpleFoam -postProcess -func yPlus :)

kooki_13 August 20, 2017 06:05

hi
I am doing open channel for simulating atmospheric boundary layer with openFoam. my solver is pimple and the LES model is oneEqEddy. and I do not know how can I calculate y+. domain size is 1400,1000,100 m and thats whye the first y+ became so large!

RobertHB August 23, 2017 05:13

Quote:

Originally Posted by kooki_13 (Post 661283)
and I do not know how can I calculate y+.

Take a look at post #55.
You can get the wall shear stress by using the wallShearStress postProcessing functionality and calculating its magnitude. Remember that OpenFOAM uses kinematic pressure and that you have to multiply your wallShearStress by the density of your fluid.

For your mesh size, try to use mesh grading or snappyHexMesh to refine the section of your mesh close to the wall.

Lucas_Gasparino August 31, 2017 08:53

There are ways of predicting yplus before meshing, but honestly they're very rough. After simulation, it's a standard, plottable value in CFD post or any other software. In general, you want to keep yplus between 0m1 and 1 for complex models; less than 0.1 is overkill and also starts producing some bad results as well due to bad aspect ratios and volumes close to zero. LES I'd a different beast however: your mesh near the walls should be able to capture large eddies in the layer itself, which will be small nonetheless. I'd advise you to use LES WALE or WMLES, which introduce a bit o Wallace modelling to correct mesh effects. From experience, I used smagorinsky model with a bad yplus and, although it works, you're going to lose a lot of information. For the cylinder however, focus on getting the wake modelled nicely: most of your turbulence will be happening downstream. Make sure to enable data statistics to get mean flow data as well, so later you can separate the fluctuation and verify the rate of dissipation.

Sent from my XT1635-02 using CFD Online Forum mobile app

calf.Z April 21, 2019 03:36

Quote:

Originally Posted by Blanco (Post 530569)


Code:

tmp<scalarField> nutLowReWallFunctionFvPatchScalarField::yPlus() const
{
    const label patchi = patch().index();
    const turbulenceModel& turbModel =
        db().lookupObject<turbulenceModel>("turbulenceModel");
    const scalarField& y = turbModel.y()[patchi];
    const tmp<volScalarField> tnu = turbModel.nu();
    const volScalarField& nu = tnu();
    const scalarField& nuw = nu.boundaryField()[patchi];
    const fvPatchVectorField& Uw = turbModel.U().boundaryField()[patchi];

    return y*sqrt(nuw*mag(Uw.snGrad()))/nuw;
}

Andrea

I want to define y+ in my code, and there are yPlus defined in nutLowReWallFunction. So I want to quote them.

But there are some errors. How can I use the definition of yPlus in nutLowReWallFunction to apply it in my code? Thank you.

esha June 4, 2019 01:35

Quote:

Originally Posted by immortality (Post 421499)
I wonder how we can calculate y+ at a laminar flow without any turbulent model? is it possible?

I also want to calculate the value of Y+for laminar case. if you have calculated please let me know. thanks!

Hughtong November 7, 2021 02:10

DNS yplus in OpenFoam
 
Quote:

Originally Posted by fredo490 (Post 421504)
At first the y+ has nothing to do with CFD but it has to do with the boundary layer theory (this number was created in the 1930's). The definition is here : http://www.cfd-online.com/Wiki/Dimen...stance_(y_plus)

Yes this number has a meaning for a laminar flow but we don't really care for CFD cases. It is mainly used for turbulent flow because the models we use are based on some assumptions that need to be verified.

But when doing DNS in OpenFoam, the turbulenproperties will be laminar, the yPlus also should be calculated.

fredo490 November 7, 2021 20:43

Indeed, this is a very good comment and nice corner case ;)

I would also say that if someone is going to run a DNS simulation, he should have at least the basic fundamentals of the theory and this question should not even exist in his mind.

fredo490 November 7, 2021 20:47

By the way, if someone wants to learn more about this topic, I would highly recommend Fluid Mechanics 101 videos:
https://www.youtube.com/watch?v=nSdVaF3JnI0
https://www.youtube.com/watch?v=fJDYtEGMgzs
https://www.youtube.com/watch?v=1gSHN99I7L4

Hughtong November 7, 2021 21:22

Quote:

Originally Posted by fredo490 (Post 815975)
Indeed, this is a very good comment and nice corner case ;)

I would also say that if someone is going to run a DNS simulation, he should have at least the basic fundamentals of the theory and this question should not even exist in his mind.

Thank you for sharing, the videos are very helpful for me! Recently i'm using OpenFoam to do channel DNS, but I can only calculate yplus after extracting U and the first mesh length, there's not a utility for the "turbulenceProperties -laminar". So I'm quite curious why OpenFoam don't consider this condition, and can only use the yPlus utility when using turburlence model.

shail546 November 10, 2021 01:33

Please tell me where to type yPlusRAS to know the y+ in openFoam?
I am typing in the terminal but its showing command not found.

shail546 November 10, 2021 01:37

Quote:

Originally Posted by immortality (Post 421342)
hi
Type yPlusRAS or yPlusLES
If you have ras or les turbulency.

Please tell me where to type yPlusRAS to know the y+ in openFoam?
I am typing in the terminal but its showing command not found.


All times are GMT -4. The time now is 00:52.