|
[Sponsors] |
June 18, 2008, 19:35 |
read rake in UDF
|
#1 |
Guest
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); 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); 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 */ } |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Difference between rake and line in line/rake tool | shashikant | FLUENT | 3 | December 10, 2009 06:06 |
Points on Rake | suvash | FLUENT | 0 | October 26, 2006 23:20 |
Line/Rake | gts | FLUENT | 1 | February 1, 2005 03:29 |
rake ID in UDF | Sebastian | FLUENT | 0 | June 11, 2004 20:55 |
Rake question | Rex | FLUENT | 0 | August 6, 2002 05:34 |