找回密码
 注册
Simdroid-非首页
查看: 94|回复: 2

[FLUENT/GAMBIT] 关于udf的问题

[复制链接]
发表于 2015-7-25 09:29:56 | 显示全部楼层 |阅读模式 来自 北京
我想请教一下,我udf有两个定义,一个是Define_Grid_Motion,一个是Define_CG_Motion,导入fluent运行的时候提示:
..\..\src\rotary9000.c(94) : error C2143: syntax error : missing ')' before 'constant'
..\..\src\rotary9000.c(94) : error C2143: syntax error : missing '{' before 'constant'
..\..\src\rotary9000.c(94) : error C2059: syntax error : '<Unknown>'
..\..\src\rotary9000.c(94) : error C2059: syntax error : ')'


但是我单独运行每一个的时候都没有问题的,请问是什么原因?

/*********************************************************************/
/*  UDF to compute the orientation of a rotating valve, based on a
    specified rotational speed.

    Christoph Hiemcke, Fluent Inc.,             12 Feb 2004         

        butterlfy_flex_UDF  = name shown in Fluent GUI
                        dt  = thread
                    cg_vel  = cg velocity (global)
                  cg_omega  = angular velocity (global)
                      time  = current time
                     dtime  = time step
                                                                     */
/*********************************************************************/
#include "udf.h"

#define  omega      942.48
#define  e          0.003                           /* m        */
#define  r          0.022              /* m       */


/***********************************************************************/
/*  
    UDF to define a wall that is initially a circular arc, but then
        oscillates sinusoidally with time.  

    alpha = angle that dictates the motion of the arc;
        theta = angle that corresponds to the position of the rotating valve

    Christoph Hiemcke, Fluent Inc.,             13 Feb 2004            */
/***********************************************************************/



DEFINE_GRID_MOTION(wall_1, domain, dt, time, dtime)
{
  Thread *tf = DT_THREAD (dt);
  face_t f;
  Node *node_p;
  int i;
  real x,y,theta,x1,x2,a,da,b,db;
  int n;

/* Set/activate the deforming flag on adjacent cell zone, which      */
/* means that the cells adjacent to the deforming wall will also be  */
/* deformed, in order to avoid skewness.                             */
  SET_DEFORMING_THREAD_FLAG (THREAD_T0 (tf));

/* Compute the angles:                                               */
   theta = omega * CURRENT_TIME/3;

  begin_f_loop (f, tf)
    {
      f_node_loop (f, tf, n)
        {
          node_p = F_NODE (f, tf, n);

          /* Update the current node only if it has not been         */
                  /* previously visited:                                     */
          if (NODE_POS_NEED_UPDATE (node_p))
            {
              /* Set flag to indicate that the current node's        */
                          /* position has been updated, so that it will not be   */
              /* updated during a future pass through the loop:      */
              NODE_POS_UPDATED (node_p);

                          y     = NODE_Y (node_p);
                          x     = NODE_X (node_p);
                          for(i=1;i<=10;i++)
                          {
                                 a = (x*x+y*y-e*e-r*r)/(2*e*r);
                                 b = x*x-y*y;
                                 x1 = 4*e*e*a*a*a+4*e*r*a*a+(r*r-3*e*e)*a-b-2*e*r;
                                 da = (2*x)/(2*e*r);
                                 db = 2*x;
                                 x2 = 12*e*e*a*a*da+8*e*r*a*da+(r*r-3*e*e)*da-db;
                                 x  = x-x1/x2;
                          }
              NODE_X (node_p) = x;
            }
        }
    }
  end_f_loop (f, tf);
}


float beta;

DEFINE_CG_MOTION(wall_2, dt, vel, omega,time, dtime)
{
  Thread *t;
  face_t f;
  NV_S(vel,=,0.0);
  NV_S(omega,=,0.0);
  beta=942.48;
  vel[0]=beta*r*sin(beta*time);
  vel[1]=-beta*r*cos(beta*time);
  vel[2]=0;
}


发表于 2016-4-2 19:06:45 | 显示全部楼层 来自 广东广州
Simdroid开发平台
提示的是语法问题?
回复 不支持

使用道具 举报

发表于 2016-5-14 21:33:10 | 显示全部楼层 来自 英国
楼主问题解决了吗??
回复 不支持

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|小黑屋|联系我们|仿真互动网 ( 京ICP备15048925号-7 )

GMT+8, 2024-4-25 18:09 , Processed in 0.026907 second(s), 11 queries , Gzip On, MemCache On.

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

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