| 查看: 2175 | 回复: 1 | ||
| 【悬赏金币】回答本帖问题,作者矢志不渝……将赠送您 10 个金币 | ||
[求助]
fluent udf message宏的使用问题 已有1人参与
|
||
|
程序如下,用于获取并显示计算域最小温度,最大温度和平均温度(来源于udf manual文档DEFINE_ON_DEMAND一节的示例) #include "udf.h" #include "math.h" #include "sg.h" DEFINE_ON_DEMAND(ex) { Domain *d; real tavg = 0.; real tmax = 0.; real tmin = 0.; real temp,volume,vol_tot; real i = 0; Thread *t; cell_t c; d = Get_Domain(1); thread_loop_c(t,d) { begin_c_loop(c,t) { volume = C_VOLUME(c,t); temp = C_T(c,t); if (temp < tmin || tmin == 0.) tmin = temp; if (temp > tmax || tmax == 0.) tmax = temp; vol_tot += volume; tavg += temp*volume; } end_c_loop(c,t) tavg /= vol_tot; i = i+1; Message0("\n Tmin = %g; Tmax = %g ;Tavg = %g; i= %g\n",tmin,tmax,tavg,i); } } 然而,在fluent中execute后,显示结果如下: Tmin = 2589.32; Tmax = 3136.66; Tavg = 3057.71; i= 1 Tmin = 300; Tmax = 3136.66; Tavg = 3.70544e+07; i= 2 Tmin = 300; Tmax = 3136.6;6 Tavg = 4.45858e+11; i= 3 实际情况是,计算域最小温度为300K,最高温度应该没错。也就是说,一次execute输出了三行的错误信息,请问问题出在哪里? |
» 猜你喜欢
职称评审没过,求安慰
已经有42人回复
回收溶剂求助
已经有7人回复
硝基苯如何除去
已经有3人回复
A期刊撤稿
已经有4人回复
垃圾破二本职称评审标准
已经有17人回复
投稿Elsevier的Neoplasia杂志,到最后选publishing options时页面空白,不能完成投稿
已经有22人回复
EST投稿状态问题
已经有7人回复
毕业后当辅导员了,天天各种学生超烦
已经有4人回复
求助文献
已经有3人回复
三无产品还有机会吗
已经有6人回复
2楼2023-07-15 10:24:21













回复此楼