You can use DEFINE_ECFM_SOURCE to apply
a custom source term to the ECFM equation.
DEFINE_ECFM_SOURCE (name, c, t, source, ap)
|
Argument Type |
Description |
|---|---|
|
|
UDF name. |
|
|
Cell index. |
|
|
Pointer to cell thread on which the source term is to be applied. |
|
|
Pointer to the source term. |
|
|
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.
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;
}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.