CFD Online Discussion Forums

CFD Online Discussion Forums (
-   FLUENT (
-   -   UDF int id; (

Li Jingping April 4, 2003 04:34

UDF int id;
I wrote a UDF for excercise.

#include "udf.h"

DEFINE_ON_DEMAND(my_udf) { Domain *domain; domain=Get_Domain(3); int id; Thread *f_thread=Lookup_Thread(domain, id); }

Once I interrepted it in FLUENT, it told me the syntax error on "int id;". I am confused! Is my UDF right or not? Is it required any other condition to define an integer index?

Thanks in advance!

Li Jingping April 4, 2003 09:29

Re: UDF int id;
i resolved this problem by myself, though I don't know why.

Change the sequence of the lines and divide the assignment line for thread into two parts as follows:

#include "udf.h"

DEFINE_ON_DEMAND(my_udf) { int idŁ»Thread *f_thread;Domain *domain; domain=Get_Domain(3); f_thread=Lookup_Thread(domain, id); }

UDF can be compiled by FLUENT.

Very confused. Anyone can tell me why?

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