Find the upstream and downstream cell

Submitted by rqwang on
alice

Hello rq,
there is a way to access the neighbours of a cell within OpenFOAM. It requires rather deep digging inside the code... In the void fraction model IBVoidFraction this is done, accessing the data via the particle cloud (see line 212). Here the cellIDs of the specific cells are returned and can be used to determine the cells position.
There might still be simpler ways of accessing certain data, but I haven't come across them for now.
KR,
Alice

Tue, 22 Oct 2013 - 08:47 Permalink
rqwang

Hi Alice,

Thank you for your reply. I wonder whether there is a simple way to get the cell ID given a particular position.

In openfoam, i know it's the command of "findCell". But I don't know how to use it in forceModel.
I have tried particleCloud_.mesh().findCell(position), but had no luck.
Do you have any clue?

Thanks.
rq

Tue, 22 Oct 2013 - 23:23 Permalink
cgoniva

Hi rq,

mesh.findCell(pos) is not the most efficent way, but should do the job...
what was the problem there?

Cheers,
Chris

Thu, 24 Oct 2013 - 14:47 Permalink
rqwang

In reply to by anonymous_stub (not verified)

Hi Chris,

At last, I found I can use this command to find the cell index.
label cellUpstream = particleCloud_.locateM().findSingleCell(posUpstream,cellI);
The mesh().findCell never works and I dont know why. It says some IO stream errors.

Anyway, now the problem is half solved, but I found findSingleCell can not search the cell in a different processor after decomposed. Is it possible to access a different processor's cell index?

The left question is how to transfer the momentum from solid to fluid phase in the downstream cell. So far, I have no idea on that. Please advise.

Thanks.
rq

Thu, 24 Oct 2013 - 16:17 Permalink

Hi CFDEMers,

I wonder whether it's possible to find the upstream and downstream cell index of a particle. I know the particle cellI is the particle's center sits.

For example, if I know the velocity at the particle center is in x positive direction, then the upstream cell is the neighbor one in negative x direction and the downstream one is the positive x direction.

Is there a good way to find the cell index? In addition, is it possible to get the velocity from the upstream one and distribute the momentum (impForces) to the downstream one? Please advise.

Thanks.
rq