UDF piston movement problem
Hi everyone,
I'm trying to simulate a moving piston in a cylinder. The simple UDF i've written contains a sine wave to describe the velocity. It compiles correctly, and when I ask Fluent to 'Display Zone Motion', the piston starts accelerating and slowing down as expected. BUT, when it has come to a halt, instead of decelerating to a negative velocity, it accelerates in the positive direction! It appears like the absolute value is computed instead of the real one. The UDF looks as follows: -------------------------------------------------------------------------------- #include "udf.h" DEFINE_CG_MOTION(object_mov, dt, vel, omega, time, dtime) { real w, r, l; w = 146.6; r = 0.030; l = 0.1; /* define object movement law */ vel[0] = 0.1*(r*w*sin(w*time)+(r*r*w*sin(2*w*time))/(2*l)); vel[1] = 0; vel[2] = 0; } ---------------------------------------------------------------------------------- Any help/suggestion is more than welcome! |
So are you saying the piston keeps on advancing in between halts? Did you hook your UDF? And have you tried with a simple sine wave?
|
Hi Kevin, thanks for your reply.
I've managed to resolve this issue by decreasing the time step. Also, the problem only emerged when I was using the 'Display Zone Motion' function. |
All times are GMT -4. The time now is 14:47. |