CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT

Cant understand the UDF...need help

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 23, 2007, 13:16
Default 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<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_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

  Reply With Quote

Old   February 25, 2007, 18:17
Default 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
  Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Dynamic Mesh UDF Qureshi FLUENT 7 March 23, 2017 07:37
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 22:14
How to add a UDF to a compiled UDF library kim FLUENT 3 October 26, 2011 21:38
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 04:03
UDF, UDF, UDF, UDF Luc SEMINEL Main CFD Forum 0 November 25, 2002 04:01


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