CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Finding neighbouring cells when looping over faces in faceSet (https://www.cfd-online.com/Forums/openfoam-solving/59283-finding-neighbouring-cells-when-looping-over-faces-faceset.html)

olwi December 13, 2007 06:10

Hi, I have a faceSet defini
 
Hi,

I have a faceSet defining an internal interface between two media. I need to set source terms in the neighbouring cells on either side of the interface.

Looping over the faceSet, how do I find cell labels of the "neighbor" and "owner" cells on either side of a face with a given face label?

Thanks in advance,

Ola

hjasak December 13, 2007 07:42

Easy: mesh.owner() and mesh
 
Easy:

mesh.owner()[faceIndex] and mesh.neighbour()[faceIndex]

Enjoy,

Hrv

olwi December 13, 2007 09:03

Thanks, Hrv! I assumed it w
 
Thanks, Hrv!

I assumed it would be easy, but it beats my expectations, as usual.

Interesting stuff brewing in new application... http://www.cfd-online.com/OpenFOAM_D...part/happy.gif

/Ola


All times are GMT -4. The time now is 21:18.