# Cant understand the UDF...need help

 Register Blogs Members List Search Today's Posts Mark Forums Read

 February 23, 2007, 13:16 Cant understand the UDF...need help #1 Shanti Guest   Posts: n/a Hi I was reading the FLUENT manual. I couldnt understand the UDF example for mass transfer. In the following UDF it says that the mass transfer takes place gas to liquid and the magnitude is negative. Can I remove the negative sign and change the mass transfer direction from liq to gas? #include 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_SUBTHREAD(thread, from_index); Thread *liq = THREAD_SUBTHREAD(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,li q)-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); } Thanks, Shanti

 February 25, 2007, 18:17 Re: Cant understand the UDF...need help #2 Ronald Guest   Posts: n/a Hi Shanti, When the temperature of the liquid is more or equal to the saturation temperature mass is transfered from liquid to gas. that is the first if condition. When the teperature of the gas is cooled down to less than 373 and there is no mass transfer at that time then mass transfer from gas to liquid occurs which is typically condensation. Thanks Regards Ronald