|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
一下是我写的UDF,目的是把出口的第二组分的体积分数通过质量分数转化到进口,同时把湿度存储在内存,在后处理显示humidity,但是程序interpreted后,显示“t definition shaows previous definition”,这是什么原因呢?恳请各位大侠指教。
#include "udf.h"
#define WALL1_ID 18
real avg_temp=0.0;
real a_temp=0.62;
real b_temp=15.0;
DEFINE_ADJUST(wall1_avg_temp, domain)
{
real NV_VEC(A);
real f_avg=0.0;
real sum_T_A=0.0,sum_A=0.0;
face_t f;
Thread*f_thread;
f_thread = Lookup_Thread(domain, WALL1_ID);
begin_f_loop(f, f_thread)
{
F_AREA(A,f,f_thread);
sum_A+=NV_MAG(A);
sum_T_A+=NV_MAG(A)*F_YI(f,f_thread,1);
}
end_f_loop(f, f_thread)
f_avg=sum_T_A/sum_A;
avg_temp= f_avg*a_temp;
}
DEFINE_PROFILE(Wall2_T,t,position)
{
face_t f;
Thread *t;
begin_f_loop(f,t)
{
F_PROFILE(f,t,position)=avg_temp;
}
end_f_loop(f,t)
}
DEFINE_ON_DEMAND(humidity)
{
Domain*d;
real h_avg=0.0;
real NV_VEC(B);
real h_c_temp=0.0;
cell_t c;
Thread *t;
real xc[ND_ND];
real sum_T_B=0.0,sum_B=0.0;
d=Get_Domain(1);
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
sum_B+=C_VOLUME(c,t)*C_YI(c,t,0);
sum_T_B+=C_VOLUME(c,t)*C_YI(c,t,1);
}
end_c_loop(c,t)
h_avg=sum_T_B/sum_B;
h_c_temp=h_avg/b_temp;
begin_c_loop(c,t)
{
C_UDMI(c,t,0)=h_c_temp;
}
end_c_loop(c,t)
}
} |
|