CFD Online Logo CFD Online URL
Home > Forums > Software User Forums > ANSYS > FLUENT

read rake in UDF

Register Blogs Members List Search Today's Posts Mark Forums Read

LinkBack Thread Tools Display Modes
Old   June 18, 2008, 19:35
Default read rake in UDF
Tomasz Bednarz
Posts: n/a
g'day, enclosed please find the excerpt of the code which reads the rake points in UDF, You need to use surface_id (surf_id) to get acces to a specific rake in your case file, Anyway, later there are two loops: first one goes through all rake points and the second one which is based on my personal experiments (not documented anywhere in fluent manuals or forums) calculates the coordinates of the rake point in a specific cell (as 2d vector) which is later used for some mathematical operations with grads to get to a specific and reqired value, The example here, extracts U and V along the rake, hope it helps to somebody, kindest regards, Tomasz

surf_id = get_surface_id_by_name(surfname);

if (surf_id > 0) {

surf = &SurfaceList[surf_id];

Message0 ("surface %s of id %d with no of points %d\n",surfname,surf_id,surf->np);

for (i=0; i<surf->np; i++)


c = surf->points[i].cell;

cell = RP_CELL(&c);

t = RP_THREAD(&c);


x=0; y=0;

for (j=0; j<surf->points[i].nc; j++)


node = C_NODE(cell,t,surf->points[i].ip[j].nid);

x += node->x[0]*surf->points[i].ip[j].wt;

y += node->x[1]*surf->points[i].ip[j].wt;




z0 = 0.0f;

NV_VV(dz, =, xy, -, centroid);

NV_V (gradz, =, C_T_G(cell,t));

z0 = C_T(cell,t);

z = z0 + NV_DOT(gradz, dz);

tt[i] = z;

NV_V (gradu, =, C_U_G(cell,t));

u0 = C_U(cell,t);

u = u0 + NV_DOT(gradu, dz);

NV_V (gradv, =, C_V_G(cell,t));

v0 = C_V(cell,t);

v = v0 + NV_DOT(gradv, dz);

/* your velocity components are in u and v */


  Reply With Quote


Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Difference between rake and line in line/rake tool shashikant FLUENT 3 December 10, 2009 07:06
Points on Rake suvash FLUENT 0 October 26, 2006 23:20
Line/Rake gts FLUENT 1 February 1, 2005 04:29
rake ID in UDF Sebastian FLUENT 0 June 11, 2004 20:55
Rake question Rex FLUENT 0 August 6, 2002 05:34

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