# flux around one specific cell

 User Name Remember Me Password
 Register Blogs Members List Search Today's Posts Mark Forums Read

 LinkBack Thread Tools Display Modes
 October 7, 2010, 17:25 flux around one specific cell #1 Member   CJ Join Date: Jun 2009 Posts: 34 Rep Power: 10 Sponsored Links Dear, 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!! DEFINE_ON_DEMAND(get_mf) { 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). */ mf=0.0; 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); if (!BOUNDARY_FACE_THREAD_P(tf)) { /* 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 */ } else { 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;
 Sponsored Links

 Thread Tools Display Modes Linear Mode

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

 Similar Threads Thread Thread Starter Forum Replies Last Post Sas CFX 15 July 13, 2010 08:56 Purushothama Siemens 2 May 31, 2010 21:58 saii CFX 2 September 18, 2009 08:07 michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15 AB Siemens 6 November 15, 2004 05:41

 Sponsored Links

All times are GMT -4. The time now is 21:52.

 Contact Us - CFD Online - Top