[Fluent Inc. Logo] return to home search
next up previous contents index



You can use DEFINE_WALL_FUNCTIONS to provide custom wall functions for applications when you want to replace the standard wall functions in FLUENT. Note that this is available only for use with the $k$- $\epsilon$ turbulence models.


DEFINE_WALL_FUNCTIONS( name, f, t, c0, t0, wf_ret, yPlus, Emod)

Argument Type Description
symbol name UDF name.
face_t f face index.
Thread *t pointer to cell thread
cell_t c0 cell index.
Thread *t0 pointer to face thread.
int wf_ret wall function index
real yPlus y+ value
real Emod wall function E constant
Function returns  

There are eight arguments to DEFINE_WALL_FUNCTIONS: name, f, t, c0, t0, wf_ret, yPlus, and Emod. You supply name, the name of the UDF. f, t, c0, t0, wf_ret, yPlus, and Emod are variables that are passed by the FLUENT solver to your UDF. Your UDF will need to compute the real value of the wall functions U+, dU+, and dY+ for laminar and turbulent regions and return them to the solver.


The following UDF, named user_log_law, computes U+ and dU+, and dY+ for laminar and turbulent regions using DEFINE_WALL_FUNCTIONS. The source code can be interpreted or compiled in FLUENT.

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

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

  switch (wf_ret)
    case UPLUS_LAM:
      wf_value = yPlus;
    case UPLUS_TRB:
      wf_value = log(Emod*yPlus)/KAPPA;
    case DUPLUS_LAM:
      wf_value = 1.0;
    case DUPLUS_TRB:
      wf_value = 1./(KAPPA*yPlus);
    case D2UPLUS_TRB:
      wf_value = -1./(KAPPA*yPlus*yPlus);
	printf("Wall function return value unavailable\n");
  return wf_value;

Hooking a Wall Function UDF to FLUENT

After the UDF that you have defined using DEFINE_WALL_FUNCTIONS is interpreted (Chapter  4) or compiled (Chapter  5), the name of the argument that you supplied as the first DEFINE macro argument (e.g., user_log_law) will become visible and selectable in the Viscous Model panel in FLUENT. See Section  6.2.23 for details.

next up previous contents index Previous: 2.3.22 DEFINE_VR_RATE
Up: 2.3 Model-Specific DEFINE Macros
Next: 2.4 Multiphase DEFINE Macros
© Fluent Inc. 2006-09-13