|
[Sponsors] |
April 23, 2018, 14:26 |
problem regarding droplet diameter udf
|
#1 |
New Member
Chaitanya
Join Date: Jun 2016
Posts: 7
Rep Power: 10 |
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, 15:01 |
|
#2 |
Senior Member
Micael
Join Date: Mar 2009
Location: Canada
Posts: 157
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, 11:58 |
|
#3 | |
Member
tahir
Join Date: May 2010
Posts: 35
Rep Power: 16 |
Quote:
Did you find the answer. I am also doing the twophase simulation in fluent and also need help. Can we communicate on skype |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ATTN ALL: SOLUTON TO UDF COMPILE PROBLEM | Rizwan | Fluent UDF and Scheme Programming | 40 | March 18, 2018 07:05 |
2D VOF Droplet evaporation model. Multi-component problem | nb92 | Fluent Multiphase | 0 | February 28, 2014 11:36 |
UDF Problem about Grid Motion !!! | Zhengyu Gao | Fluent UDF and Scheme Programming | 0 | December 6, 2013 20:45 |
UDF compiling problem in Flient 6.3 | jeevan kumar | FLUENT | 2 | February 25, 2009 01:43 |
UDF using problem, error happens-heip!! | Michael | FLUENT | 1 | December 9, 2008 08:51 |