|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
我刚学UDF不久,我就下面的入口条件写了一个UDF,不知道思路对不对,请赐教
#include "udf.h"
DEFINE_PROFILE(inlet_x_velocity, thread, index)
{
real x[ND_ND];
real y;
face_t f;
real u1=0.202;
real k=0.42;
real y0=0.00053;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[1];
if (y>=y0)
F_PROFILE(f, thread, index) = (u1/k)*log(y/y0);
else
F_PROFILE(f, thread, index) = 0;
}
end_f_loop(f, thread)
}
DEFINE_PROFILE(K_velocity, thread, index)
{
face_t f;
begin_f_loop(f, thread)
F_PROFILE(f, thread, index) = 0.5*F_U(f,thread)*0.015;
end_f_loop(f, thread)
}
U是入口速度,K是入口湍能,关键是K随U变 |
|