You can use DEFINE_SOOT_MASS_RATES to
specify a user-defined soot nucleation, surface growth, and oxidation
rates for soot mass fraction equation. The UDF is only available if
the Moss-Brookes or Moss-Brookes-Hall soot model is enabled.
DEFINE_SOOT_MASS_RATES (name, c, t, Pollut, Pollut_Par,
Soot, rates_linear, rates_nonlinear, index)
|
Argument Type |
Description |
|---|---|
|
|
UDF name |
|
|
Cell index |
|
|
Pointer to cell thread on which the Soot mass rates is to be applied |
|
|
Pointer to the data structure that contains the common data at each cell |
|
|
Pointer to the data structure that contains auxiliary data |
|
|
Pointer to the data structure that contains data specific to the Soot mode. |
|
|
Array to provide the linear components of soot mass rates |
|
|
Array to provide the nonlinear components of soot mass rates |
|
|
Integer value which tells whether the udf is called for nucleation, surface growth or oxidation rates |
Function returns
void
There are nine arguments to DEFINE_SOOT_MASS_RATES: name, c, t, Pollut, Pollut_Par, Soot, rates_linear, rates_nonlinear, and index. You supply name, the name of the UDF.
Variables c, t, Pollut, Pollut_par, Soot, rates_linear, rates_nonlinear, and index are
passed by the ANSYS Fluent solver to your function. A DEFINE_SOOT_MASS_RATES function does not output a value. The calculated soot nuclei rates
will be stored in the arrays rates_linear and rates_nonlinear.
The soot mass rates consist of explicit and implicit parts and can be expressed as follows:
where is an explicit part of any mass rate (such as oxidation and surface
growth) that can be a function of any variable(s) other than soot mass fraction and soot
nuclei concentration, and
is an implicit part of the nuclei rates that represents terms involving
soot mass fraction and soot nuclei concentration. The term
is stored in the
rates_linear array, while the
term is stored in the
rates_nonlinear array.
The units of soot mass rate are kg/m3/s.
The following compiled UDF, named user_soot_mass_rates, is used to provide the user-defined soot mass rate.
/*******************************************************************************
Following UDF is implementation of Fenimore-Jones soot oxidation model using UDF
*******************************************************************************/
/*user defined soot mass rates to be filled in arrays "rates_linear" and "rates_nonlinear"*/
/*User defined soot mass rates have to be in following form:
Rate = A*B,
Where B is function of soot mass fraction and/or soot nuclie
and A is function of any variables other than soot mass fraction and nuclei.
This break is done to ensure that the soot rates can be stored in PDF tables apriori*/
/*
Return from the UDF are:
rates_linear[index] = A;/*Linear part*/
rates_nonlinear[index] = B; /*Nonlinear part*/
*/
/*If any soot rates returned can be written in terms of only linear part (A)
and/or only non-inear part (B), then this can be done in the following manner:*/
/*
case 1 : Only A is required
rates_linear[index] = A
rates_nonlinear[index] = 1.
case 2: Only B is required
rates_linear[index] = 1.
rates_nonlinear[index] = B
*/
DEFINE_SOOT_MASS_RATES(user_soot_mass_rates, c, t, Pollut, Pollut_Par, Soot,
rates_linear, rates_nonlinear,index)
{
switch (index)
{
case UDF_MASS_NUC: /*index =0 for user defined nucleation rate
in soot mass fraction equation */
break;
case UDF_MASS_SGS: /*index =1 for user defined surface growth rate
in soot mass fraction equation */
break;
case UDF_MASS_OXID: /*index =2 for user defined oxidation rate
in soot mass fraction equation */
{
real term1;
real oh_conc;
real temp = Pollut->fluct.temp;
real rho = POLLUT_GASDEN(Pollut);
real onethird = 1./3.;
real twothird = 2./3.;
real soot_yi,nuc;
real o_eq=0;
oh_conc = get_oheq(Pollut, Soot->oh_mode, o_eq)*1.e-03; /*kmol/m3*/
term1 = sqrt(temp)*pow(M_PI*NNORM, onethird)*pow(6./soot_dens, twothird);
rates_linear[UDF_MASS_OXID] = -c_omega*coleff*oxid_const*oh_conc*rho*term1;
if(NNULLP(t)) /*This check is must*/
{
soot_yi = C_POLLUT(c,t,EQ_SOOT);
nuc = C_POLLUT(c,t,EQ_NUCLEI);
rates_nonlinear[UDF_MASS_OXID] = pow(nuc, onethird)*pow(soot_yi,twothird);
}
}
break;
default:
Error("Wrong index for user defined soot nucleation terms\n");
break;
}
}After the UDF that you have defined using DEFINE_SOOT_MASS_RATES is compiled (Compiling UDFs), the name
of the argument that you supplied as the first DEFINE macro argument (for example, user_soot_mass_rates) will become visible and selectable in the User Defined
Soot Mass Rates drop-down list of the Soot Model dialog box in ANSYS Fluent. See Hooking DEFINE_SOOT_MASS_RATES UDFs for details.