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

Help needed on UDF for modification of default syamlal o' brien drag law

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 15, 2009, 18:06
Default Help needed on UDF for modification of default syamlal o' brien drag law
  #1
New Member
 
Ahad Imtiaz
Join Date: Jul 2009
Posts: 7
Rep Power: 17
caai9 is on a distinguished road
I am working on the 3D simulation of fluidized bed, for this purpose i need to modify the drag law for my conditions. I have coded my udf and compiled it in the fluent, however when i initialize the problem i get the following error:


Error: get_udf_function: function custom_drag_syam::libudf has wrong type: 2 != 3
Error Object: ()

As i am new to udf coding i am unable to identify the problem.Please help
Thank you.
caai9 is offline   Reply With Quote

Old   July 28, 2009, 13:10
Default
  #2
Senior Member
 
Micael
Join Date: Mar 2009
Location: Canada
Posts: 157
Rep Power: 18
Micael is on a distinguished road
Copy your UDF here.
Micael is offline   Reply With Quote

Old   July 28, 2009, 15:50
Thumbs up Well Thank You for Your Reply.....The udf is as follow
  #3
New Member
 
Ahad Imtiaz
Join Date: Jul 2009
Posts: 7
Rep Power: 17
caai9 is on a distinguished road
/* This is a routine for customizing default Syamlal drag law in Fluent 6.
The default drag law uses 0.8 (for void<=0.85) and 2.65 (void>0.85) for
bfac. This is for a min fluid vel of 17.6 cm/s. The current drag law has been tuned for a min fluid vel of 24.9 cm/s and uses 1.13 and 0.528 for these parameters. */

#include "udf.h"
#include "sg_mphase.h"
#include "mem.h"

#define pi 4.*atan(1.)
#define diam2 5.5e-4

DEFINE_EXCHANGE_PROPERTY(custom_drag_syam, cell, mix_thread, s_col, f_col)
{
Thread *thread_g, *thread_s;
real x_vel_g, x_vel_s, y_vel_g, y_vel_s, z_vel_g, z_vel_s, abs_v, slip_x, slip_y, slip_z,
rho_g, rho_s, mu_g, reyp, afac,
bfac, void_g, vfac, fdrgs, taup, k_g_s;

/* find the threads for the gas (primary) and solids (secondary phases).
These phases appear in columns 2 and 1 in the Interphase panel respectively*/

thread_g = THREAD_SUB_THREAD(mix_thread, s_col);/*gas phase*/
thread_s = THREAD_SUB_THREAD(mix_thread, f_col);/* solid phase*/

/* find phase velocities and properties*/

x_vel_g = C_U(cell, thread_g);
y_vel_g = C_V(cell, thread_g);
z_vel_g = C_W(cell, thread_g);

x_vel_s = C_U(cell, thread_s);
y_vel_s = C_V(cell, thread_s);
z_vel_s = C_W(cell, thread_s);

slip_x = x_vel_g - x_vel_s;
slip_y = y_vel_g - y_vel_s;
slip_z = z_vel_g - z_vel_s;

rho_g = C_R(cell, thread_g);
rho_s = C_R(cell, thread_s);

mu_g = C_MU_L(cell, thread_g);

/*compute slip*/
abs_v = sqrt(slip_x*slip_x + slip_y*slip_y + slip_z*slip_z);

/*compute reynolds number*/

reyp = rho_g*abs_v*diam2/mu_g;

/* compute particle relaxation time */

taup = rho_s*diam2*diam2/18./mu_g;

void_g = C_VOF(cell, thread_g);/* gas vol frac*/

/*compute drag and return drag coeff, k_g_s*/

afac = pow(void_g,4.14);

if(void_g<=0.85)
bfac = 1.13*pow(void_g, 1.28);
else
bfac = pow(void_g, 0.528);

vfac = 0.5*(afac-0.06*reyp+sqrt(0.0036*reyp*reyp+0.12*reyp*(2.*bfac-
afac)+afac*afac));
fdrgs = void_g*(pow((0.63*sqrt(reyp)/vfac+4.8*sqrt(vfac)/vfac),2))/24.0;

k_g_s = (1.-void_g)*rho_s*fdrgs/taup;

return k_g_s;

}
caai9 is offline   Reply With Quote

Old   July 28, 2009, 15:52
Default Please check th udf for me
  #4
New Member
 
Ahad Imtiaz
Join Date: Jul 2009
Posts: 7
Rep Power: 17
caai9 is on a distinguished road
Though i figured out out what the error meant, however my udf is still not working as intended.
caai9 is offline   Reply With Quote

Old   July 28, 2009, 21:57
Default
  #5
Senior Member
 
Micael
Join Date: Mar 2009
Location: Canada
Posts: 157
Rep Power: 18
Micael is on a distinguished road
What do you mean by "not working as intended"?
Micael is offline   Reply With Quote

Old   July 29, 2009, 09:15
Default
  #6
New Member
 
Ahad Imtiaz
Join Date: Jul 2009
Posts: 7
Rep Power: 17
caai9 is on a distinguished road
Well Micael, what i meant is that the bed is rising 1.5*initial height approx, and i expect it to rise more. So if u kindly tell me that the udf i wrote or i would say modified is correct or not. So that i can figure out the actual problem. Thank you
caai9 is offline   Reply With Quote

Old   July 29, 2009, 11:27
Default
  #7
Senior Member
 
Micael
Join Date: Mar 2009
Location: Canada
Posts: 157
Rep Power: 18
Micael is on a distinguished road
Ahad,
I think the UDF is correct. Try the UDF using the original (Fluent default) coefficient (0.8 (for void<=0.85) and 2.65 (void>0.85)). If the UDF is correct, then you should obtain the same result than the default Syamlal-O'Brien model.
That is:
if(void_g<=0.85)
bfac = 0.8*pow(void_g, 1.28);
else
bfac = pow(void_g, 2.65);

Have a good day

Micaël
Micael is offline   Reply With Quote

Old   July 29, 2009, 15:25
Default
  #8
New Member
 
Ahad Imtiaz
Join Date: Jul 2009
Posts: 7
Rep Power: 17
caai9 is on a distinguished road
Micael Thank you once again, yes you are right i should check with the default values.

You too have a nice day.
caai9 is offline   Reply With Quote

Old   July 9, 2010, 06:34
Default
  #9
New Member
 
srinivas
Join Date: Feb 2010
Posts: 9
Rep Power: 16
sri99iitm is on a distinguished road
hi dude ..can u send case n data files of 3d fluidized bed modlling plzzz?? my id phoenix52348@gmail.com
sri99iitm is offline   Reply With Quote

Old   August 20, 2014, 09:52
Default
  #10
isa
New Member
 
Iman E. Afrooz
Join Date: Aug 2014
Posts: 1
Rep Power: 0
isa is on a distinguished road
Quote:
Originally Posted by caai9 View Post
I am working on the 3D simulation of fluidized bed, for this purpose i need to modify the drag law for my conditions. I have coded my udf and compiled it in the fluent, however when i initialize the problem i get the following error:


Error: get_udf_function: function custom_drag_syam::libudf has wrong type: 2 != 3
Error Object: ()

As i am new to udf coding i am unable to identify the problem.Please help
Thank you.
Hi Ahad
I wanna model a bubbling fluidized bed reactor (3D) using ANSYS FLUENT. Could you please help by sending me your model? or if you have any tutorials for 3D BFBs?
Thanks

ie.afrooz@yahoo.com
isa 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
Low Reynolds Number Drag Law - UDF Daggemann FLUENT 0 April 30, 2009 06:02
About UDF for pressure Drag mkrao FLUENT 2 February 8, 2009 06:51
multiphase model and drag law Yasmail AKARIOUH FLUENT 0 April 29, 2008 08:44
UDF for Drag Srivatsan FLUENT 1 January 2, 2007 08:13
access drag coeff and udf for granular temp jwwang FLUENT 0 May 22, 2006 01:48


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