# Problems with YPlusRAS and wallShearStress

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

 September 17, 2010, 07:54 Problems with YPlusRAS and wallShearStress #1 New Member   Peter Join Date: Aug 2010 Posts: 16 Rep Power: 9 Dear Foamers, I am simulating a simple compressible channel flow, using the rhoSimpleFoam solver and the k-Omega-SST turbulence model. For postprocessing, I'd like to compute YPlus to validate my grid and the wall shear stress. The Reynolds-number is about 18000. Also, I calculated Tau_wall and YPlus using correlations to validate my results. For YPlus at the wall: I used the Blasius-correlation to calculate Cf (Cf = 0.079 * Re ^(-0.25)) Then I calculated Tau_wall using Cf = Tau_wall / (0.5 * rho_0 * U_0^2). Using Tau_wall, it was easy to calculate U_tau (= sqrt (Tau_wall/rho)) and yPlus (= U_tau * y/ nu with y = height of the closest cell to the wall, this gives me the y* of the first cell). For Tau_wall: Using the Blasius-correlation and calculate Tau as described above. Unfortunately, the values of yPlus were not even close to the ones given by the openFoam utility, and the values of Tau_wall were different by about 20 percent. The next approach to solve this problem was to write a program, calculating the wall shear stress using the wall velocity gradient, calculated by wallGradU. The shear stress is calculated Tau_wall = nu*rho * du/dn, taking du/dn from wallGradU. This results matched the ones calculated with the correlation much better. (better description of how to calculate wall shear stress can be found here: http://www.cfd-online.com/Forums/ope...interfoam.html) Therefore, I assume that wallShearStress and YPlus give wrong values. Unfortunately, I don't know why. I just know that those tools are using the wall models to calculate the values, but I don't know how this works exactly. Is someone familiar with this problem? Can somebody tell me why these results calculated with this tools are wrong? I think I read somewhere that those tools are only valid for incompressible flows, but not for compressible ones, is that true? Does anyone know a tool to calculate YPlus correctly? I need to plot a diagram uplus/yplus, therefore I need the exact values. Thanks, Peter sasanghomi, immortality, mgg and 3 others like this.

 October 3, 2010, 09:49 #2 Senior Member   Francois Join Date: Jun 2010 Posts: 107 Rep Power: 10 Dear Peter, I don't know if it would be of any help, but I am doing the same thing, albeit with results based on a LES simulation of channel flow instead of RANS simulation. I'm using a 32^3 mesh. I'm implementing the following procedure:I take a y-z plane, and compute for every cell next to the wall the value Ugrad, simply taking the U component divided by dx, ie Ugrad = Ux/dx Then I can compute u_tau by taking the square root of Ugrad time nu, which is read from your transportProperties file, and stored in db(). So you simply do u_tau = sqrt(nu*Ugrad) The u_tau results I get are good, although they might be even beter with a higher order estimation of Ugrad, over two or more cells in the y direction. Regards, Francois.

 October 4, 2010, 06:45 #3 New Member   Peter Join Date: Aug 2010 Posts: 16 Rep Power: 9 Hi Francois! Thank you for your answer. I did the same as you suggested in postprocessing with Tecplot, using the velocitygradient given by wallGradU and now it works. For other users with the same problem: Don't use wallShearStress, I don't know why, but this tool gives wrong results. And the results given by yPlus are wrong too, because this tool calculates yStar and not yPlus cfdonline2mohsen, sasanghomi, immortality and 2 others like this.

 October 20, 2010, 16:36 #4 Senior Member   Francois Beaubert Join Date: Mar 2009 Location: Lille, France Posts: 144 Rep Power: 10 thanks for sharing your experiences can someone else confirm those sad conclusions ?

October 22, 2010, 04:57
#5
Super Moderator

Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 22
how does this work?
Attached Files
 yPlus.tar.gz (2.4 KB, 426 views)

 October 22, 2010, 07:22 #6 Senior Member   Join Date: Mar 2009 Posts: 225 Rep Power: 11 Hmm... I thought so there might be something wrong. What I remember, even calculating yPlus/ on 0/ folder at very beginning of simulation for different related meshes it was giving the same yPlus value, whereas different value was expected.

November 3, 2010, 06:50
#7
Senior Member

Francois Beaubert
Join Date: Mar 2009
Location: Lille, France
Posts: 144
Rep Power: 10
Quote:
 Originally Posted by niklas how does this work?
I've tried your yPlus app, it compiles well run well but the output is zero on my case:

Create time

Create mesh for time = 100

Time = 100
Calculating wall distance

Writing wall distance to field y

Selecting incompressible transport model Newtonian
Selecting RAS turbulence model kEpsilon
kEpsilonCoeffs
{
Cmu 0.09;
C1 1.44;
C2 1.92;
sigmaEps 1.3;
}

Patch 2 named centerpiece y+ : min: 0 max: 0 average: 0

Patch 3 named pipewall y+ : min: 0 max: 0 average: 0

Patch 4 named fins y+ : min: 0 max: 0 average: 0

Writing yPlus to field yPlus

End

The yPlus file is created in the time directory but the boundaryField values on the patches are "uniform 0;"

I'm using OF 1.7.1 on ubuntu 10.04.
This issue with the computation of the wallShearStress and the yPlus values makes me crazy.

Francois

November 3, 2010, 08:23
#8
Super Moderator

Niklas Nordin
Join Date: Mar 2009
Location: Stockholm, Sweden
Posts: 693
Rep Power: 22
It looks like you dont have wallFunctions as boundary conditions.

here's a new version which does the yplus calculation if its just a wall as well.
Attached Files
 yPlus.tar.gz (2.5 KB, 586 views)

 November 3, 2010, 08:38 #9 Senior Member   Francois Beaubert Join Date: Mar 2009 Location: Lille, France Posts: 144 Rep Power: 10 Hi Niklas ! Thanks a lot to help me on this issue. The new yPlus app has the same behavior: perhaps there is something wrong with my case ? Will look deeper and try to find something. Thanks François

 December 1, 2010, 13:11 #10 New Member   Andreas Schwärzle Join Date: Sep 2010 Posts: 6 Rep Power: 9 Hi Niklas, I just had a look into your yPlus program and wondered about how you calculate y+. Can you tell me why you use 'nut' to calculate 'u+', and for the calculation of 'y+' you use 'nu' (from RASModel)? Thanks for your help! /Andi P.S.: With your second version of yPlus, I had the same problem as Francois, but only for very thin first layers (should result in appr. y+ =1)

 March 11, 2011, 03:53 #11 Member   José Join Date: Jan 2011 Posts: 73 Rep Power: 9 Dear Andreas, (or anybody who can help me with this problem) Could you get a value of yplus different to 0 for thin layers too? (I am using a 1st cell height of 2.75e-05) Thanks, José

 March 11, 2011, 10:06 #12 New Member   Andreas Schwärzle Join Date: Sep 2010 Posts: 6 Rep Power: 9 Hi Jose, have a look at the modified yPlusLES tool that Niklas also proposed. This is the way to calculate y+ when dealing with a low-Re mesh. Note that its only for incompressible flow. (which I was calculating then, so my problem was solved this way) /Andreas

 March 11, 2011, 10:07 #13 New Member   Andreas Schwärzle Join Date: Sep 2010 Posts: 6 Rep Power: 9 Hi Jose, have a look at the modified yPlusLES tool that Niklas also proposed. This is the way to calculate y+ when dealing with a low-Re mesh. Note that its only for incompressible flow. (which I was calculating then, so my problem was solved this way) http://www.cfd-online.com/Forums/ope...s-1-7-1-a.html /Andreas

 March 15, 2011, 10:27 #14 Member   José Join Date: Jan 2011 Posts: 73 Rep Power: 9 Hi Andreas, Thank you very much for your advice. There is one very important thing I want to comment though. The equation that you can find in that file from Niklas uses a variable "d", i.e. the nearWall distance. I had a look at the values of this d. I expected them to be the same all over the airfoil I am computing (since I am using a mesh with constant 1st cell height of 2.75e-5). To be sure that this is constant after having converted it to OF, I checked that in a post processor and this 1st cell height is constant, so there are no "conversion issues"). :S What I get is that they oscillate between 9e-6 and 1.3e-05. I don´t like this because the value of the computed yPlus then is not perfect. Can you tell me anything about this? Thanks, Regards, José

 March 15, 2011, 10:33 #15 Senior Member   Felix L. Join Date: Feb 2010 Location: Hamburg Posts: 165 Rep Power: 11 Hello, José, you say your mesh is converted from another format to polyMesh (OpenFOAM). Is it the FLUENT-format, by any chance? If so, try setting writeFormat inside the controlDict to binary and then convert the mesh using fluentMeshToFoam. This solved some issues with the meshes in my cases. Greetings, Felix.

 March 15, 2011, 10:55 #16 Member   José Join Date: Jan 2011 Posts: 73 Rep Power: 9 Hi Felix, I just tried what you told me and I get exactly the same as before, see the line below: :S. (All of them should be the same...) Patch 0 named wall dmin: 0 dmax: 1.33016e-05 daverage: 5.25961e-06 This dmin is 0, but if I show in the command prompt all the "d" calculated there is no 0 appearing, the minimum one is around 9e-06 (as I said before...). Any idea? Thank you very much for your attention, José P.D.: BTW, the reason why I don´t upload the results I told you in the other thread is because, as you see, I am struggling with some other stuff.

October 10, 2011, 09:29
#17
Senior Member

Join Date: Mar 2009
Posts: 138
Rep Power: 10
Quote:
 Originally Posted by niklas It looks like you dont have wallFunctions as boundary conditions. here's a new version which does the yplus calculation if its just a wall as well.

Hey Niklas,

actually I am working with your yPlus utility. I am trying to remodel it to calculate the wallShearStress for a compressible simulation.
For calculating y+ you are using mut and mu. Why are you using mut in the square root? As I know the definition of y+ is with mu instead of mut. Am I wrong?

Code:
```yPlus.boundaryField()[patchi] =
y[patchi]
* sqrt
(
mut.boundaryField()[patchi]
/ rho.boundaryField()[patchi]
)
/ (RASModel->mu().boundaryField()[patchi]/rho.boundaryField()[patchi]);```

What does this "RASModel->mu..." mean?

Thanks a lot!

Camoesas
__________________
OF - 2.0.0

October 10, 2011, 10:15
#18
Senior Member

Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 15
Quote:
 Originally Posted by camoesas Hey Niklas, actually I am working with your yPlus utility. I am trying to remodel it to calculate the wallShearStress for a compressible simulation.
Why don't you use the utilities distributed with OpenFOAM?
See util /postProcessing/wall/
You may also want to read: http://www.cfd-online.com/Forums/ope...bend-pipe.html

Quote:
 What does this "RASModel->mu..." mean?
mu() is a member function of any compressible RAS model. This one returns a volScalarField with the laminar viscosity. .boundaryField() is something similar for any geometricField type (of which volScalarField is one), you can imagine what is does probably.

 October 10, 2011, 12:47 #19 Senior Member   Join Date: Mar 2009 Posts: 138 Rep Power: 10 HI Bernhard, As I know there is no utility to calculate the wallShearStress in compressible cases... __________________ OF - 2.0.0

 May 2, 2013, 12:33 #20 Senior Member     Ehsan Join Date: Oct 2012 Location: Iran Posts: 2,209 Rep Power: 20 the file that Niklas has put doesn't compile in 2.2.0 version.is there any modification? __________________ Injustice Anywhere is a Threat for Justice Everywhere.Martin Luther King. To Be or Not To Be,Thats the Question! The Only Stupid Question Is the One that Goes Unasked.

 Thread Tools Display Modes Linear Mode

 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 OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

All times are GMT -4. The time now is 18:35.