找回密码
 注册
查看: 2322|回复: 0

往复流的进出口条件设置

[复制链接]
发表于 2007-10-12 15:22:05 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

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未申明的变量
该怎么办啊~~~~~
您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表