
[Sponsors] 
November 30, 2011, 15:31 

#21  
Member
pooyan
Join Date: Nov 2011
Posts: 62
Rep Power: 6 
Thanks for your answer. It was so helpful.
To me, it seems that using this kind of wall function is strongly dependent on mesh selection. I guess we should select a mesh for which we can apply log law for the first node. Is that correct?! Besides, I would be happy if you could clarify me on this part of code 00063 { 00064 scalar ypl = 11.0; 00065 00066 for (int i=0; i<10; i++) 00067 { 00068 ypl = log(E*ypl)/kappa; 00069 } 00070 00071 return ypl; Thanks, Quote:


November 30, 2011, 16:11 

#22 
Senior Member
Claus Meister
Join Date: Aug 2009
Location: Wiesbaden, Germany
Posts: 241
Rep Power: 10 
As you can probably see is the this formula just a fixed point formula which is being solved in 10 iteration. Take a pen and paper and compute a couple of steps by using k=0.4 and E=9.8 then you will get the result: 11.89658423819896. That is the value of the laminar sublayer. Further readings can be found in Versteeg, section: wall boundary conditions.
Cheers 

December 1, 2011, 05:28 

#23  
Senior Member
Anne Gerdes
Join Date: Aug 2010
Location: Hamburg
Posts: 168
Rep Power: 8 
Quote:
Like always, when using wall functions, the first grid node is supposed to be in the logarithmic layer, i.e. y+ ~> 30 

December 1, 2011, 05:32 

#24 
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: Stockholm, Sweden
Posts: 366
Rep Power: 13 
You can use the yPlusRAS utility to check your y+ in your simulation. In order to use wall functions, it should be between 30 and 150. if you have less at certain points, make the cells bigger and if you have a higher value, refine cells in that region.
__________________
~roman 

December 15, 2011, 12:20 

#25 
Member
pooyan
Join Date: Nov 2011
Posts: 62
Rep Power: 6 
Thanks.
I guess y+ should be greater than 11.89 (not 30) if we want to use wall function. 

December 15, 2011, 13:36 

#26 
Member
pooyan
Join Date: Nov 2011
Posts: 62
Rep Power: 6 
Hey guys,
Another thing is that even for the cavity simulation in Open Foam Tutorial, I see that yPlus for fixed walls is always less than 11. Do you have any idea how important it is to obtain yPlus greater than 11?! Why even in tutorial, yPlus values for fixed walls are less than 11.89? As you said, OpenFoam uses wall function for yplus>11.89, but it does not perform any wall treatment for yPlus<11.89. This is also another issue. 

December 16, 2011, 04:19 

#27 
Senior Member
Anne Gerdes
Join Date: Aug 2010
Location: Hamburg
Posts: 168
Rep Power: 8 
If y+ is greater than 11.xx you should use wall functions, that means the law of the wall is used for k,omega,epsilon (whatever) and nut.
If y+ is less than 11, the mesh is fine enough to resolve the equations without any wall functions. For simulations without wall functions you need to set the right boundary conditions for k, omega and nut and choose a proper, lowRe turbulence model. 

December 16, 2011, 04:24 

#28  
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: Stockholm, Sweden
Posts: 366
Rep Power: 13 
Quote:
There are different considerations regarding wall functions. Pope (Turbulent Flow, 2000) states that wall functions resolve everything below 30 and that the first grid point should be around 50, whereas Wilcox (Turbulence Modeling for CFD, 2006) states that 10<y+<100 give good results. Since wall functions are there to simplify computations and reduce the computational cost, I would say keeping it at around 50 is not such a bad idea.
__________________
~roman 

December 16, 2011, 04:27 

#29  
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: Stockholm, Sweden
Posts: 366
Rep Power: 13 
Quote:
In the case y+<11 it is usually adopted to the refine the mesh so that y+<1 since then the mesh is fine enough to resolve most of the phenomena in the boundary layer (Pope, Turbulent Flow, 2000). Some turbulence models won't even function without having y+<1 and will crash (this is my own experience with OF)
__________________
~roman 

December 16, 2011, 04:39 

#30  
Senior Member
Anne Gerdes
Join Date: Aug 2010
Location: Hamburg
Posts: 168
Rep Power: 8 
Quote:


December 20, 2011, 17:23 

#31 
Member
pooyan
Join Date: Nov 2011
Posts: 62
Rep Power: 6 
thanks for sharing your comments and experiences.
Guys, I posted a question with a different topic two weeks ago but I have not heard any response for that. I do not know if anyone noticed that or not, so I am posting that here I am trying to change the coefficients of kepsilon model for incompressible cavity flow. I can just change the below values in 'RASProperties': Cmu c1 c2 sigmaEps it seems that sigmak is not defined for incompressible kepsilon model. I know that sigmak for standard kepsilon model is 1. But, I need to edit this number. Does anyone know how I can change sigmak?! Thanks 

December 21, 2011, 03:38 

#32  
Senior Member
Roman Thiele
Join Date: Aug 2009
Location: Stockholm, Sweden
Posts: 366
Rep Power: 13 
Quote:
__________________
~roman 

January 3, 2012, 19:06 

#33 
Member
pooyan
Join Date: Nov 2011
Posts: 62
Rep Power: 6 
I added sigmak in the following format. However, my results for sigamk=0.7 is no different than the one for sigmak=1. I guess pisoFoam solver takes sigmak=1 by default. Also, when I enter some letters as the value for sigmak (sigmak aaaa, I do not see any error in the solution which further indicates sigmak is not defined in pisofoam solver. I also tried sigmaK instead of sigmak, but results were the same.
kEpsilonCoeffs { Cmu 0.09; C1 1.44; C2 1.776; sigmak 0.7; sigmaEps 1.3; } 

January 4, 2012, 02:58 

#34 
Senior Member
Bernhard
Join Date: Sep 2009
Location: Delft
Posts: 790
Rep Power: 14 
As Roman said, you can easily check this in the source code:
src/turbulenceModels/incompressible/RAS/kEpsilon In kEpsilon.C you find how the equations are set up and in kEpsilon.H how the diffusivity for k is defined (DkEff). You can easily update this model to ask for a sigmak: Step 1. Let the model ask for a sigmak, for this you can peek at how this is done with sigmaEps, it will work the same way. Step 2. Update the definition of DkEff, which is straightforward if sigmak is defined. Step 3. Compile this into a library. Good luck! 

January 6, 2012, 15:36 

#35 
Member
pooyan
Join Date: Nov 2011
Posts: 62
Rep Power: 6 
Thanks guys,
I do not have any exprience in making a new library, but I will try to do that. Meanwhile, I have another serious problem with my lid driven cavity Problem. I am using Ras and kepsilon to solve the problem. To calculoate Reynolds stress, I do not if UPrime2mean is reynolds stress or R?! there is a utility called "R" which calculates Reynolds stress at specified time step. if R components are reynolds stress tensor, then what is UPrime2Mean?! Besides, if R is Reynolds stress, do you have any idea how I can get the field averaging of R during code running? FieldAverage function is just used to get field averaging for U and P, How can I edit that for R?! 

January 17, 2012, 17:41 

#36  
Member
pooyan
Join Date: Nov 2011
Posts: 62
Rep Power: 6 
Thanks Bernhard,
I could add that part in a new library. Do you have any idea about my question for Reynolds Stress? Thanks, Pooyan Quote:


April 29, 2012, 16:39 

#37 
Member
pooyan
Join Date: Nov 2011
Posts: 62
Rep Power: 6 
Hi
I am now aware of how nut, epsilon and production are modified for the first grid point when using nutkWallFunction in kepsilon model. But, I also need to know where in the codes, U is modified at the first point. As you know, U at the first grid point should follow the log law equation. Do you know where I can find the equation for modifying U at the first grid point?! Thanks, Pooyan 

May 3, 2012, 03:34 

#38 
Senior Member
Anne Gerdes
Join Date: Aug 2010
Location: Hamburg
Posts: 168
Rep Power: 8 
Hey Pooyan,
I asked myself the same question a while ago. The answer is (in my opinion): There is no extra equation or boundary condition for the velocity at the first grid point which models the log law. But: There is an equation for computing the wall shear stress at the boundary, via the modified nut at the wall. This leads to an equation which contributes to the coefficients of the system of equations which has to be solved. nut * up/ yp= nut/yp * up So the coefficient nut/yp which includes the nut (modeling the log law) contributes to the equation which is solved for getting the values for the velocity at the first grid point. I hope this helps. 

May 3, 2012, 14:03 

#39 
Member
pooyan
Join Date: Nov 2011
Posts: 62
Rep Power: 6 
Thanks Anne
I have also looked through all subroutines and I could not find a place to impose wall behavior for U and I guessed that OpenFoam solves the momentum equation to obtain U at the first grid point which you have also mentioned. But, do we have nut in momentum equation which then can influence the solution for U?!! Also, in epsilonwallfunction we have an equation for modified production which is G[faceCellI] = (nutw[faceI] + nuw[faceI]) *magGradUw[faceI] *Cmu25*sqrt(k[faceCellI]) /(kappa_*y[faceI]); and Uw is given as const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; So, the Uw here represents the first grid point velocity and magGradUw[faceI] represents the normal gradient of Uw. this is why it was important for me to know how the first point velocity is calculated in OpenFoam. even for the normal gradient, I expect that it will be derived based on log law formulation, but I do not know how this parameter is calculated in OpenFoam. 

May 4, 2012, 03:43 

#40  
Senior Member
Anne Gerdes
Join Date: Aug 2010
Location: Hamburg
Posts: 168
Rep Power: 8 
Hey Sam,
Quote:
Quote:


Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
nutWallFunction vs. nutkWallFunction  romant  OpenFOAM Running, Solving & CFD  4  June 16, 2016 12:43 
second order schemes  marine  OpenFOAM  66  October 26, 2014 12:10 
nutWallFunction questions  madad2005  OpenFOAM  9  October 28, 2011 06:36 
A few questions about Spalart Allmaras model and y  seb62  OpenFOAM Running, Solving & CFD  8  January 15, 2011 14:09 
nutWallFunction boundary condition  AirS  OpenFOAM PreProcessing  6  March 3, 2010 08:31 