CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Fluent UDF and Scheme Programming (
-   -   F_C0_THREAD vs. THREAD_T0 (

Victor October 28, 2003 06:02


What is the difference between the UDF macros F_C0_THREAD(f,t) and THREAD_T0(t)? They seem to give the same information but the former seem to be much more common to use than the latter (The UDF manual does not give one example with THREAD_TO but plenty with F_C0_THREAD).

Another thing: When I try to use F_C0_THREAD I get the following error message: t0=F_C0_THREAD(f,t); error message: THREAD_STORE:undeclared variable.

Does anybody know why this is happening? I'm using an interpreted UDF if that is of any help.


Ajay Rao October 28, 2003 11:32

F_C0_THREAD(f,t) returns the "adjacent CO" cell type( cell_t) variable. so you need use as shown below

cell_t c;


THREAD_T0(t) ( where t = face thread ) returns the "adjacent cell thread" . You need to use this as follows:-

Thread *t; /* to store the cell thread */ t=THREAD_T0(tf);

Let me know if u have more questions. Remove -nospan in my mail id if u need to reach me . Regards, Ajay

ameyadurve June 26, 2009 14:05

Clarification regarding your explaination
Hey Ajay,

I am also facing the same problem as victor.

I could not exactly understand what you have written. I am posting my entire code here. Please go through it and let me know what changes I should do in order to get my UDF running.

#include "udf.h"
#include "mem.h"

DEFINE_UDS_FLUX(uds_flux, f, t, i)


Thread *t0, *t1 = NULL;
cell_t c0, c1 = -1;
real flux = 0.0;
real density;

begin_f_loop(f, t)
t0 = THREAD_T0(t);
c0 = F_C0(f,t);
//t0 = F_C0_THREAD(f, t);

if (NULL != THREAD_T1(f,t))

t1 = THREAD_T1(t);
c1 = F_C1(f,t);
//t1 = F_C1_THREAD(f, t);

density = C_R(c0, t0);
density = density + C_R(c1, t1);
density = density / 2;


density = F_R(f, t);
density = C_R(c0, t0);

flux = F_FLUX(f,t) / density;

return flux;


end_f_loop(f, t)


As you can see i have commented out the lines that used F_C0_THREAD(f, t)

Although my UDF is interpreted without errors it does not run.

No use compiling either.

Please reply as soon as you can.

Richard Parker August 7, 2012 09:35

F_C0_THREAD is obsolete. In recent versions of Fluent it has been replaced by THREAD_T0.

Regarding its usage, the example given by Ajay Rao is correct!

All times are GMT -4. The time now is 20:21.