24小时热门版块排行榜    

查看: 232  |  回复: 2
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

weipei0529

木虫 (正式写手)

[求助] 各位大侠,帮小弟测试下UDF 已有1人参与

各位大侠,帮小弟测试下UDF,导入fluent老编译错误,你们测试下,如果没问题的话,就是我的环境变量设置不成功,谢谢大侠们了
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

weipei0529

木虫 (正式写手)

引用回帖:
2楼: Originally posted by achilFes1990 at 2014-01-17 22:29:04
把代码拿出来看看吧

不好意思啊,忘了贴代码了:
#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;
}
3楼2014-01-18 15:18:29
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 3 个回答

achilFes1990

木虫 (著名写手)

【答案】应助回帖

感谢参与,应助指数 +1
把代码拿出来看看吧
扫一扫关注我的微信公众号,共同学习船舶CFD
2楼2014-01-17 22:29:04
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
信息提示
请填处理意见