CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   Udf DEFINE_WALL_FUNCTION (https://www.cfd-online.com/Forums/fluent-udf/92542-udf-define_wall_function.html)

 roman10 September 17, 2011 03:31

Udf DEFINE_WALL_FUNCTION

Good morning to everyone

I have a problem with Fluent udf Macro DEFINE_WALL_FUNCTION

I have to write a wall law where u* = ln(E y*)/VKC + Const y*

I expect (from Fluent user guide) that the values at the near wall cell of wall shear stress, production of turbulent kinetic energy and turbulent dissipation rate are computed in this way (if the computational node is in the fully turbulent region)

tau wall = rho U// uk / f(y*)

Pk = tau wall^2 / mu * du*/dy*

Eps = uk^3 / (VKC * Wall distance)

Unfortunately I noticed that the expressions for tau wall and Pk are correct, but epsilon is not computed in the way shown above. Moreover, the difference between the value extracted by Fluent and the values computed with this expression are not random, but have a trend similar to epsilon profile

Any idea about why it happens?

This is the udf I use

/************************************************** ****************
User-defined wall functions: separated into turbulent and
laminar regimes
/************************************************** ***************/
#include "udf.h"

#define VKC 0.4187

DEFINE_WALL_FUNCTIONS(swf_impl, f, t, c0, t0, wf_ret, yPlus, Emod)
{
real wf_value;

switch (wf_ret)
{
case UPLUS_LAM:

wf_value = yPlus;

break;

case UPLUS_TRB:

wf_value = log(Emod*yPlus)/(VKC) + 0.001*yPlus;

break;

case DUPLUS_LAM:

wf_value = 1.0;

break;

case DUPLUS_TRB:

wf_value = 1./(VKC*yPlus) +0.001;

break;

case D2UPLUS_TRB:

wf_value = -1./(VKC*yPlus*yPlus);

break;

default:

printf("Wall function return value unavailable\n");

}

return wf_value;

}

Another problem is that I don't know what d2uplus is used for