Udf for wall motion (dynamic mesh)
I have a simple channel with length = 2 mm, Height = 150 um. Inlet is a mass-flow inlet and the outlet is a pressure outlet. The liquid is water and the flow is laminar. The bottomwall (see picture) need to move up and down (along y) in order to generate pressure waves that propagate in y direction.
I wrote a udf and I compile it. I create a dynamic mesh zone ("bottomwall") and I set it to rigid body motion. The problem is that the results are not the one that I expected. It seems that the wall doesn't move correctly, only at the inlet I see something reasonable(not at all):
I think that udf is no totally correct, but I cannot find the error.
static real vely = 0.0;
freq = 5000000;
v0 = 0.1;
DEFINE_CG_MOTION(wall, dt, vel, omega, time, dtime)
NV_S (vel, =, 0.0)
NV_S (omega, =, 0.0)
vely = v0*sin(2*M_PI*freq*time);
vel = vely ;
printf("\n y_velocity = %g \n",vel);