|
[Sponsors] |
November 20, 2012, 02:59 |
Same value for C_U and C_U_M1
|
#1 |
New Member
Join Date: Mar 2010
Posts: 25
Rep Power: 16 |
Hi everyone,
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) { cell c; 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); thread_loop_c(ct,d) { begin_c_loop(c,ct) { C_UDMI(c,ct,0) =C_U(c,ct); Message0 (“current time step %f , last time step %f \n”, C_U(c,ct), C_U_M1(c,ct)); } end_c_loop(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, Dorit |
|
March 9, 2013, 16:06 |
|
#2 |
New Member
Nasser
Join Date: Dec 2012
Posts: 21
Rep Power: 14 |
hi
I think you have to use define_adjust for calculating your UDF in every iteration. read udf manual. |
|
Tags |
acceleration, c_u, c_u_m1, transient, udf |
|
|