[ANSYS, Inc. Logo] return to home search
next up previous contents index

2.3.10 DEFINE_IGNITE_SOURCE



Description


You can use DEFINE_IGNITE_SOURCE to customize the ignition time source term in the autoignition model model.



Usage



DEFINE_IGNITE_SOURCE( name, c, t, source)


Argument Type Description
symbol name UDF name
cell_t c Cell index
Thread *t Pointer to cell thread on which the ignition
  source term is to be applied
real *source Pointer to the ignition source term
   
Function returns  
void  
   

There are four arguments to DEFINE_IGNITE_SOURCE: name, c, t, and source. You supply name, the name of the UDF. c, t and source are variables that are passed by the ANSYS FLUENT solver to your UDF. Your UDF will need to set the value referenced by the source pointer as shown in the example below.



Example


The following UDF, named ign_udf_src, specifies a custom source term in the ignition model. The source code must be executed as a compiled UDF in ANSYS FLUENT.

In the standard ignition model in ANSYS FLUENT, the source term for the ignition progress variable is given by a Livengood-Wu integral  [ 7]:

 S_{ig} = \int_{t=t_0}^{t} \frac{dt}{\tau_{ig}} (2.3-4)

where $dt$ is the flow time step and $\tau_{ig}$ is the correlation between spark time and knock, by Douaud and Eyzat  [ 3]:
 \tau = 0.01768 \left( \frac{ON}{100} \right)^{3.402} p^{-1.7} \exp \left( \frac{3800}{T} \right) (2.3-5)

Here, $ON$ is the octane number of the fuel, $p$ is the absolute pressure in atmospheres and $T$ is the temperature in Kelvin.

In the following UDF example, the Douaud and Eyzat correlation is used to calculate an induction time. Please see Chapter  3 for details on the NNULLP, C_STORAGE_R, C_PREMIXC_T, C_P, C_R, CURRENT_TIMESTEP and C_IGNITE macros used below.

/*------------------------------------------------------------------*/
/* This UDF produces an ignition model source in ANSYS FLUENT 12.0  */
/* that uses the default parameters for the correlation of Douaud   */
/* and Eyzat for knock.                                             */
/*------------------------------------------------------------------*/

#include "udf.h"

real A = 0.01768;             /* Preexponential                     */
real Ea = 3800;               /* Activation temperature             */
real O_N = 90.0;              /* Octane number                      */
real O_E = 3.402;             /* Octane number exponent             */
real P_E = -1.7;              /* Pressure exponent                  */

static real A1 = 0.0;         /* Cached value of A*ON^OE            */
static real dt = 0.0;         /* Cached time step                   */
static real p_op = 0.0;       /* Cached value of operating pressure */
static cxboolean lit = FALSE; /* Cached burning flag                */

DEFINE_IGNITE_SOURCE(ign_udf_src, c, t, source)
{
  real rho = C_R(c,t);
  real time = 0.0;
  real prog = NNULLP(THREAD_STORAGE(t,SV_PREMIXC_M1))  ?
    C_STORAGE_R(c,t,SV_PREMIXC_M1) :
    C_STORAGE_R(c,t,SV_PREMIXC) ;
  real fuel = 1.0 - prog;
  real T = C_PREMIXC_T(c,t);
  real P = C_P(c,t);
  real ipv = C_IGNITE(c,t);

  if (c == 0)
    {
      dt = CURRENT_TIMESTEP;
      p_op = RP_Get_Real("operating-pressure");
      A1 = A * pow(O_N/100,O_E);
    }

  if (ipv > 1.0)
    lit = TRUE;

  P += p_op;
  P /= 101325.;      /* in atm */
  P = MAX(P,0.01);   /* minimum pressure for ignition */
  
  if (fuel > 0.99 || lit)
    time = A1 * pow(P,P_E) * exp(Ea/T);

  if (time > 0.0)
    {
      real max_source = rho*(5.0-ipv)/dt;
      real user_source = rho/time;
      *source = MIN(user_source,max_source);
    }
  else
    *source = 0.0;

  return;
}



Hooking an Ignition Source UDF to ANSYS FLUENT


After the UDF that you have defined using DEFINE_IGNITE_SOURCE is compiled (Chapter  5), the name of the argument that you supplied as the first DEFINE macro argument (e.g., ign_udf_src) will become visible and selectable in the User-Defined Function Hooks dialog box in ANSYS FLUENT. See Section  6.2.10 for details.


next up previous contents index Previous: 2.3.9 DEFINE_HEAT_FLUX
Up: 2.3 Model-Specific DEFINE Macros
Next: 2.3.11 DEFINE_NET_REACTION_RATE
Release 12.0 © ANSYS, Inc. 2009-01-14