CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Getting neighboring patches (https://www.cfd-online.com/Forums/openfoam/174009-getting-neighboring-patches.html)

Bodhi B July 1, 2016 12:20

Getting neighboring patches
 
Hello FOAMers,

I'm working on a surface nucleate boiling model for multiple bubbles. In order to determine which wall patch makes contact with which bubble, I'd like to use a sorting algorithm to group the patch faces based on the bubble it makes contact with.

In order to accomplish that, I would like to get the index values of all adjacent wall patch faces for each wall patch face. This is where I am stuck. How can I go about finding the adjacent patch faces of a given patch face?

Any help is greatly appreciated!

-Bodhi

Tobi July 4, 2016 08:45

Hi Bodhi,

at the moment I only know how you access to the neighbor cells of the face. From the fvPatchField you can get the fvPatch where you have access to the Cn() member function. This returns a vectorField with the cellCenters of the neighbors ... maybe this will help you at the beginning. I checked doxygen but could not find a function that will return the face neighbors (maybe I just did not see it).

jherb July 4, 2016 16:04

Perhaps this post might help: http://www.cfd-online.com/Forums/ope...tml#post566118

It determines the indices of all cells which have faces on a boundary patch. From the cell index you should be able to get its neighbors. Then you should be able to get the faces of the neighbors so you can check, if they lie on the face and are a neighbor of your starting face.

Bodhi B July 5, 2016 15:35

Thank you, Tobias and Joachim.
Joachim, I will try the method you posted.


All times are GMT -4. The time now is 03:11.