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

Create a Cosine shapped wall heat flux in 3d geometry

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 3, 2012, 13:30
Default Create a Cosine shapped wall heat flux in 3d geometry
  #1
New Member
 
Join Date: Mar 2012
Posts: 6
Rep Power: 14
scottimus is on a distinguished road
Hello,

I have been tasked to model flow around heated rods in fluent. The heat flux profile for the rod is a cosine shape of the form

qflux (W/m^2) =A*cos(B*y);

where A and B are constants and y is the height position from 0 to some arbitrary height h.

My model is 3 dimensional but the wall upon which I want to put this condition is cylindrical in shape with constant radius, r.

I have been reading through the UDF manual and need some help. This is what I have so far:

/************************************************** ***
UDF for specifying the heat flux from a cosine shapped
heatflux boundary profile in three dimensions
************************************************** ***/

#include "udf.h"

DEFINE_PROFILE(cos_profile,t,i)
{
face_t f;
begin_f_loop(f,thread)
F_PROFILE(f,thread,i) = A*cos(B*y);
end_f_loop(f,thread)
}

Where once again A and B are just place holders for constant values and y represents the cosine profile which changes axially but is constant radially around the rod.

My question is what modifications/additions do I need to do to have this profile be implemented correctly for Fluent?

I appreciate your pointers and forgive me if this has been covered at some point and I did not locate it.
scottimus is offline   Reply With Quote

Old   April 4, 2012, 18:42
Default
  #2
New Member
 
Join Date: Mar 2012
Posts: 6
Rep Power: 14
scottimus is on a distinguished road
After much time of sadness and despair in my first escapades into the seemingly uncharted (to the beginner) but frequently traveled world of UDF's I regrouped and I think I fixed the little bugs and now have a working solution.

The solution below seems to work so have fun using this or adapting it to your purposes. Hopefully this will help someone out. If anyone, including myself, happens to find error in the future feel free to correct.

/************************************************** ***
UDF for specifying the heat flux from a cosine shapped
heatflux boundary profile in three dimensions
************************************************** ***/

#include "udf.h"

DEFINE_PROFILE(cos_profile, thread, position)
{
real x[ND_ND];
real y;
face_t f;

begin_f_loop(f, thread)
{
y = x[1];
F_CENTROID(x, f, thread);
F_PROFILE(f,thread,position) = A*cos(B*y);
}
end_f_loop(f, thread)
}

Take care yall!
Scott
scottimus is offline   Reply With Quote

Reply

Tags
boundary condition, help me, udf


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
problem with heat flux in the wall gholamghar FLUENT 1 September 14, 2010 08:47
Heat flux at the wall. Sang FLUENT 0 February 20, 2010 00:20
Actuator disk model audrich FLUENT 0 September 21, 2009 08:06
Where's the singularity/mesh flaw? audrich FLUENT 3 August 4, 2009 02:07
Convective Heat Transfer - Heat Exchanger Mark CFX 6 November 15, 2004 16:55


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