UDF for phase change
I want to simulate the phase tranfer in the heat pipe, and a udf was compiled in FLUENT,which is as follow:
#include "udf.h" #include "sg_mphase.h" #define T_SAT 323 #define LAT_HT 2356e3 DEFINE_SOURCE(vap_src, cell, pri_th, dS, eqn) { Thread *mix_th, *sec_th; real m_dot_v; mix_th = THREAD_SUPER_THREAD(pri_th); sec_th = THREAD_SUB_THREAD(mix_th, 1); /*m_dot_v=0.;*/ if(C_T(cell, mix_th)>=T_SAT) { m_dot_v = 0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)*fabs(C_T(cell, sec_th)  T_SAT)/T_SAT; dS[eqn] = 0.; } if(C_T(cell, mix_th)<=T_SAT) { m_dot_v = 0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)*fabs(T_SATC_T(cell,pri_th))/T_SAT; dS[eqn] = 0.1*C_R(cell, pri_th)*fabs(C_T(cell, pri_th)  T_SAT)/T_SAT; } return m_dot_v ; } DEFINE_SOURCE(liq_src, cell, sec_th, dS, eqn) { Thread * mix_th, *pri_th; real m_dot_l; mix_th = THREAD_SUPER_THREAD(sec_th); pri_th = THREAD_SUB_THREAD(mix_th, 0); /*m_dot_l=0.;*/ if(C_T(cell, mix_th)>=T_SAT) { m_dot_l = 0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)*fabs(C_T(cell, sec_th)  T_SAT)/T_SAT; dS[eqn] = 0.1*C_R(cell, sec_th)*fabs(C_T(cell, sec_th)  T_SAT)/T_SAT; } if(C_T(cell, mix_th)<=T_SAT) { m_dot_l = 0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)*fabs(T_SATC_T(cell,pri_th))/T_SAT; dS[eqn] =0.; } return m_dot_l; } DEFINE_SOURCE(enrg_src, cell, mix_th, dS, eqn) { Thread *pri_th, *sec_th; real m_dot; pri_th = THREAD_SUB_THREAD(mix_th, 0); sec_th = THREAD_SUB_THREAD(mix_th, 1); if(C_T(cell, mix_th)>=T_SAT) { m_dot = 0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)*fabs(C_T(cell, sec_th)  T_SAT)/T_SAT; dS[eqn] = 0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)*LAT_HT/T_SAT; } if(C_T(cell, mix_th)<=T_SAT) { m_dot = 0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)*fabs(T_SATC_T(cell,pri_th))/T_SAT; dS[eqn] = 0.1*C_VOF(cell, pri_th)*C_R(cell, pri_th)*LAT_HT/T_SAT; } return LAT_HT*m_dot; } Using the code above, I can simulate the evaporation, but the condensation did not appear, even the temperature of vapor was much lower than the saturation temperature. Now I am so confused. Anyone can help me? 
You may have not defined boundary conditions correctly. Please share files to check.

Quote:
My email address is nowbelle@yeah.net Thank you ! PS: Anyone else who is intersting in my problem or have the relevant experiences please contact me, we can communicate directly and quickly via emails! ^_^ 
Yes. Please email me.

Thanks!:)
I just sent you the files via email, and l am looking forward your reply! 
Hi,N400
I am writing the udf for the phase change of LNG，i have some questions to share with you.Could you send me your files ? Thanks very much! My email adress:shengchaohu2012@163.com 
Hi,I am working on this udf recently.and I am confused about this sentence"m_dot_v = 0.1*C_VOF(cell, sec_th)*C_R(cell, sec_th)*fabs(C_T(cell, sec_th)  T_SAT)/T_SAT".
First,in this sentence,the coefficent is 0.1,but i do not know why. Second,what is the unit of "m_dot_v"? Thank you very much,and any advice will be highly appreciated. 
Dear friends,
I am doing the simulation of heat pipe in Fluent. I'm using udf for mass and energy source, but results are not coming specially condensation in condenser zone . All of you done this problem some times ago. I think you are more familiar with this problem. Please help me regarding this so can I complete my project work. I will be very very thankful for your valuable help 
Hello,
Did you got the new UDF with condensation. Please i need it can you send it to cfdengineer44@gmail.com. Thank You Quote:

Dear friend, till now not successful to get results, as soon as result will came, I'll inform you.

Reg Hooking the UDF
Dear Friends,
i am using the UDF which you showed on cfdonline.com in the comment given by Mr nowbelle, it is good but i am confuse where to hook the UDF. I mean i had compiled it but which option should i selecte in Cell Zone condition and for which domain i have to define which part of the UDF. i tried giving udf_vap:: for vapour domain and udf_liq:: for liquid domain but it is showing error. 
Hi N400. Did you complete your udf, and got condensation? I am working on a similar udf for simulating a heat pipe. Please can you send me your final udf at mdshujan@nevada.unr.edu
If condensation doesn't work, you can change the coefficient from 0.1 to other values, you can also try other condensation models instead of LEE Model. Thanks and good luck 
All times are GMT 4. The time now is 14:18. 