2.3.13.  DEFINE_FLAMELET_PARAMETERS

2.3.13.1. Description

You can use DEFINE_FLAMELET_PARAMETERS to specify a user-defined variation of scalar dissipation, mean mixture fraction grid, and mean progress variable grid for flamelet generation with non-premixed or partially premixed combustion models. The UDF is only available if either the Non-Premixed Combustion or Partially-Premixed Combustion model is enabled.

2.3.13.2. Usage

DEFINE_FLAMELET_PARAMETERS (name, Nf, Nc, Ns, xf, xc, xs)

Argument Type

Description

symbol name

UDF name.

Nf

Number of mean mixture fraction grid points in flamelet.

Nc

Number of mean progress variable grid points.

Ns

Maximum number of flamelets.

real *xf

Array to provide mean mixture fraction points.

real *xc

Array to provide mean progress variable points.

real *xs

Array to provide scalar dissipation values.

Function returns

void

There are seven arguments to DEFINE_FLAMELET_PARAMETERS: name, Nf, Nc, Ns, xf, xc, and xs. You supply name, the name of the UDF. Nf, Nc, Ns, xf, xc, and xs are variables that are passed by the ANSYS Fluent solver to your UDF. DEFINE_FLAMELET_PARAMETERS does not output a value. The specified grid discretizations or scalar dissipation variations are stored in the arrays xf, xc, and xs, respectively.


Note:  If Automated Grid Refinement is enabled for steady diffusion flamelet generation (see Steady Diffusion Flamelet in the Fluent User's Guide), then you can only use DEFINE_FLAMELET_PARAMETERS UDFs to specify user-defined scalar dissipation variation. ANSYS Fluent will ignore the user-defined grid for the mean mixture fraction and/or reaction progress.


2.3.13.3. Example

The following compiled UDF, named user_scad_fmean_grid, is used to provide the user-defined scalar dissipation variation and user-defined mean mixture fraction grid points for flamelet solution.

 #include "udf.h"
 #define fsto 0.056
 
 DEFINE_FLAMELET_PARAMETERS(user_scad_fmean_grid,nf,nc,ns,xf,xc,xs)
 {
    int i,np,np_rich ;

  /* The arrays xf,xc,xs passed by the solver contains default 
     discretization and default scalar dissipation variation*/

  /* These arrays can be over-written with user-defined grid or scalar 
     dissipation variation*/

  /* Flamelets with Scalar dissipation of
     0.01, 0.05, 0.1, 0.15, 0.2, 1, 4, 7, 10,... */


    for(i=0;i<ns;i++)
      {
       if (i < 5)
         xs[i] = 0.01*5*i;
       else
         xs[i] = 1.+(i-5)*3;
      }
 
  /* Sample UDF to provide user defined discretization for fmean grid
     for flamelet generation*/

  /* Divide fmean grid into 3 intervals: (1) f=0 to fsto, (2) fsto to 2.*fsto
     and (3) 2.*fsto to f=1.*/

  /* Place equal number of grid points in these three intervals*/

    if(nf > 0)
      {
       np = (int) nf/3;
       np_rich = 2*np;
      }
    for(i=0;i<nf;i++)
      {
       if(i <= np)
         {
          xf[i] = i*fsto/np;
         }
       else if(i <= np_rich)
         {
          xf[i] = fsto+fsto*(i-np)/(np_rich-np);
         }
       else
         {
          xf[i]= 2.*fsto + (1.-2*fsto)*(i-np_rich)/(nf-1-np_rich);
         }
      }
 } 

2.3.13.4. Hooking a Flamelet Parameters UDF to ANSYS Fluent

After the UDF that you have defined using DEFINE_FLAMELET_PARAMETERS is compiled (Compiling UDFs), the name of the argument that you supplied as the first DEFINE macro argument (for example, user_scad_fmean_grid) will become visible and selectable in the User-Defined Function drop-down list under the Flamelet tab of the Species Model dialog box in ANSYS Fluent. See Hooking DEFINE_FLAMELET_PARAMETERS UDFs for details.


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