|
|
发表于 2005-8-7 14:03:26
|
显示全部楼层
[求助]请高手帮帮忙!
我来写写看,高手看对不对,刚学了点udf,呵呵,如果有错误还请多多指导啊!
#include "udf.h"
#include "math.h"
DEFINE_PROFILE(unsteady_velocity, thread, position)
{
face_t f;
real t = CURRENT_TIME;
begin_f_loop(f, thread)
{
if (t>0&&t<0.24)
F_PROFILE(f, thread, position) =240*exp(-7.557t)*sin(13.09t);
else if (t>0.24&&t<=0.2743)
F_PROFILE(f, thread, position) =-(34.3)*exp(-7.557)*sin(13.09*(t-0.24))
else
F_PROFILE(f, thread, position) =0;
}
end_f_loop(f, thread)
}
|
|