2.3.15.  DEFINE_GRAY_BAND_ABS_COEFF

2.3.15.1. Description

You can use DEFINE_GRAY_BAND_ABS_COEFF to specify a UDF for the gray band absorption coefficient as a function of temperature, that can be used with a non-gray discrete ordinates model.

2.3.15.2. Usage

DEFINE_GRAY_BAND_ABS_COEFF (name, c, t, nb)

Argument Type

Description

symbol name

UDF name.

cell_t c

Cell index.

Thread *t

Pointer to cell thread.

int nb

Band number associated with non-gray model.

Function returns

real

There are four arguments to DEFINE_GRAY_BAND_ABS_COEFF: name, c, t, and nb. You supply name, the name of the UDF. The variables c, t, and nb are passed by the ANSYS Fluent solver to your UDF. Your UDF will need to return the real value of the gray band coefficient to the solver.

2.3.15.3. Example

The following UDF, named user_gray_band_abs, specifies the gray-band absorption coefficient as a function of temperature that can be used for a non-gray discrete ordinates model.

#include "udf.h"
 
 DEFINE_GRAY_BAND_ABS_COEFF(user_gray_band_abs,c,t,nb)
 {
   real abs_coeff = 0;
   real T = C_T(c,t);

    switch (nb)
    {
      case 0 : abs_coeff = 1.3+0.001*T; break;
      case 1 : abs_coeff = 2.7 + 0.005*T; break;
     }
 
 return abs_coeff;
 
 } 

2.3.15.4. Hooking a Gray Band Coefficient UDF to ANSYS Fluent

After the UDF that you have defined using DEFINE_GRAY_BAND_ABS_COEFF is interpreted (Interpreting UDFs) or compiled (Compiling UDFs), the name of the argument that you supplied as the first DEFINE macro argument (for example, user_gray_band_abs) will become visible and selectable in the Create/Edit Materials dialog box for the Absorption Coefficient.

See Hooking DEFINE_GRAY_BAND_ABS_COEFF UDFs for details.


Release 18.2 - © ANSYS, Inc. All rights reserved.