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

[讨论]大家看看这个简单的UDF有什么问题,结果很奇怪。

[复制链接]
发表于 2005-4-30 20:50:26 | 显示全部楼层 |阅读模式

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

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

x
算了几个时间步长后,时间(time)变成了负值,正弦值(sin)远大于1,这是为什么啊,是这个UDF有什么问题么,请教了!
#include "udf.h"
#define  w 9.42
/*w is the angular velocity w=2*pi*f, f=1.5 is frequency*/
DEFINE_PROFILE(Pressure_profile,t,i)
{
    face_t f;
    real time;   /* time is the iterative time*/
    real dp=930000; /*Dp is the amplitude of pressure in compressor*/
    double ss;
/*time=RP_Get_Real("flow-time");*/
time=CURRENT_TIME;
printf("the time is,%d\n",time);
    begin_f_loop(f,t)
    {
ss=sin(w*time);
F_PROFILE(f,t,i)=ss*dp;
    printf("sin(w*time)=,%d\n",ss);
printf("the pressure is,%d\n",F_PROFILE(f,t,i));
  }
     end_f_loop(f,t)
}
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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