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

UDF for phase change

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By N400
  • 1 Post By N400
  • 1 Post By CFD Engineer
  • 1 Post By MDSHUJAN

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 23, 2012, 20:46
Default UDF for phase change
  #1
New Member
 
nowbelle
Join Date: Dec 2012
Posts: 3
Rep Power: 13
N400 is on a distinguished road
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_SAT-C_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_SAT-C_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_SAT-C_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?
SACHIN1639 likes this.
N400 is offline   Reply With Quote

Old   December 23, 2012, 23:35
Default
  #2
Senior Member
 
SSL
Join Date: Oct 2012
Posts: 226
Rep Power: 14
msaeedsadeghi is on a distinguished road
You may have not defined boundary conditions correctly. Please share files to check.
msaeedsadeghi is offline   Reply With Quote

Old   December 24, 2012, 00:09
Default
  #3
New Member
 
nowbelle
Join Date: Dec 2012
Posts: 3
Rep Power: 13
N400 is on a distinguished road
Quote:
Originally Posted by msaeedsadeghi View Post
You may have not defined boundary conditions correctly. Please share files to check.
My case and data files are bigger than the attachment allowing, may I send them to you via email?
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! ^_^
sircorp likes this.

Last edited by N400; December 24, 2012 at 02:14.
N400 is offline   Reply With Quote

Old   December 24, 2012, 04:09
Default
  #4
Senior Member
 
SSL
Join Date: Oct 2012
Posts: 226
Rep Power: 14
msaeedsadeghi is on a distinguished road
Yes. Please email me.
msaeedsadeghi is offline   Reply With Quote

Old   December 24, 2012, 04:40
Default
  #5
New Member
 
nowbelle
Join Date: Dec 2012
Posts: 3
Rep Power: 13
N400 is on a distinguished road
Thanks!
I just sent you the files via email, and l am looking forward your reply!
N400 is offline   Reply With Quote

Old   April 19, 2013, 04:51
Default
  #6
New Member
 
Join Date: Apr 2013
Posts: 1
Rep Power: 0
Shengchao Hu is on a distinguished road
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
Shengchao Hu is offline   Reply With Quote

Old   November 18, 2013, 01:33
Default
  #7
New Member
 
yangbin
Join Date: Nov 2013
Location: haerbin
Posts: 4
Rep Power: 12
yangbinsunshine is on a distinguished road
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.
yangbinsunshine is offline   Reply With Quote

Old   December 29, 2015, 23:28
Default
  #8
Member
 
Ram Kumar Pal
Join Date: Apr 2015
Posts: 38
Rep Power: 11
rampal is on a distinguished road
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
rampal is offline   Reply With Quote

Old   December 30, 2015, 02:16
Default
  #9
New Member
 
Join Date: Mar 2015
Posts: 12
Rep Power: 11
CFD Engineer is on a distinguished road
Hello,
Did you got the new UDF with condensation. Please i need it can you send it to cfdengineer44@gmail.com.

Thank You

Quote:
Originally Posted by N400 View Post
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_SAT-C_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_SAT-C_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_SAT-C_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?
SACHIN1639 likes this.
CFD Engineer is offline   Reply With Quote

Old   December 31, 2015, 00:15
Default
  #10
Member
 
Ram Kumar Pal
Join Date: Apr 2015
Posts: 38
Rep Power: 11
rampal is on a distinguished road
Dear friend, till now not successful to get results, as soon as result will came, I'll inform you.
rampal is offline   Reply With Quote

Old   December 31, 2015, 00:48
Default Reg Hooking the UDF
  #11
New Member
 
Join Date: Mar 2015
Posts: 12
Rep Power: 11
CFD Engineer is on a distinguished road
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.
CFD Engineer is offline   Reply With Quote

Old   June 15, 2016, 21:35
Default
  #12
New Member
 
SHUJAN
Join Date: Jun 2016
Posts: 17
Rep Power: 9
MDSHUJAN is on a distinguished road
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
Chiara_riccio likes this.
MDSHUJAN is offline   Reply With Quote

Old   March 5, 2019, 05:34
Default
  #13
New Member
 
jeet verma
Join Date: Mar 2019
Posts: 4
Rep Power: 7
jeet verma is on a distinguished road
Quote:
Originally Posted by rampal View Post
Dear friend, till now not successful to get results, as soon as result will came, I'll inform you.
hii i am working in same field and facing same problem can you please send me your udf at jeet.vrm18@gmail.com
jeet verma is offline   Reply With Quote

Old   March 5, 2019, 06:36
Default
  #14
Member
 
Ram Kumar Pal
Join Date: Apr 2015
Posts: 38
Rep Power: 11
rampal is on a distinguished road
I think, udf is not required. You can used evaporation condensation model under VOF multiphase model
rampal is offline   Reply With Quote

Old   March 6, 2019, 00:47
Default
  #15
New Member
 
jeet verma
Join Date: Mar 2019
Posts: 4
Rep Power: 7
jeet verma is on a distinguished road
Quote:
Originally Posted by rampal View Post
I think, udf is not required. You can used evaporation condensation model under VOF multiphase model
thankyou for your reply sir, i am using the same evaporation and condensation model but in my case condensation in missing, fluent only evaporate the liquid and unable to condensate simultaniously.
jeet verma is offline   Reply With Quote

Old   March 7, 2019, 00:44
Default
  #16
Member
 
Ram Kumar Pal
Join Date: Apr 2015
Posts: 38
Rep Power: 11
rampal is on a distinguished road
I think condensation should also happen, check once with fluent customer portal.
rampal is offline   Reply With Quote

Old   March 12, 2019, 08:01
Default
  #17
New Member
 
jeet verma
Join Date: Mar 2019
Posts: 4
Rep Power: 7
jeet verma is on a distinguished road
Quote:
Originally Posted by rampal View Post
I think condensation should also happen, check once with fluent customer portal.
sir you were also faced similar type of problem as i see above, can you please tell me how you solve that problem.
thankyou
jeet verma is offline   Reply With Quote

Old   March 13, 2019, 05:25
Default
  #18
Member
 
Ram Kumar Pal
Join Date: Apr 2015
Posts: 38
Rep Power: 11
rampal is on a distinguished road
Quote:
Originally Posted by jeet verma View Post
sir you were also faced similar type of problem as i see above, can you please tell me how you solve that problem.
thankyou
At that time, I tried to solve the issue but unfortunately could not find the reason of error. Contact once with fluent technical support for this. I have not found any article who have done evaporation condensation type problem by using evaporation condensation model of the fluent. Some people have done heat pipe and pulsating heat pipe problem by using udf on LEE MODEL, what I found is the evaporation condensation model is also based on LEE MODEL. I did not understand why evaporation condensation model of fluent is not solving the problem.

Presently I'm not doing this type of work, So I could not help you more. I'm sorry.
rampal is offline   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
UDF Cmu change selçuk ataş FLUENT 2 July 19, 2017 12:24
UDF to change Rotation Speed in a MRF simulation Mike FLUENT 3 September 27, 2011 06:46
UDF to change BC from Wall to Grid Line Aaron Smith FLUENT 0 February 21, 2006 09:14
Change Courant number from UDF HS FLUENT 0 December 1, 2005 05:16
UDF...UDF...UDF...UDF Luc SEMINEL FLUENT 0 November 25, 2002 04:03


All times are GMT -4. The time now is 05:50.