FLUENT V5 - how to customize the destination of mass and enthalpy sources from the discrete phase using a user-defined DPM law


If I use a user defined DPM Law / Custom Law, FLUENT calculates mass and enthalpy sources from the changes in particle mass and temperature. But the mass source goes always into the LAST species (the one no transport equation is solved for). If I want it to go into a different species or e.g. into two species parallel, how do I achieve this?
In DEFINE_DPM_SOURCE, you can get the mass source by accessing S->mass. This can be added to the quantity C_DPMS_YI(c, t, i). ("i" is the species index, with 0/zero for the first species.)
BUT: The value MUST be multiplied by the DPM sources underrelaxation factor!
(C_DPMS_YI(c, t, i) is a synonym for C_STORAGE_R(c,t,SV_DPMS_SPECIES_0+i), which often appears in UDF examples circulated..)

The underrelaxation factor can be accessed as RP_Get_Real("dpm/relax"). But the execution of this function call is rather slow, as it involves information exchange between cortex and FLUENT. Therefore it is strongly advisable to call this function in a UDF that is not called frequently, e.g. DEFINE_DPM_INJECTION_INIT or DEFINE_ADJUST.

A (positively tested) sample UDF source code follows:
--------------------------------------------------------------------------

/* A self-coded evaporating particle law */
/* causes correct DPM mass sources, */
/* BUT NO DPM species sources. */

/* This is an example of how to implement */
/* the necessary species sources manually. */

#include "udf.h"
#include "dpm.h"

DEFINE_DPM_LAW(dpm_law_expo_evap, p, ifcoupled)
{
real p_m =
(P_MASS(p) -= P_DT(p) * 0.7 * P_MASS(p));
P_DIAM(p) = pow(6. / M_PI * p_m / P_RHO(p), 0.3333333333333333333333333333);
}

real udf_dpm_relax = 0.;

/* The following Function should be enabled for ALL injections..!! */

DEFINE_DPM_INJECTION_INIT(dpm_inj_init, I)
{
udf_dpm_relax = RP_Get_Real("dpm/relax");
}

DEFINE_DPM_SOURCE(dpm_source_get_spe_sou, c, t, S, strength, p)
{
C_DPMS_YI(c, t, 1) += S->mass * udf_dpm_relax;
}
You can access the "species index" of the "evaporating species" specified by the user in the Injection panel. The lines to be included in DEFINE_DPM_SOURCE will then read:

if (DPM_NULL_SPECIES_INDEX != P_EVAP_SPECIES_INDEX(p))
{
C_DPMS_YI(c,t,P_EVAP_SPECIES_INDEX(p)) += S->mass * dpm_relax;
}





Show Form
No comments yet. Be the first to add a comment!