fluent UDF程序小错误
浏览:120988 回答:3
#include "udf.h"
DEFINE_PROFILE(x_velocity,thread,nv)
{
float x[3]; /* an array for the
coordinates */
float xu;
face_t f; /* f is a face
thread index */
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
xu = x[0];
F_PROFILE(f, thread, nv)
= x[0];
}
end_f_loop(f, thread)
}
想让xu随着坐标X变化(实际模型坐标x不是恒值),可fluent运行后发现xu是个恒值,如果把xu=x[0]改为xu=x[1]或xu=x[2]后xu却能随坐标Y或坐标Z变化了,这是怎么回事啊?
DEFINE_PROFILE(x_velocity,thread,nv)
{
float x[3]; /* an array for the
coordinates */
float xu;
face_t f; /* f is a face
thread index */
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
xu = x[0];
F_PROFILE(f, thread, nv)
= x[0];
}
end_f_loop(f, thread)
}
想让xu随着坐标X变化(实际模型坐标x不是恒值),可fluent运行后发现xu是个恒值,如果把xu=x[0]改为xu=x[1]或xu=x[2]后xu却能随坐标Y或坐标Z变化了,这是怎么回事啊?
找到问题了,X就是坐标X正方向啊,是因为我的湍流模型设置成了层流和UDF定义的速度在X方向变化冲突了,所以导致了X方向初始速度是个恒定值。