CFD Online Discussion Forums

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

vijay April 7, 2006 06:31

error while implementing UDF
 
Hi,

I want to implement a udf for pressure as a function of time. I have given below the program that i wrote. But when i tried to interpret it in FLUENT it is saying line 1:parse error. Can u please tell me how to rectify the mistake? Thanks in advance

#include "udf.h"

DEFINE_PROFILE(unsteady_pressure, thread, position) { face_t f;

begin_f_loop(f, thread)

{

real t = RP_Get_Real("flow-time");

F_PROFILE(f, thread, position) = 0.1691*(t^5) - 9.0129*(t^4) + 173.84*(t^3) - 1364.8*(t^2) + 357.61*t + 100981;

} end_f_loop(f, thread) }

Aidan April 7, 2006 10:41

Re: error while implementing UDF
 
the pow(x,y) fucnction must be used for x^y #include "udf.h"

DEFINE_PROFILE(unsteady_pressure, thread, position)

{

face_t f;

begin_f_loop(f, thread)

{

real t = RP_Get_Real("flow-time");

F_PROFILE(f, thread, position) = 0.1691*(pow(t,5)) - 9.0129*(pow(t,4)) + 173.84*(pow(t,3)) - 1364.8*(pow(t,2)) + 357.61*t + 100981;

}

end_f_loop(f, thread)

}


vijay April 7, 2006 23:49

Re: error while implementing UDF
 
Thanks a lot Aidan. Its working now.


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