CAPE Forum
Ansys => Fluent => Topic started by: mali28 on January 14, 2012, 09:58:01 PM

Hello,
I have a geometry with varying diameter along the column height. I want to specify heat loss condition because the wall is insulated. For that, I need to calculate the overall heat transfer coefficient first. For that I need the inside diameter of the column as well. Since the diameter is not constant throughout the geometry, I have to find a way of calculating the distance from the centre of geometry up to the wall using UDF.
Any help will be highly appreciated.
Thank you.

Fluent offers geometry macros to get the coordinates of the node. Once you know the node coordinates, use the equation of the circle to get the radius. The code below shows how you implement it.
face_t f;
Thread *tf = DT_THREAD(dt);
real xnode, ynode, r;
int n;
begin_f_loop(f,tf) /* Loops over all faces in the thread passed in the DEFINE macro argument */
{
f_node_loop(f,tf,n) /* Loops over all nodes in the face */
{
Node *node;
xnode = NODE_X(node); /* calculate xcoordinate of a grid point on wall */
ynode = NODE_Y(node); /* calculate ycoordinate of a grid point on wall */
r = sqrt(pow(xnode,2)+pow(ynode,2)); /* calculate radial coordinate of the grid point on wall */
}
//Enter your equation here which you want to calculate as a function of radius
}
end_f_loop(f,tf);

Thank you very much!
You solved my problem.
:D