Santu Golder
Subscriber

Hi  Prashanth,

 

Thank you for your reply. I've coded the equation as follows:

# include "udf.h"

static real velx = 0.0;

DEFINE_CG_MOTION(box,dt,vel,omega,time,dtime)
{
    NV_S(vel, =, 0.0);
    NV_S(omega, =, 0.0);

    velx = 0.01*sin(1.1416*time/10.);
    vel[1] = velx;
    Message("time = %f, vel[1] = %f\n", time, vel[1]);
}

But for giving the limit to move the moving box, which one should I add:

if (!Data_Valid_P())
return;

or 

any other loop that I need to apply.