
[Sponsors] 
September 24, 2011, 10:52 
Determining cell neighbours on unstructured grid

#1 
New Member
Orxan Shibliyev
Join Date: Aug 2011
Posts: 18
Rep Power: 6 
Hi all.
I want to know is there an efficient way of determining cell neighbours on unstructured grid other than the way in which nodes of (say) hexahedra compared one by one. I mean, hex_1 : node_1, node_2, node_3, node_4 hex_2 : node_5, node_6, node_7, node_8 if hex_1 and hex_2 have 3 nodes in common then they are neighbours. So is there a better way? 

September 24, 2011, 12:50 

#2 
Senior Member

Well, i think it depends on which kind of information you have. In a cellbased solver i think it's much more efficient to deal with faces. In fluent .msh files you have the following kind of information:
nodes: x1 y1 z1 x2 y2 z2 . . . xn yn zn faces: nf1 n_1 n_2 ... n_nf1 c0_f1 c1_f1 nf2 n_1 n_2 ... n_nf2 c0_f2 c1_f2 . . . nfm n_1 n_2 ... n_nfm c0_fm c1_fm where there are n total nodes, m total faces and for the jth face the total number of nodes is nfj In this kind of file you have, for each face, the two neighboring cells (c0_fj c1_fj). Hence, to obtain the information you're looking for, you just need to invert such relationship (once for all). This can be done by allocating an array like: f1_1 f2_1 . . . fk_1 f1_2 f2_2 . . . fk_2 . . . f1_s f2_s . . . fk_s where each row is relative to a cell of the grid. Of course not all the cells will have the same number of faces, so some memory could be wasted. the array is built by a single loop over the faces and, once you have it, you can retrieve the neighbor information trough the 2 previous arrays. If you have a node based solver, this is probably not going to work. In that case you can find some information on the book: R. Lohner: Applied CFD Techniques. An Introduction based on Finite Element Methods. Wiley, 2nd Ed. P.S. I can't think of hexas made up by 4 nodes and sharing each other only 3 nodes. I would change these numbers in 8 and 4 respectively... or maybe hexas in tetra. 

September 24, 2011, 18:00 

#3 
New Member
Orxan Shibliyev
Join Date: Aug 2011
Posts: 18
Rep Power: 6 
Method is cellcentered. Meshing program is GMSH. The file is msh file. Something like this:
total number of nodes  total number of elements  node_1 x y z . . . line_1 node_# node_# (these lines belong to boundary only!) . . . triangle_1 node_# node_# node_# . . . tetra_1 node_# node_# node_# node_# . . . Thats all. 

September 25, 2011, 05:20 

#4 
Senior Member

I really suggest you to read the book mentioned above, which has algorthmic examples to treat this specific problem. Nonetheless, in this case, you are right: the only way is to check for common nodes as this is the only information you have.


September 25, 2011, 05:29 

#5 
New Member
Orxan Shibliyev
Join Date: Aug 2011
Posts: 18
Rep Power: 6 
Thank you very much for answering my questions.


Tags 
unstructured neighbour 
Thread Tools  
Display Modes  


Similar Threads  
Thread  Thread Starter  Forum  Replies  Last Post 
unstructured grid problem  jack  Main CFD Forum  3  September 18, 2008 03:55 
2D unstructured Grid  prapanj  Main CFD Forum  4  March 15, 2008 18:01 
help with Intro to unstructured grid  mc  Main CFD Forum  1  June 8, 2006 13:36 
Unstructured grid generation  philip  Main CFD Forum  2  August 16, 2005 09:28 
Unstructured Grid Generation  MSc Marcio Aredes  Main CFD Forum  3  April 7, 1999 03:40 