
[Sponsors] 
September 17, 2010, 07:54 
Problems with YPlusRAS and wallShearStress

#1 
New Member
Peter
Join Date: Aug 2010
Posts: 16
Rep Power: 8 
Dear Foamers,
I am simulating a simple compressible channel flow, using the rhoSimpleFoam solver and the kOmegaSST turbulence model. For postprocessing, I'd like to compute YPlus to validate my grid and the wall shear stress. The Reynoldsnumber is about 18000. Also, I calculated Tau_wall and YPlus using correlations to validate my results. For YPlus at the wall: I used the Blasiuscorrelation 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 Blasiuscorrelation 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.cfdonline.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 

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:
Regards, Francois. 

October 4, 2010, 06:45 

#3 
New Member
Peter
Join Date: Aug 2010
Posts: 16
Rep Power: 8 
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 

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?


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 
Thank you very much Niklas for your kind answer.
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 Reading field U Reading/calculating face flux field phi 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. 

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: 8 
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: 8 
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.75e05) Thanks, José 

March 11, 2011, 10:06 

#12 
New Member
Andreas Schwärzle
Join Date: Sep 2010
Posts: 6
Rep Power: 8 
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 lowRe 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: 8 
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 lowRe mesh. Note that its only for incompressible flow. (which I was calculating then, so my problem was solved this way) http://www.cfdonline.com/Forums/ope...s171a.html /Andreas 

March 15, 2011, 10:27 

#14 
Member
José
Join Date: Jan 2011
Posts: 73
Rep Power: 8 
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.75e5). 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 9e6 and 1.3e05. 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 FLUENTformat, 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: 8 
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.33016e05 daverage: 5.25961e06 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 9e06 (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:
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] * mag(U.boundaryField()[patchi].snGrad()) / 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: 14 
Quote:
See util /postProcessing/wall/ You may also want to read: http://www.cfdonline.com/Forums/ope...bendpipe.html Quote:


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,210
Rep Power: 19 
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  

