You can use DEFINE_ECFM_SPARK_SOURCE to apply a custom source term to the ECFM equation within the volume
of the spark ignition kernel.
DEFINE_ECFM_SPARK_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_SPARK_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 , therefore
you need to set the source 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
the source is added to the
source term unmodified.
This example fixes the value of within the spark kernel
volume to a set value.
#include "udf.h"
#define BIG 1.0e+30
DEFINE_ECFM_SPARK_SOURCE(sigma_spark_source, c, t, source, ap)
{
real s;
real fix_value=20.0; /* desired value of sigma */
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_SPARK_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 Set Spark Ignition dialog box in ANSYS Fluent. See Hooking DEFINE_ECFM_SPARK_SOURCE UDFs for details.