|
|
楼主,我受你的思路的启发,在自己的UDF中采用了这样的方法,先adjust将计算出来的值置于边界UDM中,然后用profile,下面这段程序解释进fluent中没有问题,但一旦初始化就会报错无法运行,能不能给点指点,谢谢。
DEFINE_ADJUST(adjust_wall_temp,d)
{
Thread *t;
face_t f;
real time;
int id_f=5;
t=Lookup_Thread(d,id_f);
time=RP_Get_Integer("time_step" ;
thread_loop_f(t,d)
{
begin_f_loop(f,t)
{
if (time<2)
F_UDMI(f,t,6)=tw0;
else
F_UDMI(f,t,6)=F_T(f,t)+(tw0-F_T(f,t))/(1+h*F_UDMI(f,t,2));/*adjust wall temperature*/
}
end_f_loop(f,t)
}
}
DEFINE_PROFILE(wall_temp,t,position)
{
face_t f;
Domain *d;
int id_f=5;
d=Get_Domain(1);
t=Lookup_Thread(d,id_f);
begin_f_loop(f,t)
{
F_PROFILE(f,t,position)=F_UDMI(f,t,6);
}
end_f_loop(f,t)
} |
|