|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
哪位大神知道fluent UDF 中出现这种错误怎么解决吗?我的程序是用来求取流体对壁面的压力。程序如下:
#include "udf.h"
#include "stdio.h"
FILE*fp;
static int last_ts=1;
real force_1 = 0.0;
real NV_VEC(A);
face_t f;
int ID = 6;
int curr_ts;
Thread *thread;
DEFINE_ADJUST(get_force, domain)
{
thread = Lookup_Thread(domain, ID);
begin_f_loop(f,thread)
{
F_AREA(A,f,thread);
force_1 += F_P(f,thread) * NV_MAG(A);
}
end_f_loop(f,thread)
curr_ts=RP_Get_Integer("time-step");
if (last_ts!=curr_ts)
{
last_ts=curr_ts;
fp=fopen("data.txt","a");
fprintf(fp,"%f",curr_ts);
fprintf(fp,"%f\n",force_1);
fclose(fp);
}
}
我试了下,如果把begin那段循环删掉就不会出错了。跪求解决方法!谢谢!
|
|