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/)
-   -   how to find the index of the adjacent cell of one cell? (http://www.cfd-online.com/Forums/fluent-udf/77890-how-find-index-adjacent-cell-one-cell.html)

jing113cn July 7, 2010 03:51

how to find the index of the adjacent cell of one cell?
 
Hello,

I want to get the tempreture in the left cell next to one cell. And there are 4 faces on one cell in my grid. How can I do this with udf ?

dayigu July 7, 2010 22:55

Thread *tf;
face_t f;
cell_t c0;
real x[ND_ND], xf[ND_ND];
int n;
real T;

C_CENTROID(x, c, t);
c_face_loop(c, t, n) /* loops over all faces of a cell */
{
tf = C_FACE_THREAD(c,t,n);
f = C_FACE(c,t,n);
F_CENTROID(xf, f, tf);
if is_left_to_the_cell(x, xf) /* is the face left to the cell? */
{
c0 = F_C0(f, tf);
if (c0 == c) /* is itself */
c0 = F_C1(f, tf);
T = C_T(c0,t);
break;
}
}

jing113cn July 8, 2010 03:26

Than you very much !


All times are GMT -4. The time now is 02:39.