CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Definition of y+ in yPlusRAS (1.7.1)

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree12Likes

Reply
 
LinkBack Thread Tools Display Modes
Old   October 17, 2011, 07:48
Default
  #21
Senior Member
 
Join Date: Mar 2009
Posts: 138
Rep Power: 8
camoesas is on a distinguished road
I get 0 on every wall for fully resolved boundary layers. As reported here: Problems with YPlusRAS and wallShearStress

For wallFunction I get value but I canīt assess them...
__________________
OF - 2.0.0
camoesas is offline   Reply With Quote

Old   October 18, 2011, 19:53
Default y+ = y*
  #22
New Member
 
Saxwax
Join Date: Aug 2010
Posts: 17
Rep Power: 6
Saxwax is on a distinguished road
Hi Cameosas,

Glad to hear that the file compiled, not sure about the 0 for fully resolved boundary layers. It is possible that I used the old version of Niklas' yPlus utility. Have you checked that?

Vaina74, I'm not sure which version of the FLUENT manual you are quoting. In the version that I have (Version 12 April 2009) the section Near-Wall Treatment for Wall Bounded FLows contains the following quote:

"It should be noted that, in ANSYS FLUENT, the laws-of-the-wall for mean velocity and temperature are based on the wall unit, y*, rather than y+. These quantities are approximately equal in equilibrium turbulent boundary layers."

Comparing the equations for y+ and y* we can see that the only difference between the two are the frictionVelocity, Cmu^0.25 and k^0.5 terms.

y+ = rho*frictionVelocity*y/mu

y* = rho*(Cmu^0.25)*(k^0.5)*y/mu

For equilibrium turbulent boundary layers (ETBL) frictionVelocity = (Cmu^0.25)*(k^0.5) (Ferziger), i.e. y+ is equal to y*.

If you are using standard wall functions for flows with an ETBL then y*, or yPlusRAS, probably will give you a good enough indication of the appropriateness of your cell size.

Not sure if that helps (it definitely wont if I am wrong ). Let me know your thoughts on this one. It would be good to have a better idea on why things are the way they are in OpenFOAM.

Regards,

D.
ArathoN and mgg like this.
Saxwax is offline   Reply With Quote

Old   October 20, 2011, 04:09
Default
  #23
Senior Member
 
Join Date: Mar 2009
Posts: 138
Rep Power: 8
camoesas is on a distinguished road
HI Saxwax,

I have downloaded both, but I am using the newer version.
__________________
OF - 2.0.0
camoesas is offline   Reply With Quote

Old   October 24, 2011, 23:50
Default Nut?
  #24
New Member
 
Saxwax
Join Date: Aug 2010
Posts: 17
Rep Power: 6
Saxwax is on a distinguished road
Cameosas,

The way I see it, based on the equation used to calculate the cell y+ value in the yPlus utility there are three possible reasons why a value of exactly zero would be output:

1) y = 0
2) snGrad = 0
3) nut = 0

Two of these are very easy to check, y and nut. The third is also probably quite easy to check (edit yPlus utility to output snGrad instead) - I haven't tried this.

My guess would be that nut is the likely culprit. Either a boundary condition at the wall is set to nut = 0, or the wall function being used (i.e. nutkWallFunction) is calculating the nut value at some (or all) points to be zero. I'd either have a look at the nut file or colour the wall patch by nut in Paraview.

I have noticed the same zero values being output by yPlus. A quick check showed that the nut field had several cells showing up as zero (nutkWallFunction). I'm not really sure if this is the expected behavior or not. Someone else can probably answer that.

Regards,

D.

Last edited by Saxwax; October 25, 2011 at 01:10.
Saxwax is offline   Reply With Quote

Old   October 25, 2011, 10:00
Default
  #25
Senior Member
 
Join Date: Mar 2009
Posts: 138
Rep Power: 8
camoesas is on a distinguished road
HI Saxwax,

Thats a really good hint! Thanks!
I get zero values for:

Code:
yPlus.boundaryField()[patchi] = y[patchi]
AND for:

Code:
yPlus.boundaryField()[patchi] = mut.boundaryField()[patchi]
(I am using the compressible version)

Code:
 yPlus.boundaryField()[patchi] =
          mag(U.boundaryField()[patchi].snGrad());
gives non zero values. in the order of 1e3

Code:
        yPlus.boundaryField()[patchi] =
          (RASModel->mu().boundaryField()[patchi]/rho.boundaryField()[patchi]);
gives non zero values in the order of 1e-5
__________________
OF - 2.0.0

Last edited by camoesas; October 26, 2011 at 01:47.
camoesas is offline   Reply With Quote

Old   October 26, 2011, 03:06
Default
  #26
Senior Member
 
Join Date: Mar 2009
Posts: 138
Rep Power: 8
camoesas is on a distinguished road
I have defined the walls for mut like:

Code:
    {
        type            mutkWallFunction;
        value           uniform 0;
    }
Thats like its defined in the tutorials...
__________________
OF - 2.0.0
camoesas is offline   Reply With Quote

Old   November 1, 2011, 20:11
Default
  #27
New Member
 
Saxwax
Join Date: Aug 2010
Posts: 17
Rep Power: 6
Saxwax is on a distinguished road
Cameosas,

Are the zero values for mut and y in the same cells (or all the cells)? If so I would guess that the mutkWallFunction uses y to calculate the mut value. You could check this by looking at the mutkWallFunction.C source code. This way you would know that the zero values originate from y. If not well then I am not really sure. Again, looking at the source code may help.

Regards,

D.
Saxwax is offline   Reply With Quote

Old   June 10, 2013, 03:56
Default
  #28
Member
 
Join Date: Aug 2011
Posts: 74
Rep Power: 5
idefix is on a distinguished road
Hello,

I just want to check that yPlusRAS is calculating the right thing.
So I calculated yPlus with yPlusRAS and by hand with this equation:

yPlus= Cmu^(0.25) * y * k^(0.5) / nu

with:
Cmu =0.09
y = 0.00125 (it is the cell height / 2 because I am looking at the cell directly at the wall)
k = 0.19 (from paraview)
nu = 1.0e-6

So i get: yPlus = 298

yPlusRAS says: yPlus = 6.7

The domain is a rectangular channel, so Iīve got a nice grid.
To get the yPlus from yPlusRAS I should use y = 2.8e-5

Can somebody help me what is wrong?

Thanks a lot
idefix is offline   Reply With Quote

Old   June 11, 2013, 03:00
Default
  #29
Member
 
Join Date: Aug 2011
Posts: 74
Rep Power: 5
idefix is on a distinguished road
I found my mistake

the yPlus = 6.7 was shown in paraview.
If I look at the output in the shell after I tipped yPlusRAS I see complete different values in comparison to the values in paraview.
But the values in the output are the values I calculated by hand.
So the interpolation in paraview was the problem.

But still one simple question is left:
I have a rectangular channel and I decided to use wall functions for k, epsilon and nut.
Am I right that the distance from the wall to the cell centre of the first cell at the wall has to be smaller than yPlus = 11?
If itīs not, do I get a wrong result?
I am also not sure what k I should use for calculating yPlus.
At the beginning I only have the k which I enter in the k-file. But at the end of my simulation the k at the wall has changed. So yPlus has changed too. So maybe after the run I know that my grid should be smaller.
How can I solve this problem?

thanks a lot for your help
idefix is offline   Reply With Quote

Old   August 6, 2014, 13:18
Default
  #30
New Member
 
Marvin
Join Date: Jan 2014
Posts: 11
Rep Power: 3
Marvin_Rauch is on a distinguished road
Sorry for bumping that old thread.

Has anyone a compiling version of the right "yPlus" for OF 2.3. Or can anyone tell me what I have to change in the original yPlusRAS.H to calculate the right yPlus. I'm quite new to openFOAM so I'm greatful for any hint that teaches me how to write my own sourcecode.
Actually I'm just grepping through source code on and on with little progress.


Unlike OF 1.7, in OF 2.3 I can't find yPlus.H there is only yPlusRAS.H which somehow calculates yPlus using the nutWallFunctionFvPatchScalarField.
Marvin_Rauch is offline   Reply With Quote

Old   September 9, 2014, 13:01
Default
  #31
New Member
 
Chrissy Stanford
Join Date: Oct 2013
Location: South Africa
Posts: 11
Rep Power: 3
New_OpenFOAM_user is on a distinguished road
Quote:
Originally Posted by Marvin_Rauch View Post
Sorry for bumping that old thread.

Has anyone a compiling version of the right "yPlus" for OF 2.3. Or can anyone tell me what I have to change in the original yPlusRAS.H to calculate the right yPlus. I'm quite new to openFOAM so I'm greatful for any hint that teaches me how to write my own sourcecode.
Actually I'm just grepping through source code on and on with little progress.


Unlike OF 1.7, in OF 2.3 I can't find yPlus.H there is only yPlusRAS.H which somehow calculates yPlus using the nutWallFunctionFvPatchScalarField.
Hi Marvin,

I am struggling with the same problem. Have you found a way of calculating y+ yet?

I have found other yPlus utilities in similar threads (See link below) and tried to apply them to my model, but since I'm working with a high Re turbulence model (and the code is written for low Re models) I get y+ values of zero. This is not necessarily the problem, though. I might just be implementing it completely incorrectly.

Here is the link to the other posts on this topic that I read:
y+ and u+ values with low-Re RANS turbulence models: utility + testcase. Post #93 is where I found the utility I mentioned.

I have also wondered how openFoam v. 2.3.x calculates y* and whether it is possible to find a relation between y* and y+ and modify the values that are generated by yPlusRAS?

I have scoured through the nutWallFunctionFvPatchScalarField, but since my programming is rusty I can't figure out how y* is calculated.

Any help would be greatly appreciated.
Thanks,
Chrissy
New_OpenFOAM_user is offline   Reply With Quote

Old   September 15, 2014, 04:14
Default
  #32
New Member
 
Marvin
Join Date: Jan 2014
Posts: 11
Rep Power: 3
Marvin_Rauch is on a distinguished road
Hey Chrissy,

I am sorry but my final approach was now to use CFX to compute yPlus values instead.

I haven't found a relation between y* and y+. What I have noticed is that the yStar values from CFX are more than ten times higher if the prisms are very thin (12 prism layers and more, enough to resolve the boundary layer). For meshes with 3 prism layers, yStar and yPlus were only slightly different (both average and min max).

What I need to add is that OF is directly computing on teds and CFX is using the nodes to create a polyeder mesh around them. Therefore the elements slighly differ.

You are right with the nutFunction. They are essential for yPlus computation. For example if you resolve the BL (set nut = computed) you can't compute yPlus any more.

I found nutkWallfunction:
const scalar Cmu25 = pow025(Cmu_);

tmp<scalarField> tnutw(new scalarField(patch().size(), 0.0));
scalarField& nutw = tnutw();

forAll(nutw, faceI)
{
label faceCellI = patch().faceCells()[faceI];

scalar yPlus = Cmu25*y[faceI]*sqrt(k[faceCellI])/nuw[faceI];

if (yPlus > yPlusLam_)
{
nutw[faceI] = nuw[faceI]*(yPlus*kappa_/log(E_*yPlus) - 1.0);
}
}

return tnutw;
}

maybe it is the definition you are looking for. I hope I could help you little. But now I have to return writing my thesis

Greets

Marvin
Marvin_Rauch is offline   Reply With Quote

Old   July 7, 2015, 08:53
Default
  #33
New Member
 
Luka Denies
Join Date: Oct 2014
Posts: 10
Rep Power: 2
LukaD is on a distinguished road
I've changed the file previously uploaded here. This file works for OF 2.3.1 and calculates y+ instead of y*.
Attached Files
File Type: c yPlus.C (7.3 KB, 2 views)
LukaD is offline   Reply With Quote

Reply

Tags
komegasst, openfoam 1.7.1, simplefoam, yplusras

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
OpenFOAM static build on Cray XT5 asaijo OpenFOAM Installation 9 April 6, 2011 12:21
Working directory via command line Luiz CFX 4 March 6, 2011 21:02
OpenCFD release OpenFOAMŪ version 1.7.1 opencfd OpenFOAM Announcements from ESI-OpenCFD 0 August 26, 2010 11:40
yPlusRAS in OF 1.6.x - Low Re Models ivan_cozza OpenFOAM Running, Solving & CFD 0 September 23, 2009 05:27
OpenFOAM14 for Mac OSX Darwin 104 gschaider OpenFOAM Installation 118 July 20, 2008 05:19


All times are GMT -4. The time now is 12:42.