CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)
-   -   UDF hooking error (http://www.cfd-online.com/Forums/fluent/43394-udf-hooking-error.html)

ranjit January 19, 2007 02:23

UDF hooking error
 
Even after hooking the udf , the solve-->iterate option isnt enabled. I tried to initialize the solution and it gave an error, What is wrong with the method?

yes, i udf interpreted fine without error.

Akshay January 19, 2007 03:17

Re: UDF hooking error
 
Without hooking try to initialize. If it does then, this should be error with your udf. If you can paste your udf here, I may help you.

Regards, Akshay


ranjit January 19, 2007 05:35

Re: UDF hooking error
 
i Tried it with a very simple UDf, it interprets well

#include "udf.h"

DEFINE_PROPERTY(temperature, c, t) {

real temp = C_T(c, t);

return temp; }

My main concern is with the following udf, it doesnt interpret properly

#include "udf.h"

DEFINE_PROPERTY(temp, c, t) { cell_t c; Thread *t; real tmp;

begin_c_loop(c, t) { tmp=C_T(c, t); return tmp; } end_c_loop(c, t) }

it gives an absurd error like, Line4: function returns float instead of float.

please can anyone help me with this?

Akshay January 19, 2007 08:58

Re: UDF hooking error
 
Hi ranjit, Define property macro visits all the cells. So you dont need a macro to loop over all the cells. In continuation to the above, you dont need to define cell_t c and Thread *t as they are already defined variable for this macro.

See the definition given in the manual. DEFINE_PROPERTY( name, c, t) Argument Type Description char name UDF name. cell_t c Cell index. Thread *t Pointer to cell thread on which the property function is to be applied.

As a whole you have to modify your second UDF to first one which you have already done.

I think you are looking at something more than this.


ranjit January 19, 2007 10:53

Re: UDF hooking error
 
ok thanks, i guess the reason it doesnt enable the solve--->iterate option is because the udf doesnt do much other than read the temperature and return the same.



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