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



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


DEFINE_DPM_VP_EQUILIB( name, p, cvap_surf)

Argument Type Description
symbol name UDF name.
Tracked_Particle *p Pointer to the Tracked_Particle data structure which
  contains data related to the particle being tracked.
real *cvap_surf Array that contains the equilibrium vapor concentration
  over the particle surface.
Function returns  

There are three arguments to DEFINE_DPM_VP_EQUILIB: name, p, and cvap_surf. You supply the name of your user-defined function. p is passed by the FLUENT solver to your UDF. Your UDF will need to compute the equilibrium vapor concentrations and store the values in cvap_surf.


The following UDF named raoult_vpe computes the equilibrium vapor concentration of a multicomponent particle using hte 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 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"
#include "dpm.h"
#include "surf.h"
  int is;
  real molwt[MAX_SPE_EQNS];

  Thread *t0 = RP_THREAD( &(p->cCell) ); /* cell thread of
                                      particle location */
  Material *gas_mix = THREAD_MATERIAL( t0 );  /* gas mixture
                                                material */
  Material *cond_mix = p->injection->material; /* particle 
                                        mixture material */
  int nc = TP_N_COMPONENTS( p );   /* number of particle
                                      components */
  real Tp = P_T(p); /* particle temperature */
  real pressure = p->cphase.pressure;  /* gas pressure */
  real molwt_cond = 0.;  /* reciprocal molecular weight
                          of the particle */

  for( is = 0; is < nc; is++ )
      int gas_index = TP_COMPONENT_INDEX_I(p,is);  /* index
                   of vaporizing component in the gas phase */
      if( gas_index >= 0 )
	  /* the molecular weight of particle material */
	  molwt[gas_index] = 
	  molwt_cond += TP_COMPONENT_I(p,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(p,is);
      if( gas_index >= 0 )
	  /* condensed material */
	  Material * cond_c = MIXTURE_COMPONENT( cond_mix, is );
	  /* condensed component molefraction */
	  real xi_cond = TP_COMPONENT_I(p,is) / 
          ( molwt[gas_index] * molwt_cond );
	  /* particle saturation pressure */
	  real p_saturation = DPM_vapor_pressure( p, cond_c, Tp );
	  if (p_saturation > pressure)
	    p_saturation = pressure;
	  else 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;

Hooking a DPM Vapor Equilibrium UDF to FLUENT

After the UDF that you have defined using DEFINE_DPM_VP_EQUILIBRIUM 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 and selectable in the Materials panel in FLUENT. Note that before you hook the UDF, you'll need to create particle injections in the Injections panel with the type Multicomponent chosen. See Section  6.4.15 for details on how to hook your DEFINE_DPM_VP_EQUILIB UDF to FLUENT.

next up previous contents index Previous: 2.5.14 DEFINE_DPM_TIMESTEP
Up: 2.5 Discrete Phase Model
Next: 2.6 Dynamic Mesh DEFINE
© Fluent Inc. 2006-09-13