CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   Help needed on UDF for modification of default syamlal o' brien drag law (http://www.cfd-online.com/Forums/fluent-udf/66457-help-needed-udf-modification-default-syamlal-o-brien-drag-law.html)

caai9 July 15, 2009 17:06

Help needed on UDF for modification of default syamlal o' brien drag law
 
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.

Micael July 28, 2009 12:10

Copy your UDF here.

caai9 July 28, 2009 14:50

Well Thank You for Your Reply.....The udf is as follow
 
/* 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 July 28, 2009 14:52

Please check th udf for me
 
Though i figured out out what the error meant, however my udf is still not working as intended.

Micael July 28, 2009 20:57

What do you mean by "not working as intended"?

caai9 July 29, 2009 08:15

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:confused:. Thank you

Micael July 29, 2009 10:27

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

caai9 July 29, 2009 14:25

Micael Thank you once again, yes you are right i should check with the default values.

You too have a nice day.:)

sri99iitm July 9, 2010 05:34

hi dude ..can u send case n data files of 3d fluidized bed modlling plzzz?? my id phoenix52348@gmail.com

isa August 20, 2014 08:52

Quote:

Originally Posted by caai9 (Post 222836)
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


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