CFD Online Discussion Forums

CFD Online Discussion Forums (http://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (http://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Position of cells in a orthogonal grid (http://www.cfd-online.com/Forums/openfoam-solving/59166-position-cells-orthogonal-grid.html)

alberto February 5, 2008 22:31

Hello, I'm using a structur
 
Hello,

I'm using a structured (orthogonal squared cells) grid, and I need to implement an algorithm which requires the values of a variable in the "above"/"below", "left"/"right", "front"/"back" cells.

Is there a quick way to identify these cells?

niklas February 6, 2008 04:01

short answer: hmmm, sort of.
 
short answer: hmmm, sort of.

The fastest way as I see it is to access all the faces, check their face-normals and depending on their direction determine if they are left or right, et c.
from that create a mapping of left -> face i, right -> face j, et c.
(which of course require some mesh class hacking)

you probably only need to do this once for a static mesh and after this it should be fast.

alberto February 6, 2008 13:28

Hmmm. Thanks for your reply Ni
 
Hmmm. Thanks for your reply Niklas.

I have a doubt on how the boundary cells are managed. I mean, I have 4 neighbours for the "internal" cells, but only 2 or 3 for the boundary cells, which are exceptions because they have one or more lacking "directions".

How that procedure can identify them?

Regards,
Alberto


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