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



You can use DEFINE_VECTOR_EXCHANGE_PROPERTY to specify custom slip velocities for the multiphase Mixture model.


DEFINE_VECTOR_EXCHANGE_PROPERTY( name, c, mixture_thread,
second_column_phase_index, first_column_phase_index, vector_result)


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 Cell index.
Thread *mixture_thread Pointer to cell thread of mixture domain.
int second_column_phase_index Index of second phase in phase interaction.
int first_column_phase_index Index of first phase in phase interaction.
real *vector_result Pointer to slip velocity vector.
Function returns: void  

There are six arguments to DEFINE_VECTOR_EXCHANGE_PROPERTY: name, c, mixture_thread, second_column_phase_index, first_column_phase_index, and vector_result. You supply name, the name of the UDF. c, mixture_thread, second_column_phase_index, first_column_phase_index, and vector_result are variables that are passed by the FLUENT solver to your UDF. Your UDF will need to set the values referenced by the real pointer to the slip velocity vector ( vector_result) to the components of the slip velocity vector (e.g., vector_result[0], vector_result[1] for a 2D problem).


The following UDF, named custom_slip, specifies a custom slip velocity in a two-phase mixture problem.

   UDF for a defining a custom slip velocity in a 2-phase
   mixture problem

#include "udf.h"

 real grav[2] = {0., -9.81}; 
 real K = 5.e4; 
 real pgrad_x, pgrad_y; 
 Thread *pt, *st;/* thread pointers for primary and secondary phases*/ 
 pt = THREAD_SUB_THREAD(mixture_thread, second_column_phase_index); 
 st = THREAD_SUB_THREAD(mixture_thread, first_column_phase_index); 
 /* at this point the phase threads are known for primary (0) and 
 secondary(1) phases */ 
 pgrad_x = C_DP(c,mixture_thread)[0];
 pgrad_y = C_DP(c,mixture_thread)[1]; 
 vector_result[0] = 
 +( ((C_R(c, st)- 
 C_R(c, pt))/K)* 
 vector_result[1] = 
 +( ((C_R(c, st)- 
 C_R(c, pt))/K)* 


Note that the pressure gradient macro C_DP is now obsolete. A more current pressure gradient macro can be found in Table  3.2.4.

Hooking a Vector Exchange Property UDF to FLUENT

After the UDF that you have defined using DEFINE_VECTOR_EXCHANGE_PROPERTY is interpreted (Chapter  4) or compiled (Chapter  5), the name of the argument that you supplied as the first DEFINE macro argument (e.g., custom_slip) will become visible and selectable in the Phase Interaction panel in FLUENT. See Section  6.3.5 for details.

next up previous contents index Previous: 2.4.4 DEFINE_MASS_TRANSFER
Up: 2.4 Multiphase DEFINE Macros
Next: 2.5 Discrete Phase Model
© Fluent Inc. 2006-09-13