|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
#include <stdio.h>
#include "udf.h"
DEFINE_CG_MOTION(vel, dt, cg_vel, cg_omega, time, dtime)
{
Thread *t;
face_t f;
real x[ND_ND];
real y;
real y1;
real y2;
face_t f;
begin_f_loop(f, thread)
{
F_CENTROID(x,f,thread);
y = x[1];
y1 = y-0.2;
y2 = y1/0.21;
F_PROFILE(f, thread, position) =1.49*y2*sqrt(1-y2);}
end_f_loop(f, thread)
cg_vel[1] = 1.49*y2*sqrt(1-y2);
} |
|