|
|
发表于 2012-7-22 10:49:56
|
显示全部楼层
回复 1# Cavalier2010 的帖子
#include "udf.h"
DEFINE_PROFILE(inlet_r_velocity, thread, position)
{
real xx[ND_ND]; /* this will hold the position vector */
real x,y,r;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(xx,f,thread);
x = xx[0];
y = xx[1];
r =sqrt(x*x+y*y);
F_PROFILE(f, thread, position) =20*(1-r*r/0.012);
}
end_f_loop(f, thread)
}
DEFINE_PROFILE(inlet_r_temperature, thread, position)
{
real xx[ND_ND]; /* this will hold the position vector */
real x,y,r;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(xx,f,thread);
x = xx[0];
y = xx[1];
r =sqrt(x*x+y*y);
F_PROFILE(f, thread, position) =303+100* ((r/0.01)*(r/0.01)-( r/0.01));
}
end_f_loop(f, thread)
}
试试吧,
记得论坛里有过这样的帖子,你可以搜搜 |
|