September 7, 2022, 04:59
|
How to update surfaceScalarField boundary values in parallel cyclicBC?
|
#1
|
New Member
Sreehari Perumanath
Join Date: Jun 2022
Posts: 28
Rep Power: 5
|
Dear Foamers,
I'm new to use OF and I'm developing my own solver for my problem. In it, I have to define a 'surfaceScalarField payal' and I want to give pre-calculated values to it at every time step.
To give values to the internal faces, it is simple. I give values to the boundary patch faces with:
Code:
// to loop over all boundary faces
forAll(payal.boundaryFieldRef(), patchID)
{
forAll(payal.boundaryFieldRef()[patchID],facei)
{
payal.boundaryFieldRef()[patchID][facei]=<aPre-calculatedValue>;
}
}
But I use cyclicBC, so I have to do something like below for two neighbourPatches with patchIDs 0,1:
Code:
// set values on patchID=1 same as patchID=0, because cyclicBC between patches 0,1
forAll(payal.boundaryFieldRef()[1],facei)
{
payal.boundaryFieldRef()[1][facei]=payal.boundaryFieldRef()[0][facei];
}
and likewise for other pairs of neighbourPatches (I have a very simple geometry of a cube). This works fine in a serial run. But, I imagine this would be problematic in a parallel run, as both patches may be dealt with by different processes. Can somebody please suggest an elegant way which works for both serial and parallel runs? It would be very helpful.
Many thanks and have a great day/weekend!
Last edited by sreehahaha; September 22, 2022 at 04:46.
|
|
|