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

UDF功能给定振动杆和振动盘的周期性振动的位移和速度表达 udf编译有问题

[复制链接]
发表于 2014-1-17 10:40:21 | 显示全部楼层 |阅读模式

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

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

x
用UDF功能给定振动杆和振动盘的周期性振动的位移和速度表达式,扰动频率为2500Hz,扰动振幅为2e-7um,在0.08s时开始施加扰动,使用动网格的源程序如下:
#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;
}
但是提示19行,c: line 19: structure reference not implemented
求大神指导啊
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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