CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Doubt about parallel processing (https://www.cfd-online.com/Forums/openfoam-programming-development/195549-doubt-about-parallel-processing.html)

vishwesh November 10, 2017 06:20

Doubt about parallel processing
 
Hi!

I have a query regarding parallel processing. So, I will assume that I have divided my domain using 4 processors. Now, every processor will handle a certain portion of domain and carry out the processing on that sub-domain.

In my case, I need to carry out an analysis which requires that I should be able to find out the neighboring cells of any cell (any cell in the whole domain), the alpha value of any cell, volume of any cell, velocity of any cell, etc. Is there any way I can access alpha, U, and V values of a cell that does not belong to a processor (let's assume master processor) by using the master processor only? Also, can I find neighboring cells of a cell that does not belong to the sub-domain of the processor I am using for processing?

I was using cell-ID earlier for this calculation, but now I realize that as soon as we shift our processor, the cell IDs will no longer point to the same cell as they are local cell IDs. I tried using global cell IDs (https://www.cfd-online.com/Forums/op...mputation.html), but my doubt is how will I use it and second, how will the solver differentiate between global and local cell ID.

To make things clearer, here is an example:

Let's say a cell coordinate (0.005, 0.135, 0.002) belongs to the sub-domain of processor 1 and the global cell ID of the cell be 2350 and the local cell ID be 115.

If I now move onto master processor, and if I want to find out the neighboring cells or alpha value of the earlier cell, I was using the following:

mesh.cellCells()[115] -> This will give me wrong answer as 115 is no longer the cell ID of the same cell because we have moved onto processor 0

mesh.cellCells()[mesh.findCell((0.005,0.135,0.002))] -> This won't give me the correct answer as (0.005, 0.135, 0.002) does not even belong to the sub-domain of processor 0

If I use, mesh.cellCells()[2350] -> There are 2 chances... if there is already a local cell ID 2350, it might give me the neighboring cells of that cell. What if there is no local ID 2350? How will the solver know I am searching for global cell ID 2350. Also, how will it access the global cell-ID.

The same issue is with alpha values, U values, etc.

Can someone please help me out with this?

Thanks in advance


All times are GMT -4. The time now is 15:37.