找回密码
 注册
查看: 2065|回复: 1

问一个UDF问题!

[复制链接]
发表于 2006-12-3 12:37:31 | 显示全部楼层 |阅读模式

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

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

x
要编一个UDF来描述壁面热流边界条件. 壁面热流情况如下:外界加给壁面的热流为1000W/M^2,同时壁面也要向外辐射热流,辐射热流量按那个辐射公式计算.我编了个UDF,在FLUENT里编译通过了,但在对计算区域温度进行初始化(Initialize)时却出现如下的出错提示:” Error:
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: ()”
请问大侠这是怎么回事,该怎么解决?多谢!!后面附的是我编写的UDF程序.
#include "udf.h"
DEFINE_PROFILE(fluxflow, thread, position)
{
real tim,temp,temp1;
face_t f;
cell_t c;
Thread *t;
temp=C_T(c,t);
temp1=temp/100;
begin_f_loop(f, thread)
{
tim=RP_Get_Real("flow-time");
if(tim>=0)
F_PROFILE(f, thread, position)=1000-pow(temp1,4)*0.67*5.678;
}
end_f_loop(f, thread)
}
发表于 2006-12-6 01:50:15 | 显示全部楼层

问一个UDF问题!

按你说的,我理解温度应该是壁面上的温度,如果,不是,你的udf中的cell_t c是哪个cell呢?还有,取出物理时间没有必要。
如果是壁面温度做参考,我觉得可以这样写udf
DEFINE_PROFILE(fluxflow, thread, position)
{
real temp,temp1;
face_t f;
begin_f_loop(f, thread)
{
   temp=F_T(f,thread);
   temp1=temp/100;
   F_PROFILE(f, thread, position)=1000-pow(temp1,4)*0.67*5.678;
}
end_f_loop(f, thread)
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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