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

 March 18, 2011, 03:31 Power load UDF #1 Member   Join Date: Dec 2009 Posts: 41 Rep Power: 8 Hi everybody, I have a question : i have to write an UDF for a thermal load on a surface (lateral surface of a truncated cone).The thermal load follows the law P(z) = a*z^b where z is the distance from the source. How could i set up my UDF? Thx mates.

 March 18, 2011, 04:05 #2 Senior Member     Amir Join Date: May 2009 Location: Montreal, QC Posts: 739 Blog Entries: 1 Rep Power: 15 Hi, you can do that with DEFINE_PROFILE macro and hook that in heat flux boundary condition.

March 18, 2011, 05:49
#3
Member

Join Date: Dec 2009
Posts: 41
Rep Power: 8
Could it be something like :

Quote:
 #include "udf.h" DEFINE a 1 DEFINE b 2 DEFINE_PROFILE (powerload, t, i) { real x[ND_ND]; real y; real z; face_t f; begin_f_loop(f, t) { F_CENTROID(x,f,t); z = x[1]; F_PROFILE(f, t, i) = a*z^b; } end_f_loop(f, t) }
At ND_ND have i to put 3D_3D?

Last edited by Rich1979; March 18, 2011 at 06:06.

 March 18, 2011, 08:34 #4 Senior Member     Amir Join Date: May 2009 Location: Montreal, QC Posts: 739 Blog Entries: 1 Rep Power: 15 it needs some changes: Code: ```#include "udf.h" #include "math.h" #define a 1 #define b 2 DEFINE_PROFILE (powerload, t, i) { real x[ND_ND]; real z; face_t f; begin_f_loop(f, t) { F_CENTROID(x,f,t); z = x[2]; F_PROFILE(f, t, i) = a*pow(z,b); } end_f_loop(f, t) }``` it doesn't need to change ND_ND. it automatically adopts itself.

 March 21, 2011, 02:05 #5 Member   Join Date: Dec 2009 Posts: 41 Rep Power: 8 Thx a lot Amir,your advise was very useful!I realized my udf

 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 IvanCFD Fluent UDF and Scheme Programming 14 January 23, 2012 14:33 shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14 austin Main CFD Forum 0 February 20, 2009 06:25 Sherry FLUENT 5 October 29, 2005 11:37 nd FLUENT 2 September 2, 2005 13:39

All times are GMT -4. The time now is 00:17.