2.3.27.  DEFINE_RELAX_TO_EQUILIBRIUM

2.3.27.1. Description

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.

2.3.27.2. Usage

DEFINE_RELAX_TO_EQUILIBRIUM(name,c,t,pressure,temp,yi,tau)

Argument Type

Description

symbol name

UDF name.

cell_t c

Cell index.

Thread *t

Pointer to cell thread.

real pressure

Pressure.

real temp

Temperature.

real *yi

Pointer to array containing species mass fractions.

real *tau

Pointer to characteristic time (scalar-valued).

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.

2.3.27.3. Example

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;
  
}

2.3.27.4. Hooking a DEFINE_RELAX_TO_EQUILIBRIUM UDF to ANSYS Fluent

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.


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