CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (https://www.cfd-online.com/Forums/fluent-udf/)
-   -   transient mass transfer in multiphase flow (https://www.cfd-online.com/Forums/fluent-udf/162732-transient-mass-transfer-multiphase-flow.html)

Tensian November 16, 2015 10:39

transient mass transfer in multiphase flow
 
Hi everyone.

I need to create my first UDF for definign mass transfer between two phases (water and a solid phase using granular flow).

I would like to specify a transient mass transfer(similar for example of imposing a sinusoidal velocity profile at one inlet). So, for simplicity, let us suppose I have the following mass transfer dependence with time:

/************************************************** ********************/
/* unsteady.c */
/* UDF for specifying a transient velocity profile boundary condition */
/************************************************** ********************/

#include "udf.h"

DEFINE_MASS_TRANSFER(mt, c, mixture_thread, from_phase_index, from_species_index, to_phase_index, to_species_index)
{
real R;

Thread *water = THREAD_SUB_THREAD(mixture_thread, from_phase_index);
Thread *solid = THREAD_SUB_THREAD(mixture_thread, to_phase_index);

face_t f;


real t = RP_Get_Real("flow-time");
/* real t = CURRENT_TIME;*/


R = 20. + 5.0*sin(10.*t);
printf("mass transfer is %f \n",R);
printf("Flow time is %f \n",t);


return (R);
}

I put prints to check the value of flow time in each time step and the mass transfer as well. This is not woriking, it always print "mass transfer is 0" and "Flow time is 0" a lot of times in the console (I guess one for each cell...)

Could anybody give me any hint to define my mass transfer for Phase Interactions in a transient multiphase computation?

THanks in advance!


All times are GMT -4. The time now is 18:25.