CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   kappatWallFunction (http://www.cfd-online.com/Forums/openfoam-solving/82959-kappatwallfunction.html)

Hagen December 9, 2010 20:08

kappatWallFunction
 
Hello,

has anybody experience with the kappatJayatillekeWallFunction? I think the wall function prescribes the Temperature boundary layer with the P-function:

P = 9.24{r3 - r} and
T+ = σT(U+ + P)

I found the relation here:
http://dma.ing.uniroma1.it/Hanjalic/...t-flow-cfd.pdf

But it is still not clear how OpenFOAM exactly predicts the Temperature value at the wall adjacent cell. In my opinion further quantities like the temperature gradient or the wall heat flux are needed.
Furthermore, I don't know how to set up a case with this wall Function. It does not work like for example nutWallFunction is used (boundary patch type).

Thank you for your help

Anne Lincke January 19, 2012 10:39

Hey,

in my opinion the boundary condition for kappa_t models the effect of the thermal law of the wall, using the linear difference quotient for the approximation of the heat flux at the wall, that means:

q = kappa_t (dT/dx) \approx \kappa_t T_p / y_p

From the definition of T+
T+ = [(T_w -T_p) rho c_p u_tau]/ q
we obtain an equation for heat flux q which depends on T+:
q=[(T_w -T_p) rho c_p u_tau] /T+

The thermal law of the wall
T+ = Pr_t ( 1/kappa ln(Ey+) + P)
gives an equation for T+ which can be inserted into the equation for the flux.

With the definition of the flux and the approximation we obtain
q = kappa_t T_p / y_p = [(T_w -T_p) rho c_p u_tau] /T+

and by inserting the logarithmic law of the wall for T+ we obtain an equation for kappa_t which models the effect of the logarithmic law of the wall.

In OpenFOAM the implementation in kappatJayatillekeWallFunction is

kappa_t = nu * (y+ / (Pr_t * (log(Ey+)/kappa + P) - 1/Pr)

When I derive this boundary condition from the equations which I mentioned before I obtain

kappa_t = mu *cp (y+ / (Pr_t * (log(Ey+)/kappa + P) - 1/Pr)

Has anyone made similar experiences?
If you are interested I could also post a more detailed deduction of the boundary condition in order to see where might be the error.

Anne Lincke January 19, 2012 10:41

Quote:

Originally Posted by Hagen (Post 286803)
Furthermore, I don't know how to set up a case with this wall Function. It does not work like for example nutWallFunction is used (boundary patch type).

I think you just use it as boundary condition for kappa_t at the wall.
The wall function for kappa_t is analogous to the wall function for nu_t.
In my opinion it should be possible to use both, nutWallFunction for nut at the wall and JayatillekeWallFunction for kappa_t at the wall.

cm_jubayer February 7, 2012 18:44

Hi Anne,

As you said,

"In OpenFOAM the implementation in kappatJayatillekeWallFunction is

kappa_t = nu * (y+ / (Pr_t * (log(Ey+)/kappa + P) - 1/Pr)

When I derive this boundary condition from the equations which I mentioned before I obtain

kappa_t = mu *cp (y+ / (Pr_t * (log(Ey+)/kappa + P) - 1/Pr)

Has anyone made similar experiences?
If you are interested I could also post a more detailed deduction of the boundary condition in order to see where might be the error.""

Actually there is nothing wrong between the above two equations. In everywhere kappat is actually turbulent thermal conductivity with unit J/kg-K, but in openFoam kappat is something with unit m^2/s (you can look into hot room tutorial to see the unit of kappat). So the real_kaapat = openFoam_kappat*Cp*rho. So if you divide your real_kappat equation (2nd one) with Cp and rho you will get openFoam_kappat equation (1st one)

Now I have a question. What happens to this wall function if I want to use low-Re modelling for heat transfer (y+<1). Law of the wall says, T+ = y+ for y+<11. What happens to this JayatillekeWallFunction for y+<11? Do I have to modify the wall function? Thanks.

Anne Lincke February 9, 2012 09:01

Hey Jubayer,

thank you for the hint with the kappat_t used in OpenFOAM. Now everything makes sense to me.

Quote:

Now I have a question. What happens to this wall function if I want to use low-Re modelling for heat transfer (y+<1). Law of the wall says, T+ = y+ for y+<11. What happens to this JayatillekeWallFunction for y+<11? Do I have to modify the wall function? Thanks.
For thermal simulations you have to compute thermal y+. If thermal y_T+ < y+ then the wall function approach is used.

When yT+>y+ in OpenFOAM/JayatillekeWallFunction kappa_t is set to zero

Code:

if (yPlus > yPlusTherm)
        {
            scalar nu = nuw[faceI];
            scalar kt = nu*(yPlus/(Prt_*(log(E_*yPlus)/kappa_ + P)) - 1/Pr);
            kappatw[faceI] = max(0.0, kt);
        }
        else
        {
            kappatw[faceI] = 0.0;
        }

But I do not yet understand how the thermal y+ is computed. You can find the iteration inside the code


HTML Code:

scalar kappatJayatillekeWallFunctionFvPatchScalarField::yPlusTherm
(
    const scalar P,
    const scalar Prat
) const
{
    scalar ypt = 11.0;

    for (int i=0; i<maxIters_; i++)
    {
        scalar f = ypt - (log(E_*ypt)/kappa_ + P)/Prat;
        scalar df = 1.0 - 1.0/(ypt*kappa_*Prat);
        scalar yptNew = ypt - f/df;

        if (yptNew < VSMALL)
        {
            return 0;
        }
        else if (mag(yptNew - ypt) < tolerance_)
        {
            return yptNew;
        }
        else
        {
            ypt = yptNew;
        }
    }

    return ypt;
}

Regards
Anne

chkath May 22, 2012 04:56

Hi,

can anybody tell me how Anne derived the boundary condition:

kappa_t = mu *cp (y+ / (Pr_t * (log(Ey+)/kappa + P) - 1/Pr)

from the equation:

q = kappa_t T_p / y_p = [(T_w -T_p) rho c_p u_tau] /T+

Thank you for your reply!

Anne Lincke May 22, 2012 06:32

Hey,

actually there was a little mistake, i.e. I derived the equation from

q = kappa_eff T_p / y_p = [(T_w -T_p) rho c_p u_tau] /T+

which is equal to

q= (kappa + kappa_t) T_p / y_p = [(T_w -T_p) rho c_p u_tau] /T+

(I will correct this in my preceding post)

Starting with

(kappa + kappa_t) T_p / y_p = [(T_w -T_p) rho c_p u_tau] /T+

you shift the term kappa T_p/y_p to the right-hand side.

Then you obtain

kappa_t T_p / y_p = [(T_w -T_p) rho c_p u_tau] /(T+) - kappa*T_p/y_p

For u_tau you use the equation u_tau = (y+/y_p) *nu

kappa_t T_p / y_p = [(T_w -T_p) rho c_p y+*nu] /(T+ y_p) - kappa*T_p/y_p

T_w=0 at the wall, setting mu= rho*nu and multiplying with y_p/T_p leads to

kappa_t = (mu c_p y+) /(T+) - kappa

For the Prandtl-number holds Pr= mu*cp/kappa -> kappa= (mu*cp)/Pr

kappa_t = (mu c_p y+) /(T+) - (mu*cp)/Pr

So kappa_t= mu*cp (y+/T+ -1/Pr)

Finally inserting T+ according to the thermal law of the wall

T+= Pr_t * (log(Ey+) /kappa + P)

leads to the final equation for kappa_t

kappa_t= mu *cp (y+ / (Pr_t * (log(Ey+)/kappa + P) - 1/Pr)

If you note more mistakes do not hesitate to inform me :)

chkath May 22, 2012 07:48

Thank you for your reply!

It looks much more clear for me, but I still have questions:

Why is T_w = 0 at the wall?

And you wrote: "multiplying with y_p/T_p leads to:

kappa_t = (mu c_p y+) /(T+) - kappa"

In the equation before you have a minus in front of T_p. Why does this minus vanishes?

will.logie May 24, 2012 07:22

low-Re Buoyant Boussinesq Heat Transfer
 
1 Attachment(s)
I'd like to join the conversation around about here if I may:

Quote:

Originally Posted by cm_jubayer (Post 343231)
Now I have a question. What happens to this wall function if I want to use low-Re modelling for heat transfer (y+<1). Law of the wall says, T+ = y+ for y+<11. What happens to this JayatillekeWallFunction for y+<11? Do I have to modify the wall function?

In my experience (very low-Re Boussinesq), the incompressible turbulent thermal diffusivity approaches zero with decreasing y+, thus removing a need for the currently implemented kappatJayatillekeWallFunction. This does not mean however that some thermal law of wall is not necessary, especially for average to high Prandtl numbers (decreasing ratio of yPlusTherm to yPlus). The wallHeatFlux:
Code:

volScalarField kappaEff("kappaEff", RASModel->nu()/Pr + kappat);

surfaceScalarField heatFlux
(
    Cp * rho * fvc::interpolate(kappaEff) * fvc::snGrad(T)
);

may still tend to be underestimated (unless yPlus << 1); leading to higher laminar convective heat transfer coefficients (and Nusselt numbers) than one might expect (e.g. the attachment shows free convection from horizontal cylinders in water where yPlus<<1). Alas, this results in long simulation times...

I don't know how this low-Re thermal wall function might look (i.e. which modifications one could make to JayatillekeWallFunction) nor if there are other workarounds (e.g. NuFOAM).

Any thoughts on the matter?

Regards,
Will.

Anne Lincke May 30, 2012 06:35

Hey chkath,

Quote:

Originally Posted by chkath (Post 362428)

Why is T_w = 0 at the wall?

This condition is valid when using a homogeneous Dirichlet boundary condition for the temperature at the wall, i.e. the temperature is set to zero, so Tw=0
Quote:

Originally Posted by chkath (Post 362428)
And you wrote: "multiplying with y_p/T_p leads to:

kappa_t = (mu c_p y+) /(T+) - kappa"

In the equation before you have a minus in front of T_p. Why does this minus vanishes?

You are right, this is a mistake (again, I am sorry for this).
The heat flux is defined, according to Fourier's law as

q=- kappa_eff T_p / y_p

Setting this equal to the highRe equation leads to

- kappa_eff T_p / y_p = [(T_w -T_p) rho c_p u_tau] /T+

and this is equal to

kappa_eff T_p / y_p = [(T_p - T_w) rho c_p u_tau] /T+


So the final result remains the same.

Kind Regards
Anne


All times are GMT -4. The time now is 00:31.