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/)
-   -   Boundary condition in parallel (http://www.cfd-online.com/Forums/openfoam-solving/58557-boundary-condition-parallel.html)

ffbof September 11, 2008 08:20

I want to make the mixing plan
 
I want to make the mixing plane approach presented at the Workshop in Milano
to run in parallel. Therefore i need to access the global patch and the global patchfield.
Otherwise the building of the circumferential average would lead to wrong results.

My Approach to get those values would be the following :

List<type> globalFields(Pstream::nProcs()); // nProcs is number of processors

for(
int slave = 0;
slave <= Pstream::lastSlave();
slave++
)
{

IPstream fromProc(slave);

fromProc >> globalFields[slave];

}

Type is the type of the patchField for example vectorField
or scalarField.

But now i have the complete field but is the adressing of the field conserved during
decomposition or must the adressing of the field also reconstructed in a way ?

So to get the faceList corresponding to my mixing plane patch
can i write the following ?


List<facelist> globalFields(Pstream::nProcs()); // nProcs is number of processors

for(
int slave = 0;
slave <= Pstream::lastSlave();
slave++
)
{

IPstream fromProc(slave);

fromProc >> globalFields[slave];

}

and do the reconstruction of my patch by accessing the faces in every processor.

But where do i get the adressing of the faces belonging to the right patch, because this would only deliver me the faces of the whole computational domain.

Best Regards
Franz

ffbof September 12, 2008 10:52

Maybe i asked the wrong questi
 
Maybe i asked the wrong question.

I try to explain again my problem.

When the mesh is decomposed the patches are also decomposed, but i need to access all the faces of a patch. How can i access those faces within a fvPatchField. And also how can i access all the cell values near my fvPatchField in case of a decomposed field.

Would be great if somebody could answer even if my question was wrong formulated.

mattijs September 13, 2008 00:47

The faces of a patch are alway
 
The faces of a patch are always local to the processor. Ask yourself what you need from those faces? Do you need to e.g. average over their area? In that case do your sums per processor, reduce and do the division.

If you really want to reconstruct a whole patch on one processor (i.e. undo the decomposition) this is not trivial and does not scale and might not fit onto your processor.

ffbof September 13, 2008 08:56

Hi Mattijs thank you very m
 
Hi Mattijs

thank you very much for the reply.
I know it is a difficult thing. I dont want to reconstruct the patch but what i must have is a list to all the faces of the my patch which is maybe split up into pieces. After i have that i will build a virtual patch on which i perform all the averaging. After that i interpolate from the whole patch onto the decomposed patches. To impress the averaged field values as a boundary condition there.

So the only two things i need are access to the faces belonging to the original patch and also the points of that original patch and also the field values of the original(global reconstructed field).

So the "reconstructed patch" will only reside as a help instance to perform the correct averaging over the whole patch.

Another way would be to decompose the mesh in a way that the mixing plane patch is not affected.

So if you have a hint where to watch for such a interprocessor communication i would welcome that very much.

mattijs September 14, 2008 04:27

I added some addressing info a
 
I added some addressing info about decomposed meshes to

http://openfoamwiki.net/index.php/Write_OpenFOAM_meshes

- or have a look at the manual decomposition option which reads a file with the wanted decomposition and do the decomposition yourself.

duongquaphim September 9, 2009 05:53

hi Mattijs,

I am a new user of OpenFoam and I want to make a manual data file for decomposition for parallel computing. However, I can not find any information about the format of this file. Can you please post a sample file to this forum?

Thank you

Duong

mattijs September 10, 2009 15:51

run decomposePar with -cellDist option. It will write a 'constant/polyMesh/cellDecomposition' file which is consistent with the manualDecomp option.

You will need the absolute latest 1.6.x.

matteoL June 14, 2010 13:26

U.boundaryField()[CylPatch].snGrad() over a whole patch in parallel
 
Hello,
I have recently created a new thread "http://www.cfd-online.com/Forums/openfoam-solving/77133-parallel-issue-global-face-zone-patch.html" and the found out this thread which seems related to what i need..

In brief, I need to get a vector containg the normal gradient of U over a patch. In serial it is very easy, i just need to do "vectorField UgradN=U.boundaryField()[CylPatch].snGrad();" but in parallel obviously the trick doesn't work anymore sicne the patch i need as been decomposed as well..

How do i do it then?
Do i have to pass by a global faceZone?

One possibility i think would be to create a VectorField (with size the whole Serial Patch) on every partition (and i presume i should get a zero if the face is not part of the the decomposed patch, the correct value if it is) and then somehow reconstruct all values (doing something like a check over evry face, and taking the values different from zero...) .... etc etc..

Is this feasible? is this the way to go?

Thanks,
matteo


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