如图:对于压力出口我想用UDF自己编译。边界出口的压强为途中所示。通过模仿速度入口,我自己编写了一个压强出口的UDF可是不对。现在附上自己编写的UDF程序。求大神指点,或则帮我编写一个正确的UDF程序。小弟第一次发帖,金币不多只能贡献10个。
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#include "udf.h"
DEFINE_PROFILE(unsteady_pressure, thread, position)
{
real x[ND_ND];
real y, h;
face_t f;
h = 14.5; /*inlet height in m*/
begin_f_loop(f, thread)
{
F_CENTROID(x, f, thread);
y = 1. - x[1] / h;
F_PROFILE(f, thread, position) = 998.2*9.8*(h - y);
}
end_f_loop(f, thread)
}
![求教UDF编写边界条件:压力出口]()
图.png |