|
[Sponsors] |
January 11, 2008, 09:13 |
udf help.....
|
#1 |
Guest
Posts: n/a
|
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... |
|
January 11, 2008, 10:10 |
Re: udf help.....
|
#2 |
Guest
Posts: n/a
|
At the beginning of every UDF you write must be
#include "udf.h" |
|
January 11, 2008, 10:15 |
Re: udf help.....
|
#3 |
Guest
Posts: n/a
|
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..? |
|
January 11, 2008, 11:24 |
Re: udf help.....
|
#4 |
Guest
Posts: n/a
|
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?
|
|
January 11, 2008, 12:58 |
Re: udf help.....
|
#5 |
Guest
Posts: n/a
|
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~~ |
|
January 11, 2008, 14:27 |
Re: udf help.....
|
#6 |
Guest
Posts: n/a
|
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) } |
|
January 11, 2008, 15:13 |
Re: udf help.....
|
#7 |
Guest
Posts: n/a
|
thanks alot, finally it works!!!!
thank you for your help^^ |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Dynamic Mesh UDF | Qureshi | FLUENT | 7 | March 23, 2017 07:37 |
UDF parallel error: chip-exec: function not found????? | shankara.2 | Fluent UDF and Scheme Programming | 1 | January 16, 2012 22:14 |
How to add a UDF to a compiled UDF library | kim | FLUENT | 3 | October 26, 2011 21:38 |
UDF...UDF...UDF...UDF | Luc SEMINEL | FLUENT | 0 | November 25, 2002 04:03 |
UDF, UDF, UDF, UDF | Luc SEMINEL | Main CFD Forum | 0 | November 25, 2002 04:01 |