24小时热门版块排行榜    

查看: 334  |  回复: 0

夜独醉12377

新虫 (初入文坛)

[求助] fluent软件中UDF程序报错

#include "udf.h"
#define PI      3.14159
#define GRAV    9.81
#define D       5.0
#define H       1.0
#define T       4.0
#define L       23
#define FL      90
// x direction velocity  //
DEFINE_PROFILE(x_velocity, thread, position)
{
  real x[ND_ND];
  real y;
  real yu,K,W,Lu;
  face_t  f;
  begin_f_loop(f, thread)
    {
        Real t=RP_Get_Real("flow-time";
      F_CENTROID(x,f,thread);
      y=x[1];
      yu=Y-D;
        K=2.0*PI/L;
        W=2.0*PI/T;
      Lu=D+(H/2.0)*cos(K*0.0-W*t)+(PI*H*H/(8.0*L))*(cosh(K*D)/pow
(sinh(K*D),3.0))* (2.0+cosh(2.0*K*D))*cos(2.0*(K*0.0-W*t))};
      if (y<=Lu)
        F_PROFILE(f,thread,position)=(PI*H/T)*(cosh(K*(yu+D))/sinh(K*D))*cos(
K*0.0-W*t)+0.75*(PI*PI*H*H/(T*L))*(cosh(2.0*K*(yu+D))/pow(sinh(K*D),4.0))*co
s(2.0*(K*0.0-W*t));
          else
F_PROFILE(f, thread, position) =0;
  }
end_f_loop(f, thread)
}
// y direction velocity //
DEFINE_PROFILE(y_velocity, thread, position)
{
  real x[ND_ND];
  real y;
  real yu,K,W,PP;
  face_t f;
  begin_f_loop(f, thread)
    {
      real t =RP_Get_Real( "flow-time ";
      F_CENTROID(x,f,thread);
      y=x[1];
      yu=y-D;
        K=2.0*PI/L;
        W=2.0*PI/T;
      PP=D+(H/2.0)*cos (K*0.0-W*t)+(PI*H*H/(8.0*L))*(cosh(K*D)/pow(sinh(K*D),3.0))* (2.0+cosh(2.0*K*D))*cos(2.0*(K*0.0-W*t));
      if   (y<=PP)
        F_PROFILE(f,thread,position)=(PI*H/T)*(sinh(K*(yu+D))/sinh(K*D))*sin(
K*0.0-W*t)+0.75*(PI*PI*H*H/(T*L))*(sinh(2.0*K*(yu+D))/pow(sinh(K*D),4.0))*sin
(2.0*(K*0.0-W*t));
       else
        F_PROFILE(f, thread, position)=0;
      }
  end_f_loop(f, thread)
}
回复此楼
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

智能机器人

Robot (super robot)

我们都爱小木虫

相关版块跳转 我要订阅楼主 夜独醉12377 的主题更新
信息提示
请填处理意见