CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   FLUENT (https://www.cfd-online.com/Forums/fluent/)
-   -   Need urgent help Regarding Drag coefficient (https://www.cfd-online.com/Forums/fluent/42320-need-urgent-help-regarding-drag-coefficient.html)

 srinivas September 16, 2006 12:25

Need urgent help Regarding Drag coefficient

hi sir, can any body help me to write UDF for drag coefficient. i have written UDF but its not working... i am attaching my UDF here. can any body find where is the mistake in UDF. Its very urgent.

My drag coefficient function is:

Cd = max{ 24(1+0.15*pow(Re,0.687))/24, 8Em/(3(Em+4))}

Re = density(l)*Dia*|Vg-Vl|/viscosity;

Dia = Diameter of bubble

|Vg-Vl|---> Relative slip velocity

Em = g*density diff*pow(Dia,2)/surface tension;

#include #define diam2 0.005

real x_vel_g, x_vel_l, y_vel_g, y_vel_l, z_vel_g, z_vel_l, U_vel, abs_v,

rho_g, rho_l, mu_l, reyp, k_g_s,sre,psv,sv,Em,f,vasu;

/* find the threads for the gas (secondary) */ /* and liquids (primary phases) */

/* find phase velocities and properties*/

x_vel_l = C_U(cell, thread_l); y_vel_l = C_V(cell, thread_l); z_vel_l = C_W(cell, thread_l); U_vel = (x_vel_l + y_vel_l + z_vel_l)/3;

rho_g = 1.225; /* density of gas */ rho_l = 998; /* density of liquid */ mu_l = 0.0001; /* viscosity of liquid */

/*compute slip*/ abs_v = sqrt(x_vel_g*x_vel_g + y_vel_g*y_vel_g + z_vel_g*z_vel_g);

/*compute Reynold's number*/ f=(U_vel-abs_v); if (f>0)

f=f; else

f=-f; reyp = rho_l*f*diam2/mu_l;/*Reynold number*/

sre = pow(reyp,-0.313); psv = pow(reyp,-1); sv = 24*psv + 3.6*sre; Em = 133946.8*diam2*diam2; vasu = 8*Em/(3*Em + 12); if(sv < vasu)

k_g_s = vasu; else

k_g_s = sv;

return k_g_s; }

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