最近把UDF导入FLUENT时,老提示语法错误,各位姐姐哥哥们帮小弟看看程序吧:
#include "stdio.h"
#include "udf.h"
#define Ac 2.e-7
#define m 0.5
#define fc 2500.
#define fm 833.
#fefine t0 0.08
DEFINE_CG_MOTION(droplet,dt,cg_vel,cg_omega,time,dtime)
{
Thread *t;
face_t f;
real velo,loc;
/*reset velocities*/
NV_S(cg_vel,=,0.0);
NV_S(cg_omega,=,0.0);
if(!Data_Valid_P())
return;
/*get the thread Pointer for which this motion is defined*/
t = DT_THREAD(dt);
/*compute velocity and location of vibration*/
velo=Ac*2*M_PI*(m*fm*sin(2*M_PI*fc*(time-t0))*cos(2*M_PI*fm*(time-t0))+m*fc*cos(2*M_PI*fc*(time-t0))*sin(2*M_PI*fm*(time-t0))+fc*cos(2*M_PI*fc*(time-t0)));
loc=Ac*(1+m*sin(2*M_PI*fm*(time-t0)))*sin(2*M_PI*fc*(time-t0));
Message("\nUDF droplet:time=%f,x_vel=%10.8f,loc(m)=%10.8f\n",time,velo,loc);
/*set y_component of velocity*/
cg_vel[0]=velo;
}
编译时,提示错误如下:
c:\fluent.inc\fluent6.3.26\src\config.h(119) : error C2143: 语法错误 : 缺少“{”(在“:”的前面)
c:\fluent.inc\fluent6.3.26\src\config.h(119) : error C2059: 语法错误:“:”
C:\Fluent.Inc\fluent6.3.26\cortex\src\dll.h(58) : error C2061: 语法错误: 标识符“CX_DLL_GetProc”
C:\Fluent.Inc\fluent6.3.26\cortex\src\dll.h(58) : error C2059: 语法错误:“;”
C:\Fluent.Inc\fluent6.3.26\cortex\src\dll.h(58) : error C2059: 语法错误:“类型”
..\..\src\RKEOS.c(31) : warning C4005: “T_REF”: 宏重定义
c:\fluent.inc\fluent6.3.26\src\prop.h(116) : 参见“T_REF”的前一个定义
..\..\src\RKEOS.c(80) : warning C4133: “=”: 从“void (*)(char *,...)”到“int (*)(char *,...)”的类型不兼容
..\..\src\RKEOS.c(372) : warning C4028: 形参 3 与声明不同