
[Sponsors] 
June 9, 2009, 18:08 
Surrounding cells of a node

#1 
Member
Join Date: Mar 2009
Location: Istanbul, Turkiye
Posts: 45
Rep Power: 8 
Hi everyone,
In my udf, I need to calculate the node value of a UDS. To do this I want to use following formula UDS_node_value = (1/number_of_CVs)*(summation of cell center UDS value of surrounding CVs) Does someone have an idea how to obtain cell ids of surrounding cells. Scanning adjacent cells of a node make things very complicated. Thanks 

June 29, 2009, 13:30 

#2 
Member
Akour
Join Date: May 2009
Posts: 79
Rep Power: 8 
hi,
I would like to do something similar...unfortunately i dont know how, have you gotten anywhere with this yet?...I would appreciate any advice if you have. Thanks AK 

June 30, 2009, 02:30 

#3 
Member
Join Date: Mar 2009
Location: Istanbul, Turkiye
Posts: 45
Rep Power: 8 
Hi,
I don't have a solution for this issue. I think Fluent will not let us to use more accurate gradient calculation. I applied the Gauss theorem myself using face values calculated by equating fluxes from the two cells adjacent to the face. Good luck. Gemini 

June 30, 2009, 06:29 

#4  
Member
Akour
Join Date: May 2009
Posts: 79
Rep Power: 8 
Quote:
Thanks for your speedy reply, so when you access an adjacent cell in FLUENT using the F_CO and F_C1 macros, how do you know if its the cell to the right, left, top or bottom of it??? adjacent could be in any direction...this effectively means that we cannot do detailed Finite volume discretisation within the UDF environment im assuming..am I right? There is no way to know which direction the adjacent cell is in relative to the initial cell? Thanks again AK 

June 30, 2009, 12:31 

#5  
Member
Join Date: Mar 2009
Location: Istanbul, Turkiye
Posts: 45
Rep Power: 8 
Quote:
Please careful that c0 cell is your center cell identified by c. if not you should treat c1 cell as your center cell. You can check this by making 3x3 2d grid having 9 cells and by writing an execute on demand function which prints out current cell id (c) and its face ids (f) and c0 and c1 values of each face of the current cell (c) with area vector (A) components. So you can clearly understand the situation. best luck Gemini 

July 1, 2009, 12:40 

#6 
Member
Akour
Join Date: May 2009
Posts: 79
Rep Power: 8 
Gemini,
thank you very much for your help, i have one FINAL question, i promise, you seem experienced so I woul value your assistance, when I use the macro C_UDSI_G(...) for gradient calculation, if I want to calculate a source term which depends on the gradient of the scalar being solved, do I need to write the gradient down as C_UDSI_G(...)*C_VOLUME(c,t)...because of gauss's theorem? or does fluent treat the gradient function C_UDSI_G(...) as a fully discretised version which incorporates the integration of the gradient?? Thank you very much for all of your help AK 

July 2, 2009, 14:28 

#7  
Member
Join Date: Mar 2009
Location: Istanbul, Turkiye
Posts: 45
Rep Power: 8 
Quote:
regards, Gemini 

July 2, 2009, 18:05 

#8 
Member
Akour
Join Date: May 2009
Posts: 79
Rep Power: 8 
hi gemini,
My actual problem is outlined in the post 'problematic source term UDS', here is the link: problematic source term in UDS I posted this about a week ago, basically, the way I defined my source term (see the post) causes my solution to diverge so I think I may need to do it manually somehow via accessing individual cell faces, and calculating gradients manually by accessing north, south,east and west faces... I think the soltuion is diverging because of a problem similar to decoupling of pressure and velocity when solving the momentum equation, only in my case it is with space charge and electric field... If it is easier you can reply on that post, the source term is a little bit more complicated than usual... Thank you so much AK
__________________
akour 

July 4, 2009, 14:54 

#9  
Member
Join Date: Mar 2009
Location: Istanbul, Turkiye
Posts: 45
Rep Power: 8 
Quote:
In your first function you have Code:
/*problematic source of scalar 2 (Q)*/ DEFINE_SOURCE(spcharge_lin,c,t,dS,eqn) ... dS[eqn] = 0.0; Code:
/*OK source of scalar 2*/ DEFINE_SOURCE(spcharge_quad,c,t,dS,eqn) ... dS[eqn] = (2*pow(C_R(c,t),2)*C_UDSI(c,t,1)*kappa)/epsilon; Good luck 

Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
how to get node coordinates for free surface cells  fred  FLUENT  1  August 15, 2014 01:52 
Import netgen mesh to OpenFOAM  hsieh  Open Source Meshers: Gmsh, Netgen, CGNS, ...  32  September 13, 2011 05:50 
7 Node Hexahedral Cells  Mark  FLUENT  0  February 5, 2007 12:10 
defining cells where connecting to one node  Asghari  FLUENT  0  July 11, 2006 09:36 
physical boundary error!!  kris  CDadapco  2  August 3, 2005 00:32 