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