找回密码
 注册
查看: 1633|回复: 2

请斑竹看看我这个程序,关于边界输入的问题

[复制链接]
发表于 2007-7-19 19:39:05 | 显示全部楼层 |阅读模式

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

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

x
具体情况是这样的:
   有一个水管,刚开始给定一个进水温度,用UDF把水管的出水温度求出,然后作为水管的进水温度,请问大家这个UDF怎么写,我写了个UDF但在初始化的时候提示出错:
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: ()
具体程序如下:
#include "udf.h"
#define outid 4
DEFINE_PROFILE(velocity_temp, thread, index)
{
face_t f;
Thread *t;
Domain *d;
real outt;
int step;
step=RP_Get_Integer("time-step");
t=Lookup_Thread(d,outid);
   outt= F_T(f,t);
begin_f_loop(f, thread)
{

   
   if(step<=1)
   {
   F_PROFILE(f, thread, index)=300;/*第一个步长给个定温*/
   }
   else
   {
   F_PROFILE(f, thread, index) =outt;/*从第二个步长开始进口温度为出口温度*/
   }
}
end_f_loop(f, thread)
}
望斑竹和大侠们赐教!!
发表于 2007-8-5 13:42:01 | 显示全部楼层

请斑竹看看我这个程序,关于边界输入的问题

t=Lookup_Thread(d,outid);
  outt= F_T(f,t);
程序逻辑不对
明明是加在入口,你用入口的f来循环出口的t,肯定不对
 楼主| 发表于 2007-8-12 19:31:00 | 显示全部楼层

请斑竹看看我这个程序,关于边界输入的问题

问题已经解决,谢谢斑竹
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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