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

Energy source for cell that are adjacent to wall

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

Reply
 
LinkBack Thread Tools Display Modes
Old   December 28, 2016, 01:15
Default Energy source for cell that are adjacent to wall
  #1
New Member
 
Bob
Join Date: Dec 2016
Posts: 3
Rep Power: 2
BIANBOSHEN is on a distinguished road
Dear all,
Now I am writing an UDF to define a energy source for cell that are adjacent to wall. The purpose is to add the heat transfer from wall to droplet in mist flow. Following is my UDF code. But after 12 iterations ,there is an error saying Error: > (greater-than): invalid argument : wrong type Error Object: 1.#inf.
I will be sincerely appreciate if you can solve my provblem.
Here is the code
DEFINE_SOURCE(liq_enrg_src, c, sec_th, dS, eqn)
{

Thread *mix_th, *pri_th, *t;
Domain *domain=Get_Domain(1);
int zone_ID=18;/*wall ID*/
real m_dot_d=0;
real kd;
real Cnt;
real a;
real Area[ND_ND];
real b;
real d;
real vg;
real Reg;
real tr;
real Enrg_Source=0;
face_t f;
mix_th = THREAD_SUPER_THREAD(sec_th);
pri_th = THREAD_SUB_THREAD(mix_th,0);
t=Lookup_Thread(domain,zone_ID);
begin_f_loop(f, t)
{
if(c == F_C0(f,t))
{
Cnt=(1.0-C_VOF(c,pri_th))*C_R(c,sec_th);
a=Cnt/C_R(c,pri_th);
if(a<0.3)
{
kd=0.18*sqrt(0.026/(C_R(c,pri_th)*0.008));
}
else
{
kd=pow(a,-0.85)*sqrt(0.026/(C_R(c,pri_th)*0.008));
}
m_dot_d=kd*Cnt;
vg=sqrt(pow(C_U(c,pri_th),2)+pow(C_V(c,pri_th),2)+ pow(C_W(c,pri_th),2));

Reg=C_R(c,pri_th)*vg*0.008/C_MU_L(c,pri_th);

d=0.00796*0.026/C_R(c,pri_th)/pow(C_VOF(c,pri_th)*vg,2)*pow(Reg,2/3)*pow(C_R(c,pri_th)/C_R(c,sec_th),-1/3)*pow(C_MU_L(c,pri_th)/C_MU_L(c,sec_th),2/3);

tr=3.14*sqrt(C_R(c,sec_th)*d*d*d/16/0.026);

b=pow(18*pow(C_K_L(c,pri_th)*tr,3)*C_R(c,pri_th)*L AT_HT*pow(m_dot_d,5)/pow(C_R(c,sec_th),4)/C_MU_EFF(c,pri_th)/(1.0-C_VOF(c,pri_th))/(F_T(f,t)-T_SAT),0.25);
F_AREA(Area,f,t);
Enrg_Source=(F_T(f,t)-T_SAT)*b/C_VOLUME(c,mix_th)/(1-C_VOF(c, pri_th))*NV_MAG(Area);
dS[eqn]=0;
//Enrg_Source=2;
return Enrg_Source;
}
}
end_f_loop(f, t)
}
BIANBOSHEN is offline   Reply With Quote

Reply

Tags
error, source term, udf code

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
Patches to compile OpenFOAM 2.2 on Mac OS X gschaider OpenFOAM Installation on Windows, Mac and other Unsupported Platforms 134 December 5, 2015 04:30
swak4foam building problem GGerber OpenFOAM Installation 54 April 24, 2015 16:02
OpenFOAM Installation for navalFoam sachinlb OpenFOAM Installation 21 June 23, 2014 08:07
Natural convection in a closed domain STILL NEEDING help! Yr0gErG FLUENT 3 June 12, 2013 02:12
Why FVM for high-Re flows? Zhong Lei Main CFD Forum 23 May 14, 1999 13:22


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