|
[Sponsors] |
January 19, 2007, 02:23 |
UDF hooking error
|
#1 |
Guest
Posts: n/a
|
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. |
|
January 19, 2007, 03:17 |
Re: UDF hooking error
|
#2 |
Guest
Posts: n/a
|
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 |
|
January 19, 2007, 05:35 |
Re: UDF hooking error
|
#3 |
Guest
Posts: n/a
|
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? |
|
January 19, 2007, 08:58 |
Re: UDF hooking error
|
#4 |
Guest
Posts: n/a
|
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. |
|
January 19, 2007, 10:53 |
Re: UDF hooking error
|
#5 |
Guest
Posts: n/a
|
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.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CGNS lib and Fortran compiler | manaliac | Main CFD Forum | 2 | November 29, 2010 07:25 |
[swak4Foam] groovyBC: problems compiling: "flex: not found" and "undefined reference to ..." | sega | OpenFOAM Community Contributions | 12 | February 17, 2010 10:30 |
Installation OF1.5-dev | ttdtud | OpenFOAM Installation | 46 | May 5, 2009 03:32 |
attach/detach (valve opening/closing) | phsieh2005 | OpenFOAM Running, Solving & CFD | 2 | March 21, 2009 06:18 |
Problem with compile the setParabolicInlet | ivanyao | OpenFOAM Running, Solving & CFD | 6 | September 5, 2008 21:50 |