CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   FLUENT (http://www.cfd-online.com/Forums/fluent/)

 Tomasz Bednarz June 18, 2008 19:35

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);

C_CENTROID(centroid,cell,t);

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;

}

xy[0]=x;

xy[1]=y;

z0 = 0.0f;

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

z0 = C_T(cell,t);

z = z0 + NV_DOT(gradz, dz);

tt[i] = z;

u0 = C_U(cell,t);

u = u0 + NV_DOT(gradu, dz);