udf help.....
hi everyone, i was trying to write an equation into udf but what i got is line 1 parse error... i am new to fluent and the udf thing, so here is my equation,
u=170 * (1 + tanh((25-y)/2.25)) and the udf i worte is based on the tutorial file i found in fluent.... here is the udf i wrote... DEFINE_PROFILE(mass_flow_velocity,thread,index) { real x[ND_ND]; real y; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f,thread,index) = 170.*(1.+tanh((25.-y)/2.25)); } end_f_loop(f,thread) } can anyone correct it for me?? thanks alot... |
Re: udf help.....
At the beginning of every UDF you write must be
#include "udf.h" |
Re: udf help.....
thanks for the advise~~
but it still comes out with the 'line 1: parse error'... would it be something wrong with my udf itself?...wrong command or so..? |
Re: udf help.....
I think, your udf is correct, only #include "udf.h" is missing. What operator do you have at line 1 after you add #include 'udf.h'? Do you use interpreted or compiled UDF?
|
Re: udf help.....
what do you mean by operator?
i actually havent got anything after line 1, just as it is in my shown udf... i used interpreted udf~~ |
Re: udf help.....
Here is the corrected udf - first line is #include "udf.h" :
#include "udf.h" DEFINE_PROFILE(mass_flow_velocity,thread,index) { real x[ND_ND]; real y; face_t f; begin_f_loop(f,thread) { F_CENTROID(x,f,thread); y = x[1]; F_PROFILE(f,thread,index) = 170.*(1.+tanh((25.-y)/2.25)); } end_f_loop(f,thread) } |
Re: udf help.....
thanks alot, finally it works!!!!
thank you for your help^^ |
All times are GMT -4. The time now is 22:03. |