|
楼主 |
发表于 2014-11-12 10:42:00
|
显示全部楼层
大家好,我查看了帮助文件后已经把udf改成了如下,可是还是同样的错误啊,到底是为什么呢。。。求高手指点
#include "udf.h"
DEFINE_PROPERTY(cell_density,cell,thread)
{
int phase_domain_index;
cell_t cell;
Thread *cell_thread;
Domain *subdomain;
Domain *mixture_domain;
real rho_licl;
sub_domain_loop(subdomain, mixture_domain, phase_domain_index) /* loop over all subdomains (phases) in the superdomain (mixture) */
{
if (DOMAIN_ID(subdomain) == 2) /* loop if secondary phase */
thread_loop_c (cell_thread,subdomain) /* loop over all cell threads in the secondary phase domain */
{
begin_c_loop_all (cell,cell_thread) /* loop over all cells in secondary phase cell threads */
{
real T=C_T(cell,cell_thread); /*得到次相温度*/
real MF=C_YI(cell,cell_thread,0); /* 得到次相中LiCl的质量分数,在material里在LiCl是在第一个位置,所以是0*/
rho_licl=(322*(1+1.993771843*pow((1-(T+273.15)/647.3),0.3333333333333333333333333)
+1.0985211604*pow((1-(T+273.15)/647.3),0.6666666666666666666667)
-0.5094492996*pow((1-(T+273.15)/647.3),1.6666666666666666666667)
-1.761912427*pow((1-(T+273.15)/647.3),5.333333333333333333)
-44.9005480267*pow((1-(T+273.15)/647.3),14.333333333333333)
-723692.2618632*pow((1-(T+273.15)/647.3),36.66666666666666667)))
*(1+0.540966*(MF/(1-MF))-0.303792*pow((MF/(1-MF)),2)
+0.100791*pow((MF/(1-MF)),3)); /*密度和温度质量分数的关系式*/
return rho_licl;
}
end_c_loop_all (cell,cell_thread)
}
}
}
|
|