|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
我的课题需要将求解区域中某一部分流体的导热系数设置为温度的函数。而且求解目的也是温度场的分布,传热求解的过程需要用到导热系数,这样的问题用udf能实现吗?本人自己遍了个小程序
#include "udf.h"
DEFINE_ON_DEMAND(on_demand_calc)
{
Domain *d;
real temp,k;
Thread *t;
cell_t c;
d = Get_Domain(1);
thread_loop_c(t,d)
{ begin_c_loop(c,t)
{ temp = C_T(c,t);
k=3.8128+sqrt(temp)*0.00122388;
}
end_c_loop(c,t)
}}
interprete后提示temp definition shadows previous definition。迭代一进行,就提示满篇的on_demand_calc: wrong return type: float udf function expectedchip-exec: on_demand_calc: wrong return type: float udf function expectedchip-exec: 晃得我眼晕。请问大家这是什么原因引起的呢?应该如何修改?请高手指点下,先谢过了! |
|