# udf help.....

 Register Blogs Members List Search Today's Posts Mark Forums Read

 January 11, 2008, 10:13 udf help..... #1 Ken 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, 11:10 Re: udf help..... #2 al_c Guest   Posts: n/a At the beginning of every UDF you write must be #include "udf.h"

 January 11, 2008, 11:15 Re: udf help..... #3 Ken 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, 12:24 Re: udf help..... #4 al_c 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, 13:58 Re: udf help..... #5 Ken Lau 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, 15:27 Re: udf help..... #6 al_c 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, 16:13 Re: udf help..... #7 Ken Lau Guest   Posts: n/a thanks alot, finally it works!!!! thank you for your help^^

 Thread Tools Display Modes Linear Mode

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is On HTML code is OffTrackbacks are On Pingbacks are On Refbacks are On Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post Qureshi FLUENT 7 March 23, 2017 08:37 shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14 kim FLUENT 3 October 26, 2011 21:38 Luc SEMINEL FLUENT 0 November 25, 2002 05:03 Luc SEMINEL Main CFD Forum 0 November 25, 2002 05:01

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