When the Relax to Chemical Equilibrium species chemistry solver option is enabled (as described in Enabling Species Transport and Reactions and Choosing the Mixture
Material in the Fluent User's Guide for details), you can use DEFINE_RELAX_TO_EQUILIBRIUM to specify the characteristic time at each cell, over which the species react toward their chemical equilibrium state. This UDF will replace Fluent internal calculations of
described in The Relaxation to Chemical Equilibrium Model in the Fluent Theory Guide.
DEFINE_RELAX_TO_EQUILIBRIUM(name,c,t,pressure,temp,yi,tau)
|
Argument Type |
Description |
|---|---|
|
|
UDF name. |
|
|
Cell index. |
|
|
Pointer to cell thread. |
|
|
Pressure. |
|
|
Temperature. |
|
|
Pointer to array containing species mass fractions. |
|
|
Pointer to characteristic time |
Function returns
void
There are seven arguments to DEFINE_RELAX_TO_EQUILIBRIUM: name, c, t, pressure, temp, yi, and tau. You supply name, the name of the UDF. The variables c, t, pressure, temp, yi, and tau are passed by the ANSYS Fluent solver to your UDF and have SI units. The output of the function is the characteristic time for current species with units of [s] (seconds).
DEFINE_RELAX_TO_EQUILIBRIUM is called for all reacting fluid zones whenever the UDF is hooked to ANSYS Fluent in the User-Defined Function Hooks dialog box.
The following UDF, named relax_tau, sets the value of tau based on the mass fraction of CH4.
/***********************************************************
Relax to Equilibrium Example UDF
************************************************************/
#include "udf.h"
DEFINE_RELAX_TO_EQUILIBRIUM(relax_tau,c,t,pres,temp,yi,tau)
{
/*Simple function to set tau based on mass fraction of CH4*/
if(yi[13] > 1.e-1)
*tau = 1.e3;
else
*tau = 1.e-3;
}
After the UDF that you have defined using DEFINE_RELAX_TO_EQUILIBRIUM is interpreted or compiled (Compiling UDFs), the name of the argument that you supplied as the first DEFINE macro argument (for example, relax_tau) will become visible and selectable in the User-Defined Function Hooks dialog box in ANSYS Fluent. See Hooking DEFINE_RELAX_TO_EQUILIBRIUM UDFs for details.