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

Energy source for cell that are adjacent to wall

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 28, 2016, 00:15
Default Energy source for cell that are adjacent to wall
  #1
New Member
 
Bob
Join Date: Dec 2016
Posts: 3
Rep Power: 9
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


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Natural convection in a closed domain STILL NEEDING help! Yr0gErG FLUENT 4 December 2, 2019 00:04
[OpenFOAM.org] Patches to compile OpenFOAM 2.2 on Mac OS X gschaider OpenFOAM Installation 136 October 10, 2017 17:25
[Other] OpenFOAM Installation for navalFoam sachinlb OpenFOAM Community Contributions 22 July 28, 2017 05:26
[swak4Foam] swak4foam building problem GGerber OpenFOAM Community Contributions 54 April 24, 2015 16:02
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 15:35.