2.5.15.  DEFINE_DPM_VP_EQUILIB

2.5.15.1. Description

You can use DEFINE_DPM_VP_EQUILIB to specify the equilibrium vapor pressure of vaporizing components of multicomponent particles.

2.5.15.2. Usage

DEFINE_DPM_VP_EQUILIB (name, tp, T, cvap_surf, Z)

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.

real T Temperature. The appropriate temperature will be passed to your UDF by the solver and may be equal to the particle, the film, or the multi-component droplet saturation temperature.

real *cvap_surf

Array that contains the equilibrium vapor concentration over the particle surface

real *Z

Pointer to the compressibility factor, Z

Function returns

void

There are five arguments to DEFINE_DPM_VP_EQUILIB: name, tp, T, cvap_surf, and Z. You supply the name of your user-defined function. tp and T are passed by the ANSYS Fluent solver to your UDF. Your UDF will need to compute the equilibrium vapor concentration and the compressibility factor and store their values in cvap_surf and Z, respectively.

2.5.15.3. Example

The following UDF named raoult_vpe computes the equilibrium vapor concentration of a multicomponent particle using the Raoult law. The vapor pressure in the law is proportional to the molar fraction of the condenses material. DEFINE_VP_EQUILIB is called several times every particle time step in ANSYS Fluent and requires a significant amount of CPU time to execute. For this reason, the UDF should be executed as a compiled UDF.

/***********************************************************************
   UDF for defining the vapor particle equilibrium
   for multicomponent particles
 ***********************************************************************/
 #include <udf.h>
 DEFINE_DPM_VP_EQUILIB(raoult_vpe,tp,Tp,cvap_surf,Z)
 {
    int is;
    real molwt[MAX_SPE_EQNS];
    Thread *t0 = TP_CELL_THREAD(tp);  /* cell thread of particle location */
    Material *gas_mix = THREAD_MATERIAL(t0); /* gas mixture material */
    Material *cond_mix = TP_MATERIAL(tp); /* particle mixture material */
    int nc = TP_N_COMPONENTS(tp);    /* number of particle components */
    real molwt_cond = 0.;  /* reciprocal molecular weight of the particle */
    for (is = 0; is < nc; is++)
      {
         int gas_index = TP_COMPONENT_INDEX_I(tp,is); /* index of vaporizing
            component in the gas phase */
         if (gas_index >= 0)
           {
            /* the molecular weight of particle material */
            molwt[gas_index] =
           MATERIAL_PROP(MIXTURE_COMPONENT(gas_mix,gas_index),PROP_mwi);
            molwt_cond += TP_COMPONENT_I(tp,is) / molwt[gas_index];
           }
        }
    /* prevent division by zero */
    molwt_cond = MAX(molwt_cond,DPM_SMALL);
    for (is = 0; is < nc; is++)  {
     /* gas species index of vaporization */
     int gas_index = TP_COMPONENT_INDEX_I(tp,is);
     if(gas_index >= 0)
       {
        /* condensed material */
        Material * cond_c = MIXTURE_COMPONENT(cond_mix, is);
        /* condensed component molefraction */
        real xi_cond = TP_COMPONENT_I(tp,is)/(molwt[gas_index]*molwt_cond);
        /* particle saturation pressure */
        real p_saturation = DPM_vapor_pressure(tp, cond_c, Tp);
        if (p_saturation < 0.0)
          p_saturation = 0.0;
        /* vapor pressure over the surface, this is the actual Raoult law */
        cvap_surf[is] = xi_cond * p_saturation / UNIVERSAL_GAS_CONSTANT / Tp;
       }
    }
  /* compressibility for ideal gas */
  *Z = 1.0;
 } 

2.5.15.4. Hooking a DPM Vapor Equilibrium UDF to ANSYS Fluent

After the UDF that you have defined using DEFINE_DPM_VP_EQUILIB 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 and selectable in the Create/Edit Materials dialog box in ANSYS Fluent. Note that before you hook the UDF, you’ll need to create particle injections in the Injections dialog box with the type Multicomponent chosen. See Hooking DEFINE_DPM_VP_EQUILIB UDFs for details on how to hook your DEFINE_DPM_VP_EQUILIB UDF to ANSYS Fluent.


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