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

2.3.3 DEFINE_DIFFUSIVITY



Description


You can use DEFINE_DIFFUSIVITY to specify the diffusivity for the species transport equations (e.g., mass diffusivity) or for user-defined scalar (UDS) transport equations. For details about UDS diffusivity, see this section in the separate User's Guide .



Usage



DEFINE_DIFFUSIVITY( name, c, t, i)


Argument Type Description
symbol name UDF name.
cell_t c Cell index.
Thread *t Pointer to cell thread on which the diffusivity function is to
  be applied.
int i Index that identifies the species or user-defined scalar.
   
Function returns  
real  
   

There are four arguments to DEFINE_DIFFUSIVITY: name, c, and t, and i. You supply name, the name of the UDF. c, t, and i are variables that are passed by the ANSYS FLUENT solver to your UDF. Your UDF will need to compute the diffusivity only for a single cell and return the real value to the solver.

Note that diffusivity UDFs are called by ANSYS FLUENT from within a loop on cell threads. Consequently, your UDF will not need to loop over cells in a thread since ANSYS FLUENT is doing it outside of the function call.



Example


The following UDF, named mean_age_diff, computes the diffusivity for the mean age of air using a user-defined scalar. Note that the mean age of air calculations do not require that energy, radiation, or species transport calculations have been performed. You will need to set uds-0 = $0.0$ at all inlets and outlets in your model. This function can be executed as an interpreted or compiled UDF.

/**********************************************************************
   UDF that computes diffusivity for mean age using a user-defined    
   scalar.                                                            
***********************************************************************/

#include "udf.h"

DEFINE_DIFFUSIVITY(mean_age_diff,c,t,i)
{
     return C_R(c,t) * 2.88e-05 + C_MU_EFF(c,t) / 0.7;
}



Hooking a Diffusivity UDF to ANSYS FLUENT


After the UDF that you have defined using DEFINE_DIFFUSIVITY is interpreted (Chapter  4) or compiled (Chapter  5), the name that you specified in the DEFINE macro argument (e.g., mean_age_diff) will become visible and selectable in the Create/Edit Materials dialog box in ANSYS FLUENT. See Section  6.2.3 for details.


next up previous contents index Previous: 2.3.2 DEFINE_CPHI
Up: 2.3 Model-Specific DEFINE Macros
Next: 2.3.4 DEFINE_DOM_DIFFUSE_REFLECTIVITY
Release 12.0 © ANSYS, Inc. 2009-01-14