CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > General Forums > Main CFD Forum

Determining cell neighbours on unstructured grid

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   September 24, 2011, 11:52
Default Determining cell neighbours on unstructured grid
  #1
Member
 
Join Date: Aug 2011
Posts: 30
Rep Power: 15
orxan.shibli is on a distinguished road
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?
orxan.shibli is offline   Reply With Quote

Old   September 24, 2011, 13:50
Default
  #2
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,192
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
Well, i think it depends on which kind of information you have. In a cell-based 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 j-th 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.
sbaffini is offline   Reply With Quote

Old   September 24, 2011, 19:00
Default
  #3
Member
 
Join Date: Aug 2011
Posts: 30
Rep Power: 15
orxan.shibli is on a distinguished road
Method is cell-centered. 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.
orxan.shibli is offline   Reply With Quote

Old   September 25, 2011, 06:20
Default
  #4
Senior Member
 
sbaffini's Avatar
 
Paolo Lampitella
Join Date: Mar 2009
Location: Italy
Posts: 2,192
Blog Entries: 29
Rep Power: 39
sbaffini will become famous soon enoughsbaffini will become famous soon enough
Send a message via Skype™ to sbaffini
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.
sbaffini is offline   Reply With Quote

Old   September 25, 2011, 06:29
Default
  #5
Member
 
Join Date: Aug 2011
Posts: 30
Rep Power: 15
orxan.shibli is on a distinguished road
Thank you very much for answering my questions.
orxan.shibli is offline   Reply With Quote

Reply

Tags
unstructured neighbour


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
unstructured grid problem jack Main CFD Forum 3 September 18, 2008 04: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 14:36
Unstructured grid generation philip Main CFD Forum 2 August 16, 2005 10:28
Unstructured Grid Generation MSc Marcio Aredes Main CFD Forum 3 April 7, 1999 04:40


All times are GMT -4. The time now is 20:05.