December 1, 2022, 07:55
|
Floating point while Run Calculation because using UDF
|
#1
|
New Member
Imam Tantowi
Join Date: Jul 2022
Posts: 1
Rep Power: 0
|
Hello every one.
Sorry take your time. here, I want to request your help to solving my simulation problem.
Now, I am simulating cooling process of grain. the fluid medium of cooling is moist air. because I want to know temperatur and moisture content of grain, I initiate to model this problem with eulerian multhiphase in ANSYS Fluent. I model the moist air as mixture of air and water vapor, and grain as mixture of dry grain dan water liquid. Because of that, mass transfer UDF has build to describe a moisture transfer phenomena. this is my UDF
Code:
#include "udf.h"
#include "mem.h"
#include "sg_mphase.h"
#include "math.h"
static real EMC(cell_t c, Thread *tu, int v) /*this function to know Equilibrium moisture content*/
{
real MMwl, R_bar;
MMwl=18.02; /*Molecular weight of water*/
R_bar=8314.47;
real pv;
pv=C_R(c,tu)*C_YI(c,tu,v)*R_bar*C_T(c,tu)/MMwl;
real RH,emc,pg;
pg=610.78*exp(17.296*(C_T(c,tu)-273.15)/(237.3+C_T(c,tu)-273.15));
RH=pv/pg;
emc=pow(-1*log(1-RH)/(8.654*pow(10,-5)*(C_T(c,tu)-273.15+49.81)),1/1.8634);
emc=emc/100;
return emc;
}
static real masstf_coeff(cell_t c, Thread *tj,Thread *tu)
{
real h,Sh;
real Dv=2.6*pow(10,-5); /*mass diffusivity of air*/
real bul=0.6; /*roundness of grain */
real d=C_PHASE_DIAMETER(c,tj); /*grain's diameter*/
real NV_VEC(v), vel, Re, Sc,Ai,vof;
NV_DD(v,=,C_U(c,tj),C_V(c,tj),C_W(c,tj),-,C_U(c,tu),C_V(c,tu),C_W(c,tu));
vel=NV_MAG(v);
vof=C_VOF(c,tj);
Ai=6*vof/(d*bul);
Re=C_R(c,tu)*vel/(C_MU_L(c,tu)*Ai*bul);
Sc=C_MU_L(c,tu)/(C_R(c,tu)*Dv);
Sh=2+0.552*pow(Re,0.5)*pow(Sc,1/3);
h=Sh*Dv/d;
return h;
}
DEFINE_MASS_TRANSFER(pengeringan_source,c,t,j,l,u,v)
{
real mdot=0;
Thread *jg=THREAD_SUB_THREAD(t,j);
Thread *udr=THREAD_SUB_THREAD(t,u);
real X,Xeq,h;
X=C_YI(c,jg,l)/(1-C_YI(c,jg,l));
real bul=0.6; /*kebulatan*/
real d=C_PHASE_DIAMETER(c,jg); /*Grain diameter*/
real vof=C_VOF(c,jg); /*volume fraction of grain*/
real Ai,A;
Ai=6*vof/(d*bul); /*interfacial area*/
h=masstf_coeff(c,jg,udr);
Xeq=EMC(c,udr,v);
mdot=h*Ai*(X-Xeq);
return mdot;
}
the compiling of code is success. but when I run the calculation. Floating point is happen. there is any one know what the problem?.
Regard Imam
|
|
|