CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Wall Function (https://www.cfd-online.com/Forums/openfoam-solving/82955-wall-function.html)

 Pooven December 9, 2010 16:52

Wall Function

Hi there, this is a really novice question: would one specify the friction acting against the fluid flow in the wall function specification? That is, for some given patch specified in the wall function file, would one specifiy the friction in the 'value' field?

Thank you for taking the time to read this.

 Hagen December 9, 2010 19:56

Hello Pooven,

From what I understand of the Wall function treatment of OpenFOAM (nutWallFunction) the wallShearStress is derived from:

tau_wall = rho * (nu + nut) * mag(grad(U))_w with
nut = nu * ((y+ * k) / ln( E * y+) - 1)

With tau_wall you can then determine the friction coefficient.

I don't know exactly what you mean with wall function file? Could you explain that.

I hope that helps a little,
Hagen

 Pooven December 10, 2010 04:29

Thank you for your reply Hagen. It's much appreciated. By wall function file I was referring to the 0/nut file (for incompressible RAS). This is where the wall function is specified right? So for example for:

movingWall
{
type nutWallFunction;
value uniform 0;
}

Would I specify the friction coefficient in the value field? I've been trying to get more familiar with CFD, but I'm obviouly not doing such a good job; you said that I could determine the friction coefficient from tau_wall but wouldn't I actually need to know what the friction coefficient is before running the simulation?

Thank you once again for lending me some of your time :)

 vkrastev December 10, 2010 05:54

Quote:
 Originally Posted by Pooven (Post 286843) Thank you for your reply Hagen. It's much appreciated. By wall function file I was referring to the 0/nut file (for incompressible RAS). This is where the wall function is specified right? So for example for: movingWall { type nutWallFunction; value uniform 0; } Would I specify the friction coefficient in the value field? I've been trying to get more familiar with CFD, but I'm obviouly not doing such a good job; you said that I could determine the friction coefficient from tau_wall but wouldn't I actually need to know what the friction coefficient is before running the simulation? Thank you once again for lending me some of your time :)
Hi, I see a little bit of confusion here...You are referring to nut as a "friction coefficient", am I right? Well, in the literature the friction coefficient (or, more properly, the skin friction coefficient) is a non-dimensional measure of the wall shear stress. Instead, nut is simply the conventional name given to the eddy viscosity in the RANS turbulence modeling. However, talking about the value of nut in your 0/nut file, this is only an initial value (so, in practice, it's quite arbitrary), because after the first iteration the solver you are using will start to evaluate nut directly from the turbulent quantities or, as in your case, from a simplified wall-function approach.

Hope this helps

Best Regards

V.

 Pooven December 10, 2010 10:14

Hi V, thank you for explaining that. Is there a way to determine the most optimal initial value for nut? I suppose 0 would be okay for all simulations (since the initial value is arbitrary) then?

If I may, I have another two questions: how does one know which of the wall functions to choose? nutWallFunction, nutRoughWallFunction, nutSpalartAllmarasStandardRoughWallFunction, nutSpalartAllmarasStandardWallFunction and nutSpalartAllmarasWallFunction are mentioned in the documentation but I suppose the CFD user would need to know when they are applicable... perhaps there's some resource I could read to better understand how to choose the correct function?

So where would I specify the friction coefficient (or friction force)? My initial approach was to define it in the /0/U file: within the boundaryField sub-dictionary, for the value field of the patch, I'd specify the friction coefficient. Would this be correct?

Thank you again for the assistance.

 vkrastev December 10, 2010 10:54

Quote:
 Originally Posted by Pooven (Post 286901) I suppose 0 would be okay for all simulations (since the initial value is arbitrary) then?
Yes, it would be generally ok.

Quote:
 Originally Posted by Pooven (Post 286901) If I may, I have another two questions: how does one know which of the wall functions to choose? nutWallFunction, nutRoughWallFunction, nutSpalartAllmarasStandardRoughWallFunction, nutSpalartAllmarasStandardWallFunction and nutSpalartAllmarasWallFunction are mentioned in the documentation but I suppose the CFD user would need to know when they are applicable... perhaps there's some resource I could read to better understand how to choose the correct function?
nutWallFunction and nutRoughWallFunction are quite standard stuff (the latter can take into account for wall roughness) and, in general, thay give satisfactory results for most of commonly encountered incompressible flows. The other options you mentioned are more "specialistic" ones, but honestly I cannot give you any advice about them, since I haven't gone into much deeper (none in terms of theoretical background neither in terms of the OF implementation)

Quote:
 Originally Posted by Pooven (Post 286901) So where would I specify the friction coefficient (or friction force)? My initial approach was to define it in the /0/U file: within the boundaryField sub-dictionary, for the value field of the patch, I'd specify the friction coefficient. Would this be correct?
I'm sorry, but still I cannot understand what are you thinking of with "friction coefficient"...Can you explain it more clearly?

V.

 santiagomarquezd December 10, 2010 11:05

Hi, Friction Coefficient is used in Darcy-Weisbach phenomenological equation. This coefficient is not used in law-of-the-wall models because it is completely modeled by them.

Regards.

 Pooven December 10, 2010 11:06

Hi again V :)

You've been extremely helpful, thank you! I'm trying to model air flow at the boundary level and I'm a bit unsure as to where I'd model the friction effect caused by the ground. I estimate the friction velocity from the logarithmic velocity profile and I'm wondering if it would be okay to specify this in the /0/U file?

 vkrastev December 10, 2010 11:24

Quote:
 Originally Posted by Pooven (Post 286909) Hi again V :) You've been extremely helpful, thank you! I'm trying to model air flow at the boundary level and I'm a bit unsure as to where I'd model the friction effect caused by the ground. I estimate the friction velocity from the logarithmic velocity profile and I'm wondering if it would be okay to specify this in the /0/U file?
Ok, so if I understand you properly you want to model airflow over solid ground, am I right? If it so, than you have two options: 1) to use a High-Re turbulence model (such as, for instance, the standard k-epsilon one) with wall functions for k, epsilon (or omega) and nut; 2) to resolve directly the boundary layer with a low-Re turbulence model (such as the Launder-Sharma k-epsilon), without any additional wall modeling. In both cases, as Santiago said up above, you don't need to specify any friciton coefficient as a bc (the proper condition for U is simply a no slip condition at the solid wall). About the case 1), what kind of wall function is more suitable to your case depends from what do you want to model (is the wall rough? at what level of detail do you want to model this eventual roughness? and so on...). Of course, wichever the case, you must specify the correct value for the kinematic viscosity in the /constant/transportProperties dictionary.

Regards

V.

 Pooven December 13, 2010 06:23

Thanks for taking the time to reply. It took me a while to understand, but I think it finally makes sense... the friction would depend on the fluid speed anyway so it would change as the iterations progress...

Yes you are correct V, I want to model the airflow over solid ground. For both options (thank you for that again), how would I then take into account the land cover? I mean, it would change from area to area and that would have a bearing on the friction right?

Also, I only have a wind speed reading at 1 point, so I initialize U by filling the mesh with that 1 wind speed reading - would this be okay?

 vkrastev December 13, 2010 09:54

Quote:
 Originally Posted by Pooven (Post 287194) For both options (thank you for that again), how would I then take into account the land cover? I mean, it would change from area to area and that would have a bearing on the friction right?
In the first case, if you want to use a roughWallFunction than you have to define properly the roughness parameter of your "landscape": since I have no practical experience with this kind of approach, I advice you to have a look here http://www.cfd-online.com/Forums/ope...ocumented.html and in other similar treads in the forum.
In the second case you MUST define the ground surface very carefully and then use a very fine surface-fitted grid (first node away from the wall at a non-dimensional distance y+ of about 1) to solve the boundary layer properly: in this case, with a sufficiently accurate geometry and grid definition, the solver will do all the "hard work" (but, of course, at a very high computational cost) and there will be no need to use a simplified modeling approach (such as the roughWallFunction approach).

Quote:
 Originally Posted by Pooven (Post 287194) Also, I only have a wind speed reading at 1 point, so I initialize U by filling the mesh with that 1 wind speed reading - would this be okay?
What do you mean with "at 1 point"? If you have some data about the mean direction and intensity of the wind at a given altitude, a kind of approach could be an extrapolation of the approximate free-stream velocity and the imposition of this velocity (in intensity and direction) as your "inlet" condition. But, however, I have to admit that my experience with atmospheric boundary layers is not so extended, so maybe you could ask someone else here in the forum for much detailed hints

Hope this helps

V.

 Pooven December 14, 2010 06:25

Thank you V, you've been a tremendous help :) Outstanding really. Things make much more sense now! Thank you all.

 rob3rt 0ng February 10, 2011 02:42

Hi All,

I am wondering what is the range of values for Reynolds number to be considered low or high turbulent from this formula, turbulent Re = (rho*k^2)/(epsilon*mu)?

Also, why can't I use wall functions if I use RAS/KE Launder-Sharma? so far I've set of all my walls (bottom, outer, top, and wall) conditions as zeroGradient but getting rather a not very good result.

Your feedback will be very appreciated.

Thanks and regards,
Robert

 vkrastev February 10, 2011 06:44

Quote:
 Originally Posted by rob3rt 0ng (Post 294579) Hi All, I am wondering what is the range of values for Reynolds number to be considered low or high turbulent from this formula, turbulent Re = (rho*k^2)/(epsilon*mu)?

Since for a given flow k and epsilon assume different values in space and time, this formula can return only local informations about the turbulence level of the flow itself (which means that you can have a relatively low global Reynolds number but with locally high levels of turbulence somewhere in your domain). However, about the distinction between High and Low-Re turbulence models, Low-Re simply means that the model can be consistently integrated in regions where the local level of turbulence (and thus the local turbulent Reynolds number) is "damped" by viscous and/or wall-blocking effects (i. e. very close to a solid wall). On the other hand, High-Re models are usually derivated assuming fully developed turbulent flows (flows with high levels of local turbulence), which render them not reliable in Low-Re regions of the flow.

Quote:
 Originally Posted by rob3rt 0ng (Post 294579) Also, why can't I use wall functions if I use RAS/KE Launder-Sharma? so far I've set of all my walls (bottom, outer, top, and wall) conditions as zeroGradient but getting rather a not very good result.
The Launder-Sharma model is a modified k-epsilon model, with some ad-hoc corrections for the integration through the viscous sublayer. To use it properly, a sufficently fine grid must be employed near the walls (y+<1) and adequate boundary conditions must be set at the walls themselves. In particular, with the OpenFOAM implementation of the model you have to set:

-Very low (fixed) values for k and epsilon (something like 10^-10 should be appropriate)
- No slip condition for the velocity field [fixedValue (0 0 0)]

Hope this helps

V.

 rob3rt 0ng February 11, 2011 06:56

Hi Vesselin,

Is there a way to check yPlus values with low Re Launder Sharma model? although there is a code available in here http://www.cfd-online.com/Forums/ope...us-values.html
And since I should be more concerned with the distance normal to the wall, does that mean I should only consider the top wall yPlus average value?

Also, I've got a slightly modified energy equation to the laminar one. I added the turbulent kinetic equation ((mu*(gradU + gradU.T()) && gradU)/(rho0*Cp0)) and rate of dissipation (turbulence->epsilon()/Cp0) on the RHS of the TEqn.H and I left the pEqn.H and UEqn.H as they were for the laminar case from porousSimpleFoam. Do they look right to you?

Thanks once again and with regards,
Robert

 jiez August 19, 2011 00:07

nutWallFunction in OpenFOAM

Hi Hagen,

Do you have any idea about where the following nut equation for wall treatment (nutWallFunction in OpenFOAM) comes from? I mean which paper.
nut = nu * ((y+ * k) / ln( E * y+) - 1)

Thanks,

Jie

 jiez August 19, 2011 00:07

Hi Jie,

You will find a good summary in Int.J. of Heat and Fluid flow 23 (2002) 148-160. (Craft, Gerasimov, Launder, Iacovides)
I think you will need the following relation in order to derive the OpenFOAM wall function:
tau_w = rho (nu + nut) gradU
I hope this will help a little bit.

Good luck,
Hagen

 jiez August 19, 2011 00:08

Thanks Hagen, Progress in the generalization of wall-function treatments is a helpful paper.

However, from that paper, nut near wall is calculated as nut = nu * Cmu * Ct * (yPlus - yPL) (if yPlus > yPL )
where Cmu=0.09, Ct=2.55, yPL=10.8

It is quite different from the expression
nut = nu * ((yPlus * k) / ln( E * yPlus) - 1) (if yPlus > yPL)
where k=0.41, E=9.8

Thanks very much,

Jie

 jiez August 19, 2011 00:08

Hi Jie,

thanks for your response. The formulation for nut you refer to is used for the new wall function approach, which is introduced in this paper. Forget about this part. OpenFOAM does not use this generalized wall function. However, this paper provides a good overview over the conventional wall function approach in the first and second section.
It has been a while since I derived this myself but I think you can the derive the OpenFOAM wall function from the expression for tau_wall in the paper.

Good luck,
Hagen

 jiez August 19, 2011 00:12

Hi All,

If anyone has useful information about the new wall treatment used in OpenFOAM 1.7.x and later version for nut (i.e nutWallFunction), please post here.

Jie

All times are GMT -4. The time now is 08:07.