|
发表于 2011-3-2 16:03:55
|
显示全部楼层
请各位指点迷津啊!我现在在做结构外部绕流——涡振响应,在udf中把振动方程加了进去,提取出升力,解算出位移,流固耦合振动,但提取出的升力曲线很不圆滑,不像文章中显示的像正弦曲线那样,不知道哪出错了,请教各位了!!!!!
下面是我编的程序:
#include"stdio.h"
#include"udf.h"
#include"unsteady.h"
static real v_prev=0.0;
#define k 10
#define M 10
#define C 0.1
DEFINE_CG_MOTION(shuwan,dt,vel,omega,time,dtime)
{ Thread *t=DT_THREAD(dt);
face_t f;
real NV_VEC(A);
real force,dv;
real K;
real P;
real dy;
real a;
real disp;
real dforce;
real li;
NV_S(vel,=,0.0);
NV_S(omega,=,0.0);
if(!Data_Valid_P())
return;
force=0.0;
begin_f_loop(f,t)
{
F_AREA(A,f,t);
force+=F_P(f,t)*A[1];
}
end_f_loop(f,t)
disp=0.0;
dforce=0.0;
K=0.0;
li=force-dforce;
dforce=force;
a=(force-C*v_prev-K*disp)/M;
K=k+6*M/(dtime*dtime)+3*C/dtime;
P=li+M*(6*v_prev/dtime+3*a)+C*(3*v_prev+a*dtime/2);
dy=P/K;
dv=3*dy/dtime-3*v_prev-dtime*a/2;
v_prev+=dv;
disp+=dy;
Message("nUDF value:time=%f,y_velo=%f,force=%fn",time,v_prev,force);
#if PARALLEL
host_to_node_real_1(v_prev);
#endif
vel[1]=v_prev;
} |
|