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

problem regarding droplet diameter udf

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 23, 2018, 14:26
Default problem regarding droplet diameter udf
  #1
New Member
 
Chaitanya
Join Date: Jun 2016
Posts: 7
Rep Power: 9
CMICT is on a distinguished road
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
CMICT is offline   Reply With Quote

Old   April 30, 2018, 15:01
Default
  #2
Senior Member
 
Micael
Join Date: Mar 2009
Location: Canada
Posts: 156
Rep Power: 18
Micael is on a distinguished road
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).
Micael is offline   Reply With Quote

Old   May 8, 2018, 11:58
Default
  #3
Member
 
tahir
Join Date: May 2010
Posts: 35
Rep Power: 15
ENGRTAHIR is on a distinguished road
Quote:
Originally Posted by Micael View Post
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
ENGRTAHIR is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
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


All times are GMT -4. The time now is 13:23.