Standard Wall Function Code Fluent
Standard Wall Function Code Fluent
#include "udf.h"
#include "mem.h"
// Constants
#define CMU 0.09
#define KARMAN 0.4187
#define E 9.793
#define DENSITY 998.2
#define MU 1.003e-3
// Main program
DEFINE_WALL_FUNCTIONS(std_wf, f, t, c0, t0, wf_ret, yPlus, Emod)
{
real wf_value;
Domain *d;
d = Get_Domain(1);
int wall_id = 11;
Thread *t_wall;
Thread *t_adj;
cell_t c_adj;
switch (wf_ret)
{
case UPLUS_LAM:
wf_value = y_star;
break;
case UPLUS_TRB:
wf_value = log(E*y_star)/KARMAN;
break;
case DUPLUS_LAM:
wf_value = 1.0;
break;
case DUPLUS_TRB:
wf_value = 1./(KARMAN*y_star);
break;
case D2UPLUS_TRB:
wf_value = -1./(KARMAN*y_star*y_star);
break;
default:
printf("Wall function return value unavailable\n");
}
return wf_value;
}