24小时热门版块排行榜    

查看: 4464  |  回复: 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 的主题更新
普通表情 高级回复 (可上传附件)
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[基金申请] 欢迎发来filecode的Mz6后的代码验证其规律 +55 医学老男孩 2026-08-13 123/6150 2026-08-19 23:44 by stan_et
[基金申请] 今天基金会出结果吗?20260819 +13 kkkl_v 2026-08-19 13/650 2026-08-19 22:37 by 宝贝虫子
[基金申请] 时间戳变了,能看出什么问题? +12 基诺咪客 2026-08-17 16/800 2026-08-19 22:04 by kk 的小木虫
[基金申请] filecode,4个jtjc了 +11 ziyangfang 2026-08-19 13/650 2026-08-19 21:28 by aasahr
[教师之家] 为什么余额宝的年化利率越来越低?主要原因有哪些? +5 瞬息宇宙 2026-08-15 5/250 2026-08-19 20:23 by super2002521
[基金申请] 今天放榜没戏了吧 +4 yuleib84 2026-08-19 5/250 2026-08-19 19:52 by hhs666
[基金申请] 今天放榜吗? +14 布布和一二 2026-08-19 15/750 2026-08-19 18:07 by gltch
[基金申请] filecode=后面第一个是大写字母 +10 wangze12014 2026-08-14 12/600 2026-08-19 16:56 by 苦难博士
[基金申请] 2027广东省杰青 +4 奶牛小黑 2026-08-15 10/500 2026-08-19 11:02 by wanfengnew
[基金申请] 朋友圈看到的 +6 wangzilk 2026-08-18 8/400 2026-08-19 10:55 by Haru815
[基金申请] 什么时候开奖? +6 CrisMessi 2026-08-18 6/300 2026-08-19 08:06 by Equinoxhua
[基金申请] 重要消息,中午系统在维护 +10 yuleib84 2026-08-18 11/550 2026-08-19 07:30 by 羽毛枫f
[基金申请] 明天放榜? +5 Shxjjxjkx 2026-08-18 5/250 2026-08-18 18:14 by -大大大大大-
[论文投稿] 投稿咨询 +4 wwm09 2026-08-17 6/300 2026-08-18 15:36 by wwm09
[基金申请] 时间戳又变了8-15 +14 archvillain 2026-08-15 26/1300 2026-08-18 13:37 by phantomgost
[基金申请] 今天维护系统维护 祝所有人 高中 +8 gjjjzhong 2026-08-18 9/450 2026-08-18 13:01 by 家与远方
[基金申请] 哪位老哥知道今年的国自然具体哪一天放榜? +13 Ldrop2023 2026-08-13 16/800 2026-08-18 12:25 by 淀粉搬运工
[基金申请] 今天系统多次维护,明天很可能放榜! +8 zju2000 2026-08-16 9/450 2026-08-17 12:20 by lmz0216
[精细化工] 招聘 金属平磨液,抛光液研发工程师 +3 小天0311 2026-08-14 3/150 2026-08-16 07:31 by H9PLUS
[基金申请] 各位道友,我要去昆明玩几天,回来见。 +7 Tide man 2026-08-14 8/400 2026-08-15 01:11 by arzu_hma
信息提示
请填处理意见