|November 20, 2012, 02:59||
Same value for C_U and C_U_M1
Join Date: Mar 2010
Posts: 25Rep Power: 7
I'm trying to calculate the acceleration of air during an unsteady simulation. To do so I'm using C_U and C_U_M1 to access the x velocity at the current and previous time step and then store it in a UDM. My problem is just that C_U and C_U_M1 always return the same value within a cell at any given iteration.
Below is my UDF. I used a DEFINE_CG_MOTION macro as I'll later also have to change the rotational speed of one of my volumes, but that is not an issue.
Does anyone have an idea where I've gone wrong or that I should change?
DEFINE_CG_MOTION(start_up, pointer, velocity, omega, time,dt)
Domain *d = Get_Domain(1);
Thread *t = Lookup_Thread(d,10); /* 10 is the volume ID for the block that I'm interested in*/
Thread *ct = THREAD_T0(t);
Message0 (“current time step %f , last time step %f \n”, C_U(c,ct), C_U_M1(c,ct));
I also tried defining my thread using these below 2 methods, but the problem is the same.
Thread *ct = DT_THREAD((Dynamic_Thread *)pointer);
Thread *ct = DT_THREAD(pointer);
Thanks for any thoughts,
|acceleration, c_u, c_u_m1, transient, udf|