zumaqiong 发表于 2010-3-23 04:54

求助:写parabolic time dependent velocity inlet的UDF

各位同学,
我现在要写一个parabolic time dependent velocity inlet的UDF。
我写完以后发现,在边界入口处,运行一会以后出现很大的回流。
可是,在boundary condition的定义里,一旦加入一个速度,不可能会出现回流啊?
我用Tecplot看了一下vector的结果,发现,在速度入口的边界上有两个方向的速度,一个是对的,另一个一会就会出现回流。

请大家看看是怎么回事。
谢谢!
附我写的UDF。
#include"udf.h"
DEFINE_PROFILE(flow_at_inlet,thread,index)
{
real x,velocity;
/* velocity is defined, but not used in the main function??.*/
real y;
face_t f;
real t;
int n;
real T=1;

begin_f_loop(f,thread)
{
   F_CENTROID(x,f,thread);
   y=x;
t=RP_Get_Real("flow-time");
n=(int)(t/T);
F_PROFILE(f,thread,index)=-1360.41*(0.0001-y*y)*exp(-0.5*pow(15.15*t-3.46-15.15*n,2));

velocity=F_PROFILE(f,thread,index);
}
end_f_loop(f,thread)
}
页: [1]
查看完整版本: 求助:写parabolic time dependent velocity inlet的UDF