Shuvadeep
Subscriber

#include "udf.h"

DEFINE_CG_MOTION (rotational_motion, dt, cg_vel, cg omega, time, dtime)
{
Domain *d =Get Domain(1);
Thread *t_object = Lookup_Thread(d, 2);
real moment [ND_ND], cg[ND_ND], force [ND_ND];

Compute_Force_And_Moment(d, t_object, cg, force, moment, TRUE)
real moment_z= moment [3]; * To compute the moment at the beginning of the time step and feed into the equation of motion */

real i1 = exp(-0.823*time);
real i2 = cos (8.19*time);
real i3 = 48870 sin(8.19*time);
real i4 = 2.893 pow(10,-8);
real omega = -i4 * moment_z * i1 * (i2-i3);

cg_vel[0]=0.0;
cg_vel [1]=0.0;
cg_ve1[2]=0.0;

cg omega [0]-0.0 ;
cg omega (1)-0.0;
cg omega [2]=real omega;
}