找回密码
 注册
查看: 1129|回复: 0

UDF编译正常,运行就出现问题,怎么办啊??求大虾指点

[复制链接]
发表于 2013-5-10 11:02:58 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

x
定义了新变量Tnorm=(T-Tmin)/(Tmax-Tmin)用了UDF在Fluent中运行(已启用能量方程)后出现:
FLUENT received fatal signal (ACCESS_VIOLATION)
1. Note exact events leading to error.
2. Save case/data under new name.
3. Exit program and restart to continue.
4. Report error to your distributor.
Error Object:()
如题
附源程序:

#include "udf.h"
DEFINE_ON_DEMAND(on_demand_calc)
{
cell_t c;
Thread *t;
Domain *d=Get_Domain(1);
real tmax=0.,tmin=0.,temp;
thread_loop_c(t,d)
{
begin_c_loop(c,t)
{
temp=C_T(c,t);
if(temp<tmin||tmin==0.)tmin=temp;
if(temp>tmax||tmax==0.)tmax=temp;
}
end_c_loop(c,t)
}
thread_loop_c(c,d)
{
begin_c_loop(c,t)
{
temp=C_T(c,t);
C_UDMI(c,t,0)=(temp-tmin)/(tmax-tmin);
}
end_c_loop(c,t)
}
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表