![]() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Description
You can use DEFINE_DPM_PROPERTY to specify properties of discrete phase materials. For example, you can model the following dispersed phase properties with this type of UDF:
Usage
DEFINE_DPM_PROPERTY( name, c, t, p) |
Argument Type | Description |
symbol name | UDF name. |
cell_t c | Index that identifies the cell where the particle is located |
in the given thread. | |
Thread *t | Pointer to the thread where the particle is located. |
Tracked_Particle *p | Pointer to the Tracked_Particle data structure which |
contains data related to the particle being tracked. | |
Function returns | |
real | |
There are four arguments to DEFINE_DPM_PROPERTY: name, c, t, and p. DEFINE_DPM_PROPERTY has the same arguments as the DEFINE_PROPERTY function (described in Section 2.3.16), with the addition of the pointer to the Tracked_Particle p. You supply name, the name of the UDF. c, t, and p are variables that are passed by the ANSYS FLUENT solver to your UDF. Your UDF will need to compute the real value of the discrete phase property and return it to the solver.
|
Pointer
p can be used as an argument to the macros defined in Section
3.2.7 to obtain information about particle properties (e.g., injection properties).
|
Example
In the following example, two discrete phase material property UDFs (named coal_emissivity and coal_scattering, respectively) are concatenated into a single C source file. These UDFs must be executed as compiled UDFs in ANSYS FLUENT.
/********************************************************************* UDF that specifies discrete phase materials **********************************************************************/ #include "udf.h" DEFINE_DPM_PROPERTY(coal_emissivity,c,t,p) { real mp0= P_INIT_MASS(p); real mp = P_MASS(p); real vf, cf; /* get the material char and volatile fractions and store them */ /* in vf and cf */ vf=DPM_VOLATILE_FRACTION(p); cf=DPM_CHAR_FRACTION(p); if (!(((mp/mp0) >= 1) || ((mp/mp0) <= 0))) { if ((mp/mp0) < (1-(vf)-(cf))) { /* only ash left */ /* vf = cf = 0; */ return .001; } else if ((mp/mp0) < (1-(vf))) { /* only ash and char left */ /* cf = 1 - (1-(vf)-(cf))/(mp/mp0); */ /* vf = 0; */ return 1.0; } else { /* volatiles, char, and ash left */ /* cf = (cf)/(mp/mp0); */ /* vf = 1. - (1.-(vf))/(mp/mp0); */ return 1.0; } } return 1.0; } DEFINE_DPM_PROPERTY(coal_scattering,c,t,p) { real mp0= P_INIT_MASS(p); real mp = P_MASS(p); real cf, vf; /* get the original char and volatile fractions and store them */ /* in vf and cf */ vf=DPM_VOLATILE_FRACTION(p); cf=DPM_CHAR_FRACTION(p); if (!(((mp/mp0) >= 1) || ((mp/mp0) <= 0))) { if ((mp/mp0) < (1-(vf)-(cf))) { /* only ash left */ /* vf = cf = 0; */ return 1.1; } else if ((mp/mp0) < (1-(vf))) { /* only ash and char left */ /* cf = 1 - (1-(vf)-(cf))/(mp/mp0); */ /* vf = 0; */ return 0.9; } else { /* volatiles, char, and ash left */ /* cf = (cf)/(mp/mp0); */ /* vf = 1. - (1.-(vf))/(mp/mp0); */ return 1.0; } } return 1.0; } |
Hooking a DPM Material Property UDF to
ANSYS FLUENT
After the UDF that you have defined using DEFINE_DPM_PROPERTY is interpreted (Chapter 4) or compiled (Chapter 5), the name of the argument that you supplied as the first DEFINE macro argument will become visible in the Create/Edit Materials dialog box in ANSYS FLUENT. See Section 6.4.9 for details on how to hook your DEFINE_DPM_PROPERTY UDF to ANSYS FLUENT.