CFD Online Logo CFD Online URL
Home > Forums > Fluent UDF and Scheme Programming

UDF for Population Blance Model (PBM)

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

LinkBack Thread Tools Display Modes
Old   March 6, 2013, 07:41
Default UDF for Population Blance Model (PBM)
Yanlong Li
Join Date: Jan 2013
Location: BeiJing
Posts: 47
Rep Power: 6
Yanlong Li is on a distinguished road
Hi guys,
I'm trying to change the drag law for PBM, I knew there were several bubbles in a cell, but I don't know how to get the diameters, so I write this code to define a equal diameter, but it does not work, the error messages:
"Divergence detected in AMG solver:mp-x-momentum -> Decreasing coarsening group size!"
"Divergence detected in AMG solver:mp-x-momentum -> Increasing relaxation sweep"
"Divergence detected in AMG solverressure correction -> Turning off correction scaling!"
"Divergence detected in AMG solver:Pressure correction -> Increasing relaxation sweep!"

my code:
#include "udf.h"
DEFINE_EXCHANGE_PROPERTY(drag_ceofficient,c,t,s_co l,f_col)
real Coe,Re,We,Cd,v_slip,d,f,tp,surface_tension = 1.82;
Thread *t_l,*t_g;
t_l = THREAD_SUB_THREAD(t,f_col);
t_g = THREAD_SUB_THREAD(t,s_col);
d = pow(6.*C_VOLUME(c,t_g)/M_PI,1./3.);
v_slip = sqrt(pow(C_U(c,t_l) - C_U(c,t_g),2.0) + pow(C_V(c,t_l) - C_V(c,t_g),2.0) + pow(C_W(c,t_l) - C_W(c,t_g),2.0));
Re = C_R(c,t_l)*d*v_slip/C_MU_L(c,t_l);
if (Re < 0.49)
Cd = 16.0/Re;
else if (Re < 100.0)
Cd = 20.68/(pow(Re,0.643));
else if (Re > 100.0)
Cd = 6.3/(pow(Re,0.385));
We = C_R(c,t_l)*d*pow(v_slip,2.0)/surface_tension;
if (Re > 2065.1/pow(We,2.6))
Cd = We/3.0;
else if (We > 8.0)
Cd = 8.0/3.0;
f = Cd*Re/24.0;
tp = C_R(c,t_g)*d*d/18.0/C_MU_L(c,t_l);
Coe = C_VOF(c,t_g)*C_VOF(c,t_l)*C_R(c,t_g)*f/tp;
return Coe;

please help me
Yanlong Li is offline   Reply With Quote


Thread Tools
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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Use of k-epsilon and k-omega Models Jade M Main CFD Forum 28 November 5, 2017 23:40
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 06:36
UDF: how to know domain number in the model? mssound FLUENT 0 May 17, 2010 15:00
UDF for Herschel-Bulkely model emad Fluent UDF and Scheme Programming 5 July 20, 2009 08:16
UDF of Zimont model in fluent Z Main CFD Forum 0 February 17, 2005 04:07

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