CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Turbulence models and wall boundary conditions (

Daniele Panara (Panara) February 14, 2005 05:49

Dear all, Which kind of bo
Dear all,

Which kind of boundary conditions should I apply for k and epsilon at the wall when I am using a low Re k-epsilon model?

The same as the high renolds number model?

Henry Weller (Henry) February 14, 2005 05:51

fixedValue of 0 for k and zer
fixedValue of 0 for k and zeroGradient for epsilon although with most low Re models it will work perfectly well with zeroGradient on k.

Kaushik Balakrishnan (Balakrishnan) February 15, 2005 09:56

How can we change the value o
How can we change the value of k at inlet to zero gradient? I choose inlet and k is automatically made fixed value.

Henry Weller (Henry) February 15, 2005 10:00

A zeroGradient inlet conditio
A zeroGradient inlet condition is effectively an upstream extrapolation from inside the domain and is therfore unstable for a convection-dominated property.

Fabian Peng Kärrholm (Kärrholm) February 16, 2005 03:55

From my experience (although
From my experience (although short) from spray calculations in Foam using the Launder Sharma k-epsilon model, choosing k to have a zero gradient on walls, can cause the timestep to become very small (of the order of nanoseconds). If k is set to zero, this behaviour seems to go away.

Hrvoje Jasak (Hjasak) February 16, 2005 09:26

Surely, the original paper wi
Surely, the original paper will tell you what boundary conditions you should use.

lucchini June 20, 2005 09:47

Hi all! I have a question a
Hi all!

I have a question about turbulence models and mesh motion.

Usually the function turbulence->correct() is calculated after the PISO loop.
In the case of a moving mesh, the flux phi is calculated according to:

phi = fvc::interpolate(rho)
*((fvc::interpolate(U) & mesh.Sf()) - mesh.phi());

In the correct() function of the turbulenceModel divU is corrected by:

if (mesh_.moving())
divU += fvc::div(mesh_.phi());

why? Shouldn't be divU -= fvc::div(mesh_.phi());

Could someone explain this?
thanks a lot

henry June 20, 2005 10:12

in phi = fvc::interpolate(r

phi = fvc::interpolate(rho)
*((fvc::interpolate(U) & mesh.Sf()) - mesh.phi());

the - mesh.phi() converts the absolute fluxes obtained from the absolute U into relative fluxes.

if (mesh_.moving())
divU += fvc::div(mesh_.phi());

adds the contribution from the mesh motion to the divergence calculated from the relative fluxes.

ralph January 24, 2006 08:12

Hi FOAMers, I´ve just looked
Hi FOAMers,
I´ve just looked at the implementation of some of the turbulence models for incompressible flows in Open FOAM and there I is one thing I did´t get so far. Maybe someone can help me out.
For the calculation of the Reynoldstensor there´s obviously used the Boussinesq-Approximation, where k is used to avoid a traceless stress tensor: n<sub>t</sub>(u<sub>i</sub>/x<sub>j</sub>+u<sub>j</sub>/x<sub>i</sub>)-2/3kd<sub>ij</sub>.
This is done in the method: turbulenceModel::R().
In the method turbulenceModel::divR(), which calculates the divergence of this part in combination with the laminar part, the correction by 2/3kd<sub>ij</sub> is omitted, which should actually be of the form: -2/3*grad(k).
Is this regular or do I omit a part of the normal stresses (which is added to the pressure-gradient term and falsify the static pressure)?

Thanks in advance,


hjasak January 24, 2006 09:27

Yes, or "well, yes". All you
Yes, or "well, yes". All you need to do is subtrack k from the pressure field and you'll get the static pressure.


ralph January 24, 2006 10:04

Thanks Hrvoje for your quick
Thanks Hrvoje
for your quick reply.
By the way: In turbulenceModel::divR() for incompressible cases, the deviatoric part of grad(U).T() is used (in an explicit manner). Is this done for stabilisation reasons, as the trace of the tensor should be zero anyway (incompressible)?


david_h January 24, 2006 11:40

Ralph, dev(grad(U).T()) is

dev(grad(U).T()) is the second term and the missing divergence term in the Boussinesq approximation as written above. I beleive the reason this is treated explitly is that the term is a cross-coupling term between the different components of the velocity vector. Treating this term implicitly is not possible with a segregated solver.


hjasak January 24, 2006 11:43

The term says div(mu (grad
The term says

div(mu (grad U)^T)

and this can be rewritten as

mu grad (div(U)) + grad mu . grad U

The first one drops off because of the incompressibility constraint but the second one remains. However, after a lot of messing about it turns out that having the original form behaves better than grad mu . grad U and this is why it remains.

Hope this is clear,


ralph January 24, 2006 12:11

Thanks for your answers, I th
Thanks for your answers,
I think that´s clear.
Maybe I expressed myself somewhat imprecise.
My question was about the deviatoric part of (grad U)^T. Why is the the deviatoric part of the tensor and not the "whole" tensor used in the second term of "divR()"?


diego_n July 17, 2006 14:11

First of all I have to say tha
First of all I have to say that being an undergraduated student I am very new with both Foam and CFD.
From literature I found that Launder Sharma model requires a zero value for epsilon at wall.
But trying this boundary Foam produce a singularity error, as expected looking at model.
Is Foam Launder-Sharma model a particular one requiring zerogradient?

chris1980 July 18, 2006 00:34

I assume you want to use a hig
I assume you want to use a high-Re turbulence model which uses wall-functions. Therefore it is necessary to choose appropriate boundary conditions (i.e. zeroGradient for k and epsilon). Please note that wall functions are only valid if the y+ of your boundary cells is in the log-law region!

In the case of low-Re models with special near-wall modelling you have to come up with highly resolved mesh near-wall region.

diego_n July 18, 2006 05:46

I am using Launder-Sharma comp
I am using Launder-Sharma compressible lo-Re model and I have made an highly resolved mesh near wall to obtain an y+ value minor than 1.

christian May 15, 2007 03:53

When I'm using a low-Re model
When I'm using a low-Re model (e.g. LaunderSharma) my case crashes. I can attach the error message if someone is interested. When I instead change the k value of the walls from 0 to 1e-20 it runs fine. Why is this?

Secondly, in FoamX, when setting a wall to "wall" or "wallFunctions" I can see that the k condition changes (fixedValue or zeroGradient). To what file is my choice to run with or without wall function written? I.e. how is the solver being aware of my wall function choice so that it computes the velocity at the first cell according to the wall function or not?

Best regards,
Christian Svensson

dmoroian May 15, 2007 04:33

It is just an intuitive guess:
It is just an intuitive guess:
in the file /constant/turbulenceProperties set:
turbulenceModel laminar;
turbulence on;

So if I am wrong, please correct me!


sradl August 1, 2008 06:01

Hi Foamers, I have a questi
Hi Foamers,

I have a question regarding kEpsilon turbulence model and what it does near walls (the standard wall functions are implemented). Specifically, I'm interested in the production term "G" of k at the wall. In the file wallFunctionsI.H I found (OF-1.5):

G[faceCelli] +=
(nutw[facei] + nuw[facei])

which is a little confusing, as it should be:


(UP and yP is the velocity and the wall-normal distance to the first cell respectively and tau_wall is the wall shear stress)

Has anybody an explanation where the term:


comes from?

All times are GMT -4. The time now is 04:13.