CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > ANSYS > FLUENT > Fluent UDF and Scheme Programming

Power load UDF

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 18, 2011, 03:31
Default Power load UDF
  #1
Member
 
Join Date: Dec 2009
Posts: 41
Rep Power: 16
Rich1979 is on a distinguished road
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.
Rich1979 is offline   Reply With Quote

Old   March 18, 2011, 04:05
Default
  #2
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
Hi,
you can do that with DEFINE_PROFILE macro and hook that in heat flux boundary condition.
Amir is offline   Reply With Quote

Old   March 18, 2011, 05:49
Default
  #3
Member
 
Join Date: Dec 2009
Posts: 41
Rep Power: 16
Rich1979 is on a distinguished road
Thx for your answer
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?
Thx again for your support!

Last edited by Rich1979; March 18, 2011 at 06:06.
Rich1979 is offline   Reply With Quote

Old   March 18, 2011, 08:34
Default
  #4
Senior Member
 
Amir's Avatar
 
Amir
Join Date: May 2009
Location: Montreal, QC
Posts: 735
Blog Entries: 1
Rep Power: 23
Amir is on a distinguished road
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.
Amir is offline   Reply With Quote

Old   March 21, 2011, 02:05
Default
  #5
Member
 
Join Date: Dec 2009
Posts: 41
Rep Power: 16
Rich1979 is on a distinguished road
Thx a lot Amir,your advise was very useful!I realized my udf
Rich1979 is offline   Reply With Quote

Reply


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 Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
failing to load a UDF IvanCFD Fluent UDF and Scheme Programming 13 January 20, 2012 16:17
UDF parallel error: chip-exec: function not found????? shankara.2 Fluent UDF and Scheme Programming 1 January 16, 2012 23:14
try to load a edited UDF austin Main CFD Forum 0 February 20, 2009 06:25
help on UDF compile and load Sherry FLUENT 5 October 29, 2005 12:37
udf power function nd FLUENT 2 September 2, 2005 14:39


All times are GMT -4. The time now is 09:59.