2.5.7.  DEFINE_DPM_LAW

2.5.7.1. Description

You can use DEFINE_DPM_LAW to customize laws for particles. For example your UDF can specify custom laws for heat and mass transfer rates for droplets and combusting particles. Additionally, you can specify custom laws for mass, diameter, and temperature properties as the droplet or particle exchanges mass and energy with its surroundings.

When a DEFINE_DPM_LAW UDF is activated, then the number of species that can be referenced and interact with the particles via the UDF is limited to those with a species index less than the maximum UDF species number, defined using the TUI command define/models/dpm/options/maximum-udf-species. The default number for maximum-udf-species is 50.

2.5.7.2. Usage

DEFINE_DPM_LAW (name, tp, ci)

Argument Type

Description

symbol name

UDF name.

Tracked_Particle *tp

Pointer to the Tracked_Particle data structure which contains data related to the particle being tracked.

int ci

Variable that indicates whether the continuous and discrete phases are coupled (equal to if coupled with continuous phase, if not coupled).

Function returns

void

There are three arguments to DEFINE_DPM_LAW: name, tp, and ci. You supply name, the name of the UDF. tp and ci are variables that are passed by the ANSYS Fluent solver to your UDF.


Important:  Pointer tp can be used as an argument to the macros defined in DPM Macros to obtain information about particle properties (for example, injection properties).


2.5.7.3. Example

The following UDF, named Evapor_Swelling_Law, models a custom law for the evaporation swelling of particles. The source code can be interpreted or compiled in ANSYS Fluent. See Example DEFINE_DPM_LAW usage.

/**********************************************************************
   UDF that models a custom law for evaporation swelling of particles
 ***********************************************************************/
 
 #include "udf.h"
 
 DEFINE_DPM_LAW(Evapor_Swelling_Law,tp,ci)
 {
    real swelling_coeff = 1.1;

    /* first, call standard evaporation routine to calculate
    the mass and heat transfer       */
    VaporizationLaw(tp);

    /* compute new particle diameter and density */
    TP_DIAM(tp) = TP_INIT_DIAM(tp)*(1. + (swelling_coeff - 1.)*
   (TP_INIT_MASS(tp)-TP_MASS(tp))/(DPM_VOLATILE_FRACTION(tp)*TP_INIT_MASS(tp)));
    TP_RHO(tp) = TP_MASS(tp) / (3.14159*TP_DIAM(tp)*TP_DIAM(tp)*TP_DIAM(tp)/6);
    TP_RHO(tp) = MAX(0.1, MIN(1e5, TP_RHO(tp)));
 } 

2.5.7.4. Hooking a Custom DPM Law to ANSYS Fluent

After the UDF that you have defined using DEFINE_DPM_LAW is interpreted (Interpreting UDFs) or compiled (Compiling UDFs), the name of the argument that you supplied as the first DEFINE macro argument will become visible in the Custom Laws dialog box in ANSYS Fluent. See Hooking DEFINE_DPM_LAW UDFs for details on how to hook your DEFINE_DPM_LAW UDF to ANSYS Fluent.


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