|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?注册
x
模拟扑翼飞行,UDF如下:
#include "udf.h"
#include "dynamesh_tools.h"
real w, pi, Aroll, Apitch, roll, droll, pitch, dpitch, frequency, T;
real Ar, Ap, Ay;
DEFINE_CG_MOTION(flapleft, dt, v_cg, omega, time, dtime)
{
Thread *t;
face_t f;
NV_S(v_cg, =, 0.0);
NV_S(omega, =, 0.0);
if (!Data_Valid_P())
{
Message("Wrong\n");
return;
}
t=DT_THREAD((Dynamic_Thread*)dt);
frequency = 5.0;
pi = 3.141592654;
/* define motion variables */
Ar = 30.0; /*roll amplitude*/
Ap = 5.0; /*pitch amplitude*/
Ay = 0.0; /*yaw amplitude*/
Aroll = Ar*pi/180.0; /*conversion to radians*/
Apitch = Ap*pi/180.0; /*conversion to radians*/
w=2.0*pi*frequency; /*omega (radians)*/
T=1.0/frequency;
roll = Aroll*sin(w*time + pi/2);
droll = w*Aroll*cos(w*time);
pitch = Apitch*sin(w*time);
dpitch = w*Apitch*cos(w*time);
/*euler angles initial frame mod 1*/
omega[1] = -droll;
/*omega[1] = dpitch*1.0*cos(roll);*/
/*omega[2] = -dpitch*1.0*sin(roll);*/
Message("time:%f omegax:%f omegay:%f omegaz:%f \n", time, omega[0], omega[1],omega[2]);
}
只是模拟上下拍动哟!
动网格预览:时间步长:0.0025s 步长:1000步
问题是:动网格预览时,出现翅膀整圈整圈的旋转,求各位大侠前辈,指点迷津啊!小的先行谢过!
|
|