|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
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)
}
望斑竹和大侠们赐教!! |
|