CFD Online Discussion Forums

CFD Online Discussion Forums (
-   Main CFD Forum (
-   -   UDF for wall temperature (

dhanshan1986 October 8, 2009 12:48

UDF for wall temperature
Hello, I am new to using UDFs on fluent and am finding it quite hard. I need to specify a wall (vertical walls) temperature boundary condition : T(x) = 800*X/0.2 where X (m) is the distance of the point from the top of the geometry (rectangular) which is totally 50 cm long. The origin of the geometry is at the bottom.

This is the code I have written so far:

#include "udf.h"
DEFINE_PROFILE(wall_temp, thread, position)
real x[ND_ND]; /* this will hold the position vector */
real y;
cell_t f;

F_CENTROID(x, f, thread);
y = x[1];
F_T(f,thread,position) = (800.*(50.-y))/20;
end_f_loop(f, thread)

When I interpret the udf and run my calculation on fluent, I do not get the result I expect and instead I get a contant temperature of 2000 K. I also get an 'nmake' error during compilation. Is compilation necessary ?
Thanks in advance.

Bak_Flow October 8, 2009 15:32


there is a tutorial that is very similar to your problem in the UDF manual...just change it to operate on temp and not x_velocity and the profile. Be careful with units as I see in your post you have m and cm.


/************************************************** ********************
UDF for specifying a steady-state velocity profile boundary condition
************************************************** ********************/
#include "udf.h" /* must be at the beginning of every UDF you write */
real x[ND_ND]; /* this will hold the position vector */
real y;
face_t f;
begin_f_loop(f,thread) /* loops over all faces in the thread passed
in the DEFINE macro argument */
y = x[1];
F_PROFILE(f,thread,index) = 20. - y*y/(.0745*.0745)*20.;

dhanshan1986 October 8, 2009 17:07

Yes, I am aware of this. But this equation is not a centroid (parabola type) form and intead is a profile that starts from the top of the rectangular furnace wall. Is there any command I need to change to incorporate this ?..I dont think centroid will work in my case. Please let me know. Thanks.

All times are GMT -4. The time now is 19:53.