# problem regarding droplet diameter udf

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 April 23, 2018, 13:26 problem regarding droplet diameter udf #1 New Member   Chaitanya Join Date: Jun 2016 Posts: 7 Rep Power: 9 Dear members, I am performing flow boiling simulations. In order to give secondary phase diameter, I have written the UDF for droplet diameter calculation. But, I am getting divergence after the first iteration only. This is my udf... #include "udf.h" DEFINE_PROPERTY(droplet_dia,c,t) { Thread *thread_p, *thread_s; real rho_p, rho_s, x_vel_p, y_vel_p, x_vel_s, y_vel_s, abs_u_p, abs_u_s, mu_p, mu_s, rey_p, rey_s, dd, sig; Thread *tm = THREAD_SUPER_THREAD(t); Thread *p = THREAD_SUB_THREAD(tm, 0); Thread *s = THREAD_SUB_THREAD(tm, 1); x_vel_p = C_U(c, p); y_vel_p = C_U(c, p); x_vel_s = C_U(c, s); y_vel_s = C_U(c, s); rho_p = C_R(c, p); rho_s = C_R(c, s); mu_p = C_MU_L(c, p); mu_s = C_MU_L(c, s); abs_u_p = sqrt(x_vel_p*x_vel_p + y_vel_p*y_vel_p); abs_u_s = sqrt(x_vel_s*x_vel_s + y_vel_s*y_vel_s); rey_p = (0.0126*abs_u_p*rho_p)/mu_p; rey_s = (0.0126*abs_u_s*rho_s)/mu_s; sig = 0.00327; dd = 0.28*(sig/(rho_p*pow(abs_u_p,2)))*(pow(rey_s,(-1/6)))*(pow(rey_p,(2/3)))*(pow((rho_p/rho_s),(-1/3)))*(pow((mu_p/mu_s),(2/3))); return dd; } So, possible suggestions that will use to solve the problem are highly appreciated Thanking you

 April 30, 2018, 14:01 #2 Senior Member   Micael Join Date: Mar 2009 Location: Canada Posts: 156 Rep Power: 18 two things pop up to me at first glance: - for y velocity component, you probably want C_Y instead of C_U macro. - you have some integer divisions, like 2/3. Those won't return what you might expect. Have a look into C programming regarding that topic. For instance, in C, 2/3 returns 0. However, 2./3 returns 0.6666 (actually will returns more digit than that).

May 8, 2018, 10:58
#3
Member

tahir
Join Date: May 2010
Posts: 35
Rep Power: 15
Quote:
 Originally Posted by Micael two things pop up to me at first glance: - for y velocity component, you probably want C_Y instead of C_U macro. - you have some integer divisions, like 2/3. Those won't return what you might expect. Have a look into C programming regarding that topic. For instance, in C, 2/3 returns 0. However, 2./3 returns 0.6666 (actually will returns more digit than that).
Hi
Did you find the answer. I am also doing the twophase simulation in fluent and also need help.
Can we communicate on skype

 Thread Tools Search this Thread Search this Thread: Advanced Search Display Modes Linear Mode

 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 OffTrackbacks are Off Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Rizwan Fluent UDF and Scheme Programming 40 March 18, 2018 06:05 nb92 Fluent Multiphase 0 February 28, 2014 10:36 Zhengyu Gao Fluent UDF and Scheme Programming 0 December 6, 2013 19:45 jeevan kumar FLUENT 2 February 25, 2009 00:43 Michael FLUENT 1 December 9, 2008 07:51

All times are GMT -4. The time now is 12:03.

 Contact Us - CFD Online - Privacy Statement - Top