CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   Main CFD Forum (https://www.cfd-online.com/Forums/main/)
-   -   UDF for wall temperature (https://www.cfd-online.com/Forums/main/69004-udf-wall-temperature.html)

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;

begin_f_loop(f,thread)
{
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

Hi,

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.

regards.............Bak_Flow

/************************************************** ********************
udfexample.c
UDF for specifying a steady-state velocity profile boundary condition
************************************************** ********************/
#include "udf.h" /* must be at the beginning of every UDF you write */
DEFINE_PROFILE(x_velocity,thread,index)
{
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 */
{
F_CENTROID(x,f,thread);
y = x[1];
F_PROFILE(f,thread,index) = 20. - y*y/(.0745*.0745)*20.;
}
end_f_loop(f,thread)
}

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 20:43.