CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   Problem with UDF (Drag model) (http://www.cfd-online.com/Forums/fluent/83571-problem-udf-drag-model.html)

 understate January 4, 2011 06:01

Problem with UDF (Drag model)

Hello,
I tried to implement Tomiyama Drag Model in FLUENT. The Drag Coefficient is saved by UDMI. My problem is, that this variable is always 0,666667. The limit value should be 2,666667. I would rather expect this value to change, when I change the bubble diameter. This is not the case. Anyway, the modification of the bubble diameter has an influence on my calculation, but that can also be because d_p is used to calculate the drag force. I also tried to use either C_D1 or C_D2 without the if else condition, but I got the same result again.

Thank you very much.

Regards

#include "udf.h"
#define g 9.81
#define Drag_Coefficient 0
DEFINE_EXCHANGE_PROPERTY(tomiyama_drag, cell, mxtr_thrd, scnd_clmn, frst_clmn)
{

real diam = C_PHASE_DIAMETER(cell, frst_thrd);
real diaQ = diam * diam;
real NV_VEC(V), velo, Re, f_d, surface_t, rho_p, rho_s, delta_rho, Eo, C_D1, C_D2, C_D;
NV_DD(V, =, C_U(cell, frst_thrd), C_V(cell, frst_thrd), C_W(cell, frst_thrd),
-, C_U(cell, scnd_thrd), C_V(cell, scnd_thrd), C_W(cell, scnd_thrd));
velo = NV_MAG(V);
Re = RE_NUMBER(C_R(cell, scnd_thrd), velo, diam, C_MU_L(cell, scnd_thrd));
rho_p = C_R(cell, scnd_thrd);
rho_s = C_R(cell, frst_thrd);

surface_t = 0.025; /*surface tension coefficient */

delta_rho = (rho_p - rho_s);
Eo = (g * delta_rho * diaQ) / surface_t;

C_D1 = 24. * (1. + 0.15 * pow(Re, 0.687)) / Re;
C_D2 = 8. / 3.* Eo / (Eo * 4.);

if (C_D1 > C_D2)
C_D = C_D1;
else
C_D = C_D2;

C_UDMI(cell, mxtr_thrd, Drag_Coefficient) = C_D; /*PUT C_D IN USER DEFINED MEMORY*/

f_d = 0.75 * C_D * velo;

#define DRAG_COEFF(fd,vofS,rhop,diam) ((fd)*(vofS)*(rhop)/(diam))
return DRAG_COEFF(f_d, C_VOF(cell, frst_thrd), C_R(cell, scnd_thrd), diam);
}

 All times are GMT -4. The time now is 09:47.