|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
原模型是进口速度1ms,出口速度是-1ms,现想把进出口分别改为周期变化的往复流
单个进口的UDF程序:
#include "udf.h"
#define PI 3.1415926
#define wt 300.0
#define vel 1.0
#define time RP_Get_Real("flow-time")
DEFINE_PROFILE(inlet_x_velocity, thread, index)
{
real x[ND_ND];
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
F_PROFILE(f, thread, index) = vel * sin(2*PI/wt*time);
}
end_f_loop(f, thread)
}
现在想用interpreted的话 希望把进出口都编进一个c文件里头,该怎么编译呢 我编了一个
#include "udf.h"
#define PI 3.1415926
#define wt 300.0
#define vel 1.0
#define time RP_Get_Real("flow-time")
DEFINE_PROFILE(x_velocity, thread, index)
{
if(x_velocity=inlet_x_velocity)
{
real x[ND_ND_ND];
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
F_PROFILE(f, thread, index) = vel * sin(2*PI/wt*time);
}
end_f_loop(f, thread)
};
if(x_velocity=outlet_x_velocity)
{
real x[ND_ND_ND];
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
F_PROFILE(f, thread, index) = -vel * sin(2*PI/wt*time);
}
end_f_loop(f, thread)
};
}
可是好像不行 说inlet_x_velocity未申明的变量
该怎么办啊~~~~~
|
|