|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
请教各位大神,我的问题是氯化锂溶液除去湿空气中的水蒸气,两相流用VOF模型,主相是湿空气,次相是溶液,湿空气和氯化锂溶液分别用组分输运模型,湿空气的组分有水蒸气和空气,溶液的组分是LiCl和液态水,我想定义氯化锂溶液的密度,这个密度是跟溶液的温度和质量分数有关系的,关系式有点复杂,程序如下。程序编译没问题,但是有说rho_licl definition shadows previous definitions,好像意思是会覆盖,所以我不明白返回值应该放在哪里。还有另外一个问题是初始化时却提示fatal error,不能初始化。求各位大神指点
#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.9937*pow((1-(T+273.15)/647.3),0.3333)
+1.0985*pow((1-(T+273.15)/647.3),0.6667)
-0.5094*pow((1-(T+273.15)/647.3),1.6667)
-1.7619*pow((1-(T+273.15)/647.3),5.3333)
-44.9005*pow((1-(T+273.15)/647.3),14.3333)
-723692.2618*pow((1-(T+273.15)/647.3),36.6667)))
*(1+0.5409*(MF/(1-MF))-0.303792*pow((MF/(1-MF)),2)
+0.1007*pow((MF/(1-MF)),3)); /*密度和温度质量分数的关系式*/
return rho_licl;
}
end_c_loop_all (cell,cell_thread)
}
}
}
|
|