2.3.8.  DEFINE_ECFM_SOURCE

2.3.8.1. Description

You can use DEFINE_ECFM_SOURCE to apply a custom source term to the ECFM equation.

2.3.8.2. Usage

DEFINE_ECFM_SOURCE (name, c, t, source, ap)

Argument Type

Description

symbol name

UDF name.

cell_t c

Cell index.

Thread *t

Pointer to cell thread on which the source term is to be applied.

real *source

Pointer to the source term.

real *ap

Pointer to central coefficient.

Function returns

void

There are five arguments to DEFINE_ECFM_SOURCE: name, c, t, source, and ap. You supply name, the name of the UDF. The variables c and t are passed by the ANSYS Fluent solver to your UDF. Your UDF will need to set the values of the terms referenced by the real pointers source and ap to the source term and central coefficient, respectively.

This allows you to set implicit and explicit components of the source term:


Important:  ANSYS Fluent solves for , so you need to set accordingly. Note also that for stability reasons will only be used if it is negative, in which case ANSYS Fluent will add

to the equation source term, and will be added to the central coefficient. In other cases, is ignored and is added to the source term unmodified.


2.3.8.3. Example

This example fixes sigma within the burning zone.

#include "udf.h" 

#define BIG 1.0e+30 

DEFINE_ECFM_SOURCE(sigma_source, c, t, source, ap) 
{
  real s;
  real cpc=C_PREMIXC(c,t);
  real fix_value=100.0*C_LAM_FLAME_SPEED(c,t)*(1.0-cpc)*cpc;

  s = fix_value/C_R(c,t) - C_ECFM_SIGMA(c,t);
  *ap = -(real) BIG;
  *source = BIG*s; 
}

2.3.8.4. Hooking an ECFM Flame Density Area Source UDF to ANSYS Fluent

After the UDF that you have defined using DEFINE_ECFM_SOURCE is interpreted (Interpreting UDFs) or compiled (Compiling UDFs), the name of the argument that you supplied as the first DEFINE macro argument will become visible and selectable in the User-Defined Function Hooks dialog box in ANSYS Fluent. See Hooking DEFINE_ECFM_SOURCE UDFs for details.


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