CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   Fluent UDF and Scheme Programming (http://www.cfd-online.com/Forums/fluent-udf/)
-   -   udf for 3d model to give heat flux profile around the wall surface (http://www.cfd-online.com/Forums/fluent-udf/106718-udf-3d-model-give-heat-flux-profile-around-wall-surface.html)

n7310889 September 6, 2012 06:21

udf for 3d model to give heat flux profile around the wall surface
 
Hi, could any of you can tell me whats wrong with this macro? Its for 3d to provide input heat-flux profile around a semi circular cylinder of 33mm radius and 1.5m long.The heat profile varies along the verticle y direction and translates the same along the horizontal z axis.

#include "udf.h"

DEFINE_PROFILE(heat_profile,thread,index)
{
real x[ND_ND];
real x,y,z,r,angle;

face_t f;

begin_f_loop(f,thread)
{
F_CENTROID(x,f,thread);

x =x[0];
y =x[1];
z =x[2];
r =sqrt(pow(x,2)+pow(y,2));
angle =acos(-y/r);

if ((z>=0.0) && (z<=1.4))
{

if ((angle>=0.0) && (angle<=60.0))
{
F_PROFILE(f,thread,index) =6500.0;
}

if ((angle>50.0) && (angle<=180.0))
{
F_PROFILE(f,thread,index) =0.0;
}

}

else
{
F_PROFILE(f,thread,index) =0.0;
}
}

end_f_loop(f,thread)
}


All times are GMT -4. The time now is 01:11.