- 积分
- 0
- 注册时间
- 2011-11-11
- 仿真币
-
- 最后登录
- 1970-1-1
|
我想请教一下,我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;
}
|
|