24小时热门版块排行榜    

CyRhmU.jpeg
查看: 4240  |  回复: 0

lvhenghua

新虫 (初入文坛)

[交流] udf中的面宏如何使用,例如F_UDMI(f,t,i),和C_UDMI(c,t,i)的使用有什么区别?

请教一下各位fluent大神,udf中的面宏如何使用,例如F_UDMI(f,t,i),和C_UDMI(c,t,i)的使用有什么区别?附上自己模拟时的一段程序,一直运行不通,请大家多多指教。
DEFINE_INIT(my_init_func2,d)
{
face_t f;
Thread *t;
real xf[ND_ND];
int id_f=5;
t=Lookup_Thread(d,id_f);

thread_loop_f(t,d)
{
  begin_f_loop(f,t)
  {
   F_CENTROID(xf,f,t);
   F_UDMI(f,t,0)=(arrhenius_rate(tw0))*(c0-cs(tw0))*(c0-cs(tw0))+2*mw_h2o/mw_caso4*(arrhenius_rate(tw0))*(c0-cs(tw0))*(c0-cs(tw0));/*deposite rate md*/
   F_UDMI(f,t,1)=0;/*length of foul*/
   F_UDMI(f,t,2)=0;/*resistence of fouling layer*/
   F_UDMI(f,t,3)=tw0;/*t=0,tf=320k*/
   F_UDMI(f,t,4)=(arrhenius_rate(tw0))*(c0-cs(tw0))*(c0-cs(tw0))+2*mw_h2o/mw_caso4*(arrhenius_rate(tw0))*(c0-cs(tw0))*(c0-cs(tw0));/*mf*/
   F_UDMI(f,t,5)=0;/*mr*/
  }
  end_f_loop(f,t)
}
}
DEFINE_EXECUTE_AT_END(execute_at_end2)
{

Domain *d;
Thread *t;
face_t f;
d=Get_Domain(1);

int id_f=5;

t=Lookup_Thread(d,id_f);
thread_loop_f(t,d)
{
   begin_f_loop(f,t)
   {
    F_UDMI(f,t,1)+=F_UDMI(f,t,0)*delta_t/rho_f;
   
    F_UDMI(f,t,2)=F_UDMI(f,t,1)/lambda_f;
   
    F_UDMI(f,t,3)=F_T(f,t)+(tw0-F_T(f,t))/(1+h*F_UDMI(f,t,2));
   
    F_UDMI(f,t,0)=(arrhenius_rate(F_UDMI(f,t,3)))*(F_YI(f,t,caso4)*F_R(f,t)-cs(F_T(f,t)))*(F_YI(f,t,caso4)*F_R(f,t)-cs(F_T(f,t)))+2*mw_h2o/mw_caso4*(arrhenius_rate(F_UDMI(f,t,3)))*(F_YI(f,t,caso4)*F_R(f,t)-cs(F_T(f,t)))*(F_YI(f,t,caso4)*F_R(f,t)-cs(F_T(f,t)));
   
    F_UDMI(f,t,4)=F_UDMI(f,t,0)-F_UDMI(f,t,5);/*mf*/
   
    F_UDMI(f,t,5)=0.012*pow(F_U(f,t),1.46)*F_UDMI(f,t,4)*(1+beta*(320-F_UDMI(f,t,3)))*dp*pow(F_R(f,t)*F_R(f,t)*0.0005806*9.81,1/3);/*mr*/
   }
   end_f_loop(f,t)
}

}
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)
}
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 lvhenghua 的主题更新
普通表情 高级回复(可上传附件)
信息提示
请填处理意见