CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   How to access Zone ID using dynamic thread (http://www.cfd-online.com/Forums/fluent/49777-how-access-zone-id-using-dynamic-thread.html)

Ali November 13, 2008 03:17

How to access Zone ID using dynamic thread
 
Hi I want to get zone ID of a moving boundary in a DEFINE_CG_MOTION macro. I used DT_THREAD and THREAD_ID in my udf but when I printed my results, I got wrong values for zone id. please tell me what is the problem? (note: vel[1] and vel[0] are calculated in previous stages of udf.)

DEFINE_CG_MOTION(motion, dt, cg_vel, cg_omega, time, dtime) {

Thread *t;

int zone;

t=DT_THREAD(dt);

zone=THREAD_ID(t);

Message ("ZONE_ID : %g\n",zone);

NV_S(cg_vel, =, 0.0);

NV_S(cg_omega, =, 0.0);

if (zone == 20) /* 20 is a zone ID for a specific

boundary */

{

cg_vel[0] = vel[1];

}

else

{

cg_vel[0] = vel[0];

} }


All times are GMT -4. The time now is 14:44.