|
|
哦,请问为什么 interface 会不重合, 是udf的问题,还是我设置的问题?
这是我的udf
#include "udf.h"
#include "math.h"
#include "dynamesh_tools.h"
#define PI 3.141592654
#define theta0 60.0*PI/180.0
#define H0 0.08
#define St 0.3
#define U 1.0
real w = PI*St*U/H0;
DEFINE_CG_MOTION(flapping,dt,vel,omega,time,dtime)
{
real x_A=0.0,y_A=0.0,x_N=0.0,y_N=0.0;
real theta_A,theta_N;
real omegap = 0.0;
theta_A = -theta0*cos(w*CURRENT_TIME);
theta_N = -theta0*cos(w*(CURRENT_TIME+CURRENT_TIMESTEP));
omegap = (theta_N-theta_A)/CURRENT_TIMESTEP;
x_A= 0.0;
x_N= 0.0;
y_A=H0*sin(w*CURRENT_TIME);
y_N=H0*sin(w*(CURRENT_TIME+CURRENT_TIMESTEP));
vel[0] =0.0;
vel[1] =(y_N - y_A) / CURRENT_TIMESTEP;
omega[0] =0.0;
omega[1] =0.0;
omega[2] = omegap;
return;
}
DEFINE_CG_MOTION(heave,dt,vel,omega,time,dtime)
{
real x_A=0.0,y_A=0.0,x_N=0.0,y_N=0.0;
x_A= 0.0;
x_N= 0.0;
y_A=H0*sin(w*CURRENT_TIME);
y_N=H0*sin(w*(CURRENT_TIME+CURRENT_TIMESTEP));
vel[0] =0.0;
vel[1] =(y_N - y_A) / CURRENT_TIMESTEP;
return;
} |
|