|July 16, 2008, 15:42||
Dear all, For some reason, I
Join Date: Mar 2009
Posts: 93Rep Power: 10
For some reason, I need to loop over all faces to do some calculations, that I could not find a way to do with regular field operations.
Then, I decided to do a loop over all owner faces like below, because somehow I needed information from face, owner and neighbour:
Phi is a surfaceScalarField
V is a volScalarField
S is a surfaceScalarField
someComplexOperationsWith(V[owner[f]] , V[neighbour[f]], and S[f])
My first mistake was to assume the boundary faces would be covered in this loop, but later I realized they wouldn't.
My first question is: what happens to processorBoundaryPatches? Are they covered by this loop to garantee that the same code would work for serial and parallel computations? Or do I need to worry about it and do some loop over the boundary like this:
const fvPatchList& patches = mesh.boundary();
const fvPatch& curPatch = patches[patchi];
const fvPatchVectorField& Up = U.boundaryField()[patchi];
label faceCelli = curPatch.faceCells()[i];
Second question is: if I have to do this loop (above), and do some similar operations (as in the owner, faceI loop), how do I get the neighbour[f] field (which lies in a different processor).
Finally, is seems that I do not need to worry with cyclic boundary conditions, meaning that the first loop (forAll(owner,f)) includes all faces of patch cyclic. Am I right?
Thanks a lot,
|July 30, 2008, 06:24||
Hello Luiz, The first loop
Join Date: Mar 2009
Location: London, England
Posts: 1,790Rep Power: 23
The first loop is all fine, and will visit only the internal faces.
The second loop is also fine. You do not want to do anything special on the processor patches, because
would be required all over the code.
In parallel, you wil want each side to do its own bit, referring to local faceCells. On any sort of a coupled patch, deltaCoeffs will be the real one (using neighbour - owner distance across processors) and you need not do anything special. Have a look at ...boundaryCoeffs() and ...internalCoeffs() in any sort of a coupled patch.
Providing commercial FOAM/OpenFOAM and CFD Consulting: http://wikki.co.uk
|Thread||Thread Starter||Forum||Replies||Last Post|
|Help! Function not LOOPing||xtrios||FLUENT||2||July 17, 2008 15:44|
|looping||rr123||FLUENT||1||July 8, 2008 17:49|
|Looping in UDF!!!||safa||FLUENT||0||December 11, 2007 09:07|
|What value is returned for gradUneighbourfaceI if faceI is at a boundary||sampaio||OpenFOAM Running, Solving & CFD||1||June 1, 2006 13:14|
|Looping Problem??||KKLAU||FLUENT||1||June 5, 2004 05:48|