|
[Sponsors] |
July 25, 2007, 06:54 |
Hello,
I am sure this shoul
|
#1 |
New Member
David Mulholland
Join Date: Mar 2009
Posts: 11
Rep Power: 17 |
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 |
|
July 25, 2007, 07:27 |
mesh.cellCells(). Could it be
|
#2 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
mesh.cellCells(). Could it be easier?
Hrv
__________________
Hrvoje Jasak Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk |
|
July 25, 2007, 07:31 |
Forgot: for faces, you can ask
|
#3 |
Senior Member
Hrvoje Jasak
Join Date: Mar 2009
Location: London, England
Posts: 1,907
Rep Power: 33 |
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 |
|
July 25, 2007, 07:34 |
> mesh.cellCells(). Could it b
|
#4 |
Senior Member
Gavin Tabor
Join Date: Mar 2009
Posts: 181
Rep Power: 17 |
> 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 |
|
July 26, 2007, 10:17 |
Hey,
Thanks for the help, i
|
#5 |
New Member
David Mulholland
Join Date: Mar 2009
Posts: 11
Rep Power: 17 |
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 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[Technical] How to identify cell neighbours | booz | OpenFOAM Meshing & Mesh Conversion | 59 | November 20, 2017 01:40 |
neighbours of a cell | Asghari | FLUENT | 17 | October 7, 2010 18:41 |
how to access each cell of a face? (user fortran) | Katariina | CFX | 3 | January 28, 2008 10:16 |
can't access face variables ... | bart weisser | FLUENT | 2 | September 28, 2007 15:09 |
neighbours of a cell | Asghari | FLUENT | 0 | July 9, 2006 14:28 |