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

2.4.4 DEFINE_MASS_TRANSFER



Description


You can use DEFINE_MASS_TRANSFER when you want to model mass transfer in a multiphase problem. The mass transfer rate specified using a DEFINE_MASS_TRANSFER UDF is used to compute mass, momentum, energy, and species sources for the phases involved in the mass transfer. For problems in which species transport is enabled, the mass transfer will be from one species in one phase, to another species in another phase. If one of the phases does not have a mixture material associated with it, then the mass transfer will be with the bulk fluid of that phase.



Usage



DEFINE_MASS_TRANSFER( name, c, mixture_thread, from_phase_index, from_species_index,
to_phase_index, to_species_index)

figure   

Note that all of the arguments to a DEFINE macro need to be placed on the same line in your source code. Splitting the DEFINE statement onto several lines will result in a compilation error.


Argument Type Description
symbol name UDF name.
cell_t c Index of cell on the thread pointed to by mixture_thread.
Thread *mixture_thread Pointer to mixture-level thread.
int from_phase_index Index of phase from which mass is transferred.
int from_species_index ID of species from which mass is transferred
  (ID= -1 if phase does not have mixture material).
int to_phase_index Index of phase to which mass is transferred.
int to_species_index ID of species to which mass is transferred
  (ID= -1 if phase does not have mixture material).
   
Function returns: real  
   

There are seven arguments to DEFINE_MASS_TRANSFER: name, c, mixture_thread, from_phase_index, from_species_index, to_phase_index, to_species_index. You supply name, the name of the UDF. The variables c, mixture_thread, from_phase_index, from_species_index, to_phase_index, and to_species_index are passed by the ANSYS FLUENT solver to your UDF. Your UDF will need to return the real value of the mass transfer to the solver in the units of kg/m $^3$/s.

figure   

The arguments from_species_index and to_species_index are relevant for multiphase species transport problems only, and only if the respective phase has a mixture material associated with it.



Example


The following UDF, named liq_gas_source, specifies a simple mass transfer coefficient based on saturation temperature:

figure   

Note that in the example that follows, the DEFINE_MASS_TRANSFER statement is broken up into two lines for the sake of readability. In your source file, you must make sure that the DEFINE statement is on one line only.

/* UDF to define a simple mass transfer based on Saturation
   Temperature. The "from" phase is the gas and the "to" phase is the
   liquid phase  */

#include "udf.h"

DEFINE_MASS_TRANSFER(liq_gas_source, cell, thread, from_index,
from_species_index, to_index, to_species_index)
{
   real m_lg;
   real T_SAT = 373.15;
   Thread *gas = THREAD_SUB_THREAD(thread, from_index);
   Thread *liq = THREAD_SUB_THREAD(thread, to_index);

   m_lg = 0.;
   if (C_T(cell, liq) >= T_SAT)
     {
       m_lg = -0.1*C_VOF(cell,liq)*C_R(cell,liq)*
               fabs(C_T(cell,liq)-T_SAT)/T_SAT;
     }
   if ((m_lg == 0. ) && (C_T(cell, gas) <= T_SAT))
     {
       m_lg = 0.1*C_VOF(cell,gas)*C_R(cell,gas)*
         fabs(T_SAT-C_T(cell,gas))/T_SAT;
     }

   return (m_lg);
}



Hooking a Mass Transfer UDF to ANSYS FLUENT


After the UDF that you have defined using DEFINE_MASS_TRANSFER is interpreted (Chapter  4) or compiled (Chapter  5), the name of the argument that you supplied as the first DEFINE macro argument (e.g., liq_gas_source) will become visible and selectable under Mass Transfer when you select the Mass tab option in the Phase Interaction dialog box and specify the Number of Mass Transfer Functions. See Section  6.3.4 for details.


next up previous contents index Previous: 2.4.3 DEFINE_HET_RXN_RATE
Up: 2.4 Multiphase DEFINE Macros
Next: 2.4.5 DEFINE_VECTOR_EXCHANGE_PROPERTY
Release 12.0 © ANSYS, Inc. 2009-01-14