fluent用udf编写速度边界条件, 速度随着垂直方向的高度Z变化而变化,udf如下,公式添加在图片里,公式中只有Z是变量,其他为常量,编译的时候出现错误,warning C4700: local variable 'x' used without having been initialized,error LNK2001: unresolved external symbol _powerfatal error LNK1120: 1 unresolved externals希望得到大家的指导!先谢谢大家了!
#include "udf.h"
#include "math.h"
#define a 0.33
#define d 460
#define Umet 1
#define dmet 270
#define Hmet 10
#define amet 0.14
DEFINE_PROFILE(inlet_u_velocity,thread,position)
{
real x[ND_ND];
real z;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
z=x[2];
if(z
F_PROFILE(f,thread,position)=Umet*power((dmet/Hmet),amet)*power((z/d),a);
else
F_PROFILE(f,thread,position)=Umet*power((dmet/Hmet),amet);
}
end_f_loop(f,thread)
}
|