CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

Access to face neighbours

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 25, 2007, 05:54
Default Hello, I am sure this shoul
  #1
New Member
 
David Mulholland
Join Date: Mar 2009
Posts: 11
Rep Power: 17
irishdave is on a distinguished road
Hello,

I am sure this should be elementary but I'm really struggling with finding a straightforward way to take a cell and find its neighbours?

I have set up the mesh in my script and I've been looking through the documentation for the fvMesh, polyMesh and primitiveMesh yet I am unable to find something that seems to be what I need.

What I want to be able to do is take a for loop running through each cell in the mesh (which I can create no problem) and then obtain the cells neighbouring it (either by function or obtaining it from a list initialized outside the loop) and also obtain the face between them.

Thanks
David
irishdave is offline   Reply With Quote

Old   July 25, 2007, 06:27
Default mesh.cellCells(). Could it be
  #2
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
mesh.cellCells(). Could it be easier?

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   July 25, 2007, 06:31
Default Forgot: for faces, you can ask
  #3
Senior Member
 
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,905
Rep Power: 33
hjasak will become famous soon enough
Forgot: for faces, you can ask for mesh.owner() and mesh.neighbour(). For the owner, the face area vector points outwards.

Keep in mind that you are now working with a face-addressed code and that the number of faces (or indeed cell neighbours) varies. You may wish to re-consider the organisation of your algorithms to reflect the face addressing.

Enjoy,

Hrv
__________________
Hrvoje Jasak
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
hjasak is offline   Reply With Quote

Old   July 25, 2007, 06:34
Default > mesh.cellCells(). Could it b
  #4
Senior Member
 
Gavin Tabor
Join Date: Mar 2009
Posts: 181
Rep Power: 17
grtabor is on a distinguished road
> mesh.cellCells(). Could it be easier?

> Hrv

I suppose it could write the code for you! Must talk to the guys around here who are working on Evolutionary Computing about that one - a CFD code that self-evolves to get the modelling correct.

Gavin
grtabor is offline   Reply With Quote

Old   July 26, 2007, 09:17
Default Hey, Thanks for the help, i
  #5
New Member
 
David Mulholland
Join Date: Mar 2009
Posts: 11
Rep Power: 17
irishdave is on a distinguished road
Hey,

Thanks for the help, it's working perfectly for me. My mind was stuck on cell addressed code instead of face addressed and now it makes sense and seems to be working so far. Thanks for the offer Gavin but I think I'm getting there ok now.

Thanks
David
irishdave is offline   Reply With Quote

Reply

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[Technical] How to identify cell neighbours booz OpenFOAM Meshing & Mesh Conversion 59 November 20, 2017 00:40
neighbours of a cell Asghari FLUENT 17 October 7, 2010 17:41
how to access each cell of a face? (user fortran) Katariina CFX 3 January 28, 2008 09:16
can't access face variables ... bart weisser FLUENT 2 September 28, 2007 14:09
neighbours of a cell Asghari FLUENT 0 July 9, 2006 13:28


All times are GMT -4. The time now is 04:00.