![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
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
![]() |
(2.3-11) |
where
is the mean reaction progress variable,
is the density, and
is the turbulent flame speed.
In the UDF example, the turbulent flame speed is modeled as
![]() |
(2.3-12) |
where
is the laminar flame speed and
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.