2.3.49.  DEFINE_WSGGM_ABS_COEFF

2.3.49.1. Description

You can use DEFINE_WSGGM_ABS_COEFF to customize the absorption coefficient computed using the domain-based weighted-sum-of-gray-gases model (WSGGM) model, by either replacing the internally calculated value or by modifying the value computed by ANSYS Fluent. During the execution, a DEFINE_WSGGM_ABS_COEFF function is called by ANSYS Fluent for each fluid zone and also for each band (in the case of the non-gray discrete ordinates radiation model or the non-gray P-1 radiation model). If the soot model is enabled, DEFINE_WSGGM_ABS_COEFF can also be used to modify the soot absorption coefficient computed by ANSYS Fluent. See Radiation in Combusting Flows in the Theory Guide for further information about how composition-dependent absorption coefficients are calculated.

2.3.49.2. Usage

DEFINE_WSGGM_ABS_COEFF (name, c, t, xi, p_t, s, soot_conc, Tcell, nb, ab_wsggm, ab_soot)

Argument Type

Description

symbol name

UDF name.

cell_t c

Cell index.

Thread *t

Pointer to cell thread on which the WSGGM absorption coefficient function is to be applied.

real xi[]

Array containing species mole fractions.

real p_t

Total pressure.

real s

Beam length based on domain size.

real soot_conc

Concentration of the soot (if the soot model is enabled).

real Tcell

Temperature of the cell.

int nb

Band number (nb=0 for gray model).

real *ab_wsggm

Absorption coefficient computed by the WSGGM in ANSYS Fluent.

real *ab_soot

Absorption coefficient computed by the soot model in ANSYS Fluent.

Function returns

void

There are eleven arguments to DEFINE_WSGGM_ABS_COEFF: name, c, t, xi, p_t, s, soot_conc, Tcell, nb, ab_wsggm, and ab_soot. You supply name, the name of the UDF. c, t, xi, p_t, s, soot_conc, Tcell, nb, ab_wsggm, and ab_soot are variables that are passed by the ANSYS Fluent solver to your UDF.

2.3.49.3. Example

The following UDF, named user_wsggm_abs_coeff, replaces the WSGGM and soot absorption coefficients so that they are no longer the value calculated internally by ANSYS Fluent. While DEFINE_WSGGM_ABS_COEFF UDFs can be interpreted or compiled in ANSYS Fluent, the following example can only be compiled.

include "udf.h"
#include "materials.h"

DEFINE_WSGGM_ABS_COEFF(user_wsggm_abs_coeff, c, t, xi, p_t, s, soot_conc, Tcell, nb, ab_wsggm, ab_soot)
{
  Material *m = THREAD_MATERIAL(t);
  int ico2 = mixture_specie_index(m, "co2");
  int ih2o = mixture_specie_index(m, "h2o");
  real CO2_molf, H2O_molf;
  real k2, k3, k4;


  CO2_molf= xi[ico2];
  H2O_molf= xi[ih2o];
  

        switch (nb)
          {
           case 0 :  /*  First gray gas*/
             {
               *ab_wsggm = 0;
             }
             break;

           case 1 :  /*  Second gray gas*/
             {
               k2   = 0.1;
               *ab_wsggm = (k2 * (H2O_molf + CO2_molf)) * p_t;
             }
             break;

           case 2 :  /*  Third gray gas*/
             {
               k3   =  7.1;
               *ab_wsggm = (k3 * (H2O_molf + CO2_molf)) * p_t;
             }
             break;

           case 3 :  /*  Fourth gray gas*/
             {
               k4   =  60.0; 
               *ab_wsggm = (k4 * (H2O_molf + CO2_molf)) * p_t;
             }
          }

       *ab_soot =  0.1;
}

2.3.49.4. Hooking a Wall Function UDF to ANSYS Fluent

After the UDF that you have defined using DEFINE_WSGGM_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_wsggm_abs_coeff) will become visible and selectable in the Create/Edit Materials dialog box in ANSYS Fluent. See Hooking DEFINE_WSGGM_ABS_COEFF UDFs for details.


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