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

the fluent was crashed and disapeared when run UDF

[复制链接]
发表于 2015-1-15 10:21:29 | 显示全部楼层 |阅读模式

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

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

x
#include"udf.h"
real vn=0.0;
FILE * fp;
DEFINE_CG_MOTION(dynamic_cylinder,dt,vel,omega,tim e,dtime)
{
vn=5*sin(5*time);
vel[1]=vn;
omega[2]=2;
}
DEFINE_EXECUTE_AT_END(execute_at_end)
{
int n;
fp=fopen("D:\\temp\\shiyan","a_v");
fprintf(fp,"% E\n",vn);
fclose(fp);
}
i want use the UDF above write a file to record the velocity data, but two problems puzzle me:

1 i have sucessfully compiled the UDF, but when i ran caculation the fluent was crashed, disapeared in the screen.(when i remove the macro DEFINE_EXECUTE_AT_END, the UDF run well)

2 i want the body move in vertical direction and rotate aroud its center simutaneously, but the coordinate of the body center is not (0,0), how should i do ?(2D caculation)
Could anyone can help me? many thanks in advance...
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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