UDF help!

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

 March 3, 2005, 17:44 UDF help! #1 Bikash Guest   Posts: n/a can anyone help me with this udf.i get errors when i compile it. #include "udf.h" #define hp 2.0 DEFINE_SOURCE (cell_source,cell,thread,dS,eqn) { real x[ND_ND], x_coord, y_coord,r,p,source; cell_t c; begin_c_loop(c, thread) { C_CENTROID(x,c,thread); x_coord = x[0]; y_coord = x[1]; p = SQR(x_coord) + SQR(y_coord); r = SQRT(p); source = hp/r; } end_c_loop(c,thread) }

 March 3, 2005, 21:04 Re: UDF help! #2 Erica Guest   Posts: n/a add 'return source;' at last row

 March 3, 2005, 22:20 Re: UDF help! #3 laoquange Guest   Posts: n/a Your problem is 2D or 3D?

 March 4, 2005, 05:13 Re: UDF help! #4 Giordano Bruno Guest   Posts: n/a In DEFINE_SOURCE you can't use "begin_c_loop" and you must specify dS[eqn]. Good luck!!! Giordano Bruno

 March 5, 2005, 13:42 Re: UDF help! #5 Bikash Guest   Posts: n/a its a 2D problem

 March 6, 2005, 01:55 Re: UDF help! #6 laoquange Guest   Posts: n/a Why did not ou try the function? face_t f thread *thread begin_f_loop(f, thread) { }end_f_loop Good lucky

 March 8, 2005, 10:26 Re: UDF help! #7 Bikash Guest   Posts: n/a i want the centroid of the cell to find the radial distance of each cell from the center of the model. thank you

 March 14, 2005, 21:39 Re: UDF help! #8 Angelo Sozzi Guest   Posts: n/a Why do you want to define it as a source then? Just use a define on demand and save the values in User Defined Memory. You can always access the distance with over the memory then C_UDMI(c,t,0). DEFINE_ON_DEMAND(init_UDS_distance) { Domain *d; Thread *t; cell_t c; real x[ND_ND], x_coord, y_coord,r,p,source; d = Get_Domain(1); t = Lookup_Thread(d, thread_id); /* Loop over all the cells in the given thread */ begin_c_loop (c,t) { C_CENTROID(x,c,t); x_coord = x[0]; y_coord = x[1]; p = SQR(x_coord) + SQR(y_coord); r = SQRT(p); C_UDMI(c,t,0) = hp/r; } end_c_loop(c,t) } Where does hp (hp/r) come from ?

 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 shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14 kim FLUENT 3 October 26, 2011 21:38 Qureshi FLUENT 1 December 2, 2009 01:27 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 11:51.