关于速度入口方向随时间变化的UDF
-
#include“udf.h”
DEFINE_PROFILE(velocity,t,i)
{
face_t f;
real velocity[ND_ND];
real xc[ND_ND];
real time;
real omega;
real amplitude;
real t_period;
t_period=10;
amplitude=3;
omega=2.0*3.14 / t_period
begin_f_loop(f,i)
{
time=CURRENT_TIME;
F_CENTROID(xc,f,t);
x=xc[0]
y=xc[1]
z=xc[2]
velocity[0] = amplitude * sin(omega * time);
velocity[1] = 0.0;
velocity[2] = 0.0;
F_PROFILE(xc,f,t,)=velocity[0];
}
end_f_loop(f,t)
} -
报错了,我检查不出错误,希望有前辈能够指导一二