|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
#include "udf.h"
#define RH 0.382
#define Mini 0.8
#define Me 0.0
#define solid_density 1100.0
#define porous 0.377
#define porous_id 13
DEFINE_INIT(my_init_func,d)
{
#if !RP_HOST
cell_t c;
Thread *t;
real xc[ND_ND];
thread_loop_c(t,d)
{
begin_c_loop_all(c,t)
{
C_UDMI(c,t,0)=0.0;
}
end_c_loop_all(c,t)
}
t=Lookup_Thread(d,porous);
begin_c_loop_all(c,t)
{
C_UDMI(c,t,0)=Mini;
}
end_c_loop_all(c,t)
#endif
}
DEFINE_ADJUST(my_adjust,d)
{
#if !RP_HOST
Thread *t;
cell_t c;
real k,n,Mgrad,Sw;
real hfg;
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
C_UDMI(c,t,1)=0.0;
C_UDMI(c,t,2)=0.0;
if(C_UDSI(c,t,0)>1.0) C_UDSI(c,t,0)=1.0;
if(C_UDSI(c,t,0)<0.0) C_UDSI(c,t,0)=0.0;
}
end_c_loop(c,t)
}
Lookup_Thread(d,porous);
begin_c_loop(c,t)
{
k=0.02958-0.4456*RH+0.01215*(C_T(c,t)-273.15);
n=0.13365+1.93653*RH-1.77431*pow(RH,2.0)+0.009468*(C_T(c,t)-273.15);
Mgrad=1.0/3600.0*(C_UDMI(c,t,0)-Me)*(-k*n*pow(CURRENT_TIME/3600.0,n-
1.0));
C_UDMI(c,t,3)=1.0-porous-0.25* C_UDMI(c,t,0);
C_UDMI(c,t,1)=-solid_density*(1.0-C_UDMI(c,t,3))*Mgrad;
hfg=2503000-2386.0*(C_T(c,t)-273.15);
C_UDMI(c,t,2)=solid_density*(1.0-C_UDMI(c,t,3))*Mgrad*hfg;
C_UDMI(c,t,0)= C_UDMI(c,t,0)+CURRENT_TIMESTEP*Mgrad;
if(C_UDMI(c,t,0)<0.0) C_UDMI(c,t,0)=0.0;
}
end_c_loop(c,t)
#endif
}
DEFINE_SOURCE(uds_source,c,t,dS,eqn)
{
dS[eqn] = 0.0;
return C_UDMI(c,t,1);
}
DEFINE_SOURCE(energy_source,c,t,dS,eqn)
{
dS[eqn] = 0.0;
return C_UDMI(c,t,2);
}
DEFINE_PROPERTY(solid_density_macro,c,t)
{
return solid_density*(1.0-C_UDMI(c,t,3));
}
DEFINE_PROPERTY(solid_k,c,t)
{
return 0.0863+0.00134*C_UDMI(c,t,0)/(C_UDMI(c,t,0)+1.0);
}
DEFINE_PROPERTY(gas_density,c,t)
{
return 101.325/(0.287*C_T(c,t));
}
DEFINE_SPECIFIC_HEAT(my_user_cp, T, Tref, h, yi)
{
#if !RP_HOST
real cp;
real tem=T-273.15;
cp= 1009.26-4.0403e-3*tem+6.1759e-4*pow(tem,2.0)-4.097e-7*pow(tem,3.0);
*h = cp*(T-Tref);
return cp;
#endif
}
DEFINE_PROFILE(porous_cal, t, nv)
{
cell_t c;
begin_c_loop(c,t)
C_PROFILE(c,t,nv) = C_UDMI(c,t,3);
end_c_loop(c,t)
}
使用Visual Studio调试时出现
错误 C1083 无法打开包括文件: “global.h”: No such file or directory Project4 e:\\udf\project4\project4\udf.h 22
不知道怎么解决,请大家帮帮忙
|
|