CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   nutWallFunction (https://www.cfd-online.com/Forums/openfoam/86157-nutwallfunction.html)

sam1364 May 17, 2012 14:41

kqRWallFunction
 
Hi,

I have a quick question. Do you know what kqRWallFunction is doing in OpenFoam?! It seems that this wall function imposes zero gradient boundary condition for the first grid point turbulent kinetic energy but when I am checking my k values for the first and second nodes, they are not equal.

Thanks,

Anne Lincke May 21, 2012 10:53

Hey Sam,

Normally the wall boundary condition kqRWallFunction should impose a zeroGradient boundary condition for k.

This means that the gradient is equal to zero -> the value for k at the boundary is equal to the value for k at the first cell.

Did you compare the boundary value and the value at the first cell?

It should be the same....maybe you compared at the nodes which is different due to interpolation....

Best,
Anne

sam1364 May 22, 2012 11:41

hi Anne,

thanks for your reply. you are correct. But, then for the calculation of nut in nutkwallfunction, i see that we need the value of K at the first grid point. I do not understand what value OpenFoam is using for turbulent kinetic energy at the first grid point. Since we do not solve equations for the first grid point, k value for the first grid point should come from another place.

Another thing which is unclear for me is the value of nut at the first grid point. I am expecting this value to come from the log law modification (nut=nu(ky/ln(Ey+)-1)), but when I check my data for the first grid point, I see that it is coming from (nut=cmu*k^2/epsilon).

So, I think based on my understanding, the boundary is where the log law modification is applied not the first grid point. So, actually, we solve the equations for the first grid point. Am I right?!!


thanks,
pooyan

sam1364 May 22, 2012 11:45

Anne,

I have another quick question. How can I get the values at the boundary. when I go to paraview, I can export my data at the cell centers, but that data do not include values at the boundary. they just include values at the first grid point and the second grid point.

sam1364 July 11, 2012 17:11

Hi Roman

I have a quesion about nutkwallFunction. When I checked a solution using k-epsilon wall function and nutkWallfunction, I noticed that the values for nut at the first grid point is actually equal to cmu*k^2/epsilon and the valu at the boundary is coming from log law. So, why do we need a value fo nut at the boundary since we are not solving any equation for nut?!

Quote:

Originally Posted by romant (Post 333755)
the boundary condition nutkWallFunction sets the turbulent viscosity in the first node point based on the logarithmic law of the wall http://en.wikipedia.org/wiki/Law_of_the_wall . the difference between the nutUWallFunction and the nutkWallFunction lies in the way yPlus is calculated (in the first case based on the velocity close to the wall and in the latter case based on the turbulent kinetic energy close to the wall)


sam1364 July 17, 2012 11:17

Hi Anne,

you discussed about the wall shear stress at the wall which contains the modified nut at the wall and that affects the solution for momentum equation.
Can you please tell me how I can find the equation for wall shear stress at the boundary?! (i.e. nut*up/yp?!)




Quote:

Originally Posted by Anne Lincke (Post 359022)
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.


Anne Lincke July 17, 2012 11:36

Hey Pooyan,

when solving the Navier-Stokes Equations at the wall, convective terms vanish
\int d/dx_j (u_i (P) u_j (P)) = \oint u_i(P) u_j(F) (Gauß) which is zero as u_j(F), the value of u_j at the boundary face is zero.

The pressure gradient is also zero, as it has the boundary condtion zeroGradient.

The remaining term is the diffusive term

\int nut d/dx_j d/dx_j u_i(P) = \oint nut d_x_j u_i (F) \approx nut FaceArea* u(P)/yp

This is the wall shear stress at the wall.

Sorry for the bad notation, but I would like to point out the basic idea. The wall shear stress is the remaining term when solving the Navier-Stokes-Equations at the boundary. So the modified nut affects the solution.

Hope this helps... you won't find it directly in the code, the nut will appear as a matrix coefficient in the equation system.

Kind Regards
Anne

sam1364 July 17, 2012 12:46

Thanks a lot for your reply.

that makes sense, but I have a question. Do we solve the N.S equations at the boundary?!!
I guess we solve N.S equation for the first grid point and that is where nu_eff is coming into account. right?!!
Or the boundary for momentum equation at the wall can be the flux coming from the wall and that is the total shear force which is equal to nu_eff*du/dy?!

which of the above statements are true?!!


Quote:

Originally Posted by Anne Lincke (Post 371926)
Hey Pooyan,

when solving the Navier-Stokes Equations at the wall, convective terms vanish
\int d/dx_j (u_i (P) u_j (P)) = \oint u_i(P) u_j(F) (Gauß) which is zero as u_j(F), the value of u_j at the boundary face is zero.

The pressure gradient is also zero, as it has the boundary condtion zeroGradient.

The remaining term is the diffusive term

\int nut d/dx_j d/dx_j u_i(P) = \oint nut d_x_j u_i (F) \approx nut FaceArea* u(P)/yp

This is the wall shear stress at the wall.

Sorry for the bad notation, but I would like to point out the basic idea. The wall shear stress is the remaining term when solving the Navier-Stokes-Equations at the boundary. So the modified nut affects the solution.

Hope this helps... you won't find it directly in the code, the nut will appear as a matrix coefficient in the equation system.

Kind Regards
Anne


romant July 23, 2012 10:13

Quote:

Originally Posted by sam1364 (Post 370922)
Hi Roman

I have a quesion about nutkwallFunction. When I checked a solution using k-epsilon wall function and nutkWallfunction, I noticed that the values for nut at the first grid point is actually equal to cmu*k^2/epsilon and the valu at the boundary is coming from log law. So, why do we need a value fo nut at the boundary since we are not solving any equation for nut?!


The reason comes from the way OpenFOAM is programmed. Every boundary condition needs to have a value specified, due to the fact that all boundaries inherit a certain basic functionality from a basic boundary (Inheritance in C++).

alirezaj March 6, 2013 05:39

Quote:

Originally Posted by romant (Post 333785)
I changed it on the wiki page, it should be OK now

Hi Roman,
regarding to standard wall function derivation here http://www.cfd-online.com/Wiki/Two_e...wall_functions
based on which assumption can you derive "compact version of log law" (equation 1).
I found out that the complet form of this equation is:
u_p /u* = (1/kappa) ln(E yplus/1+C_s kplus_s)
where kplus_s=u*k_s/nu and k_s is sand grain roughnness.
equation 1 can be true only for very smooth wall where C_s kplus_s can be ignored.
Is it right?

romant March 6, 2013 05:53

Hej,

I didn't write the article, but only modified a mistake in the article. However, I think your conclusion is right. Many time, you assume smooth walls in CFD, and this way the grain size (roughness) does not play a role.

alirezaj March 6, 2013 06:18

Ok.. It seems really dangerous to use the wall functions when u dont know what exactly happens inside them!

romant March 6, 2013 06:19

There is special wall functions for rough walls, therefore this is not a problem.

alirezaj March 6, 2013 07:45

Roman,
You are right. For rough wall I can find "nutKAtmRoughWallFunction" where the core equation is:
nu_t= nu[(yplus*kappa/ln((y+y_0)/y_0))-1]
1)This equation can be true for all walls (smooth as well as rough). but I dont understand why the title of this wall function is "nutKAtmRoughWallFunction"

2) there is an If loop inside the code. before applying the equation above, the code verifies that (y+y_0)/y_0> 10^-4. It implies that y must be y>10^-4 *y_0 .It does not seem logical to me. Do you have any idea about this condtion?

romant March 6, 2013 07:49

Sorry, I don't think I can help you there, I haven't really looked into that wall function. Maybe somebody else knows what to do there.

alirezaj March 6, 2013 10:05

Just for correction sake, if some body else needs:
I made a mistake in writting. the correct condition is: (y+y_0)/y_0>1+10^-4. It implies that y must be y>10^-4 *y_0

romant August 15, 2013 05:20

Quote:

Originally Posted by romant (Post 373005)
The reason comes from the way OpenFOAM is programmed. Every boundary condition needs to have a value specified, due to the fact that all boundaries inherit a certain basic functionality from a basic boundary (Inheritance in C++).

I think I made a mistake in the answer of this question, however, I can't change the answer anymore. So I looked into this again. nut is defined on the wall and not in the first grid point, is because the force created from the wall shear stress is a wall force and should enter the equation in that location, the wall (Versteeg, p 277).

kimyusik November 28, 2014 09:20

Quote:

Originally Posted by Anne Lincke (Post 329857)
Hey Kurne,

I am investigating about the nutWallFunction and I do not really understand the formula used in OpenFOAM in nutWallFunction which reads

nutw[faceI] = nuw[faceI]*(yPlus*kappa_/log(E_*yPlus) - 1.0);

Can you please explain your findings? I found this question in some threads so I think me and other users will be very grateful.

Thank you in advance.

Dear Anne

I spent some times to come up with the equation,

nutw[faceI] = nuw[faceI]*(yPlus*kappa_/log(E_*yPlus) - 1.0);

in 'nutUWallFunctionFvPatchScalarField.C' and many of the replies in this forum is not directly related to your question. So I share the reference paper & book I have referred,

Eq. 4 in Kalitzin et al. 2005,Near-wall behavior of RANS turbulence models
and implications for wall functions (http://www.sciencedirect.com/science...21999104004164)

and Eq. 3.21 in VERSTEEG and MALALASEKERA, An introduction to computational fluid dynamics (http://ekaoktariyantonugroho.files.w...s-versteeg.pdf).

Using these two equations, I could derive the equation in OF.

Good luck!

Anne Lincke December 1, 2014 04:58

Dear Yusik,

thank you for your answer. Meanwhile, I could derive the equation by myself or rather with the help of the literature that you were also recommending.

Helpful is also this link

http://www.cfd-online.com/Wiki/Two_e...wall_functions

Best Wishes,

Anne

EnricoA March 12, 2015 15:40

Quote:

Originally Posted by romant (Post 333770)
Hej,

I just found how this is derived and calculated it myself, http://www.cfd-online.com/Wiki/Two_e...wall_functions

if you see how the rho is eliminated, maybe you can post it here.

solution to eliminate rho:
Code:

(mut+mu)Up/yP = (rho y uTau kappa )/(log(yPlus E))
=1/rho (mut+mu)Up/yP = ( y uTau kappa )/(log(yPlus E))
= (nut+nu)Up/yP = ( y uTau kappa )/(log(yPlus E))

and then from there by using the definition of yPlus, one obtains equation (2)


Hello romant,

I wanted to ask you why the velocity derivative used to compute the wall shear stress is approximated with a linear function, when the velocity distribution is known to be logaritmic. Don't you think that this lowers too much the accuracy of the simulation?

Regards,
Enrico


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