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

2.3.24 DEFINE_TURB_PREMIX_SOURCE



Description


You can use DEFINE_TURB_PREMIX_SOURCE to customize the turbulent flame speed and source term in the premixed combustion model (see this chapter in the separate User's Guide ) and the partially premixed combustion model (see this chapter in the separate User's Guide ).



Usage



DEFINE_TURB_PREMIX_SOURCE( name, c, t, turb_flame_speed, source)


Argument Type Description
symbol name UDF name.
cell_t c Cell index.
Thread *t Pointer to cell thread on which the turbulent premixed
  source term is to be applied.
real *turb_flame_speed Pointer to the turbulent flame speed.
real *source Pointer to the reaction progress source term.
   
Function returns  
void  
   

There are five arguments to DEFINE_TURB_PREMIX_SOURCE: name, c, t, turb_flame_speed, and source. You supply name, the name of the UDF. c, t, turb_flame_speed, and source are variables that are passed by the ANSYS FLUENT solver to your UDF. Your UDF will need to set the turbulent flame speed to the value referenced by the turb_flame_speed pointer. It will also need to set the source term to the value referenced by the source pointer.



Example


The following UDF, named turb_flame_src, specifies a custom turbulent flame speed and source term in the premixed combustion model. The source code must be executed as a compiled UDF in ANSYS FLUENT.

In the standard premixed combustion model in ANSYS FLUENT, the mean reaction rate of the progress variable (that is, the source term) is modeled as


 \rho S_c = \rho_u U_t \vert\nabla c\vert (2.3-11)

where $c$ is the mean reaction progress variable, $\rho$ is the density, and $U_t$ is the turbulent flame speed.

In the UDF example, the turbulent flame speed is modeled as


 U_t = U_l \sqrt{1 + (u'/U_l)^2} (2.3-12)

where $U_l$ is the laminar flame speed and $u'$ is the turbulent fluctuation. Note that the partially premixed combustion model is assumed to be enabled (see this chapter in the separate User's Guide ), so that the unburned density and laminar flame speed are available as polynomials. See Chapter  3 for details on the NULLP, THREAD_STORAGE, and SV_VARS macros.

/*******************************************************************
    UDF that specifies a custom turbulent flame speed and source   
    for the premixed combustion model                              
********************************************************************/

#include "udf.h"
#include "sg_pdf.h" /* not included in udf.h so must include here  */

DEFINE_TURB_PREMIX_SOURCE(turb_flame_src,c,t,turb_flame_speed,source)
{
  real up = TRB_VEL_SCAL(c,t);
  real ut, ul, grad_c, rho_u, Xl, DV[ND_ND];

  ul = C_LAM_FLAME_SPEED(c,t);
  Calculate_unburnt_rho_and_Xl(t, &rho_u, &Xl);

  if( NNULLP(THREAD_STORAGE(t,SV_PREMIXC_G)) )
    {
      NV_V(DV, =, C_STORAGE_R_NV(c,t,SV_PREMIXC_G));
      grad_c = sqrt(NV_DOT(DV,DV) );
    }

  ut = ul*sqrt( 1. + SQR(up/ul) );

  *turb_flame_speed = ut;
  *source = rho_u*ut*grad_c;
}



Hooking a Turbulent Premixed Source UDF to ANSYS FLUENT


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


next up previous contents index Previous: 2.3.23 DEFINE_TRANS UDFs
Up: 2.3 Model-Specific DEFINE Macros
Next: 2.3.25 DEFINE_TURB_SCHMIDT UDF
Release 12.0 © ANSYS, Inc. 2009-01-14