CFD Online Logo CFD Online URL
Home > Forums > FLUENT

flux around one specific cell

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

LinkBack Thread Tools Display Modes
Old   October 7, 2010, 17:25
Default flux around one specific cell
Join Date: Jun 2009
Posts: 34
Rep Power: 8
solefire is on a distinguished road

I have a question, probably it is very easy for u, if I have got a cell ID , source[0], I want to get the flux of faces of this cell, "just for this cell" , it is structured grid, could u help check what is wrong with my code, Thanks a lot!!

Domain *d; /*pointer to the collection of all cells' threads (stored information) */
/* declare domain pointer since it is not passed as an argument to the DEFINE macro */
cell_t c; /* cell identifier */
Thread *t; /* pointer to a thread */
d = Get_Domain(1); /*domain is already available to your function (via define_adjust argument). */
int i=0.0;

/************try to get neighbouring faces of the cell********************************************** ***/

/* If face lies at domain boundary, use face values; */
/* If face lies IN the domain, use average of adjacent cells. */

c_face_loop(c, t, i)

face_t f;
Thread *tf;
f = C_FACE(c,t,i);
tf = C_FACE_THREAD(c,t,i);
c0 = F_C0(f,tf);
c1 = F_C1(f,tf);
t0 = THREAD_T0(tf);
t1 = THREAD_T1(tf);
real NV_VEC(psi_vec), NV_VEC(A), flux = 0.0;
F_AREA(A, f, t);

/* c0 is current cell*/
if (c0 == source[0])

NV_DS(psi_vec, =, C_U(c,t),C_V(c,t),C_W(c,t),*,1.0);
NV_DS(psi_vec, +=, C_U(c1,t1),C_V(c1,t1),C_W(c1,t1),*,1.0);
flux = NV_DOT(psi_vec, A)/2.0; /* Average flux through face */


NV_DS(psi_vec, =, C_U(c0,t0),C_V(c0,t0),C_W(c0,t0),*,1.0);
NV_DS(psi_vec, +=, C_U(c,t),C_V(c,t),C_W(c,t),*,1.0);
flux = NV_DOT(psi_vec, A)/2.0; /* Average flux through face */



hereby density is 1.0;
solefire is offline   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
Constant velocity of the material Sas CFX 15 July 13, 2010 08:56
Cells with t below lower limit Purushothama CD-adapco 2 May 31, 2010 21:58
mass flow in is not equal to mass flow out saii CFX 2 September 18, 2009 08:07
Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15
Warning 097- AB CD-adapco 6 November 15, 2004 05:41

All times are GMT -4. The time now is 23:16.