mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: FacePostProcessing: handle boundary faces
This commit is contained in:
@ -306,6 +306,7 @@ Foam::FacePostProcessing<CloudType>::FacePostProcessing
|
|||||||
DynamicList<label> zoneIDs;
|
DynamicList<label> zoneIDs;
|
||||||
const faceZoneMesh& fzm = owner.mesh().faceZones();
|
const faceZoneMesh& fzm = owner.mesh().faceZones();
|
||||||
const surfaceScalarField& magSf = owner.mesh().magSf();
|
const surfaceScalarField& magSf = owner.mesh().magSf();
|
||||||
|
const polyBoundaryMesh& pbm = owner.mesh().boundaryMesh();
|
||||||
forAll(faceZoneNames, i)
|
forAll(faceZoneNames, i)
|
||||||
{
|
{
|
||||||
const word& zoneName = faceZoneNames[i];
|
const word& zoneName = faceZoneNames[i];
|
||||||
@ -314,16 +315,38 @@ Foam::FacePostProcessing<CloudType>::FacePostProcessing
|
|||||||
{
|
{
|
||||||
zoneIDs.append(zoneI);
|
zoneIDs.append(zoneI);
|
||||||
const faceZone& fz = fzm[zoneI];
|
const faceZone& fz = fzm[zoneI];
|
||||||
|
mass_[i].setSize(fz.size(), 0.0);
|
||||||
|
massTotal_[i].setSize(fz.size(), 0.0);
|
||||||
|
massFlux_[i].setSize(fz.size(), 0.0);
|
||||||
|
|
||||||
label nFaces = returnReduce(fz.size(), sumOp<label>());
|
label nFaces = returnReduce(fz.size(), sumOp<label>());
|
||||||
mass_[i].setSize(nFaces, 0.0);
|
|
||||||
massTotal_[i].setSize(nFaces, 0.0);
|
|
||||||
massFlux_[i].setSize(nFaces, 0.0);
|
|
||||||
Info<< " " << zoneName << " faces: " << nFaces << nl;
|
Info<< " " << zoneName << " faces: " << nFaces << nl;
|
||||||
|
|
||||||
scalar totArea = 0.0;
|
scalar totArea = 0.0;
|
||||||
forAll(fz, j)
|
forAll(fz, j)
|
||||||
{
|
{
|
||||||
totArea += magSf[fz[j]];
|
label faceI = fz[j];
|
||||||
|
label bFaceI = faceI - owner.mesh().nInternalFaces();
|
||||||
|
label patchI = pbm.patchID()[bFaceI];
|
||||||
|
|
||||||
|
if (patchI == -1)
|
||||||
|
{
|
||||||
|
totArea += magSf[fz[j]];
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
const polyPatch& pp = pbm[patchI];
|
||||||
|
|
||||||
|
if
|
||||||
|
(
|
||||||
|
!pp.coupled()
|
||||||
|
|| refCast<const coupledPolyPatch>(pp).owner()
|
||||||
|
)
|
||||||
|
{
|
||||||
|
label localFaceI = pp.whichFace(faceI);
|
||||||
|
totArea += magSf.boundaryField()[patchI][localFaceI];
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
totArea = returnReduce(totArea, sumOp<scalar>());
|
totArea = returnReduce(totArea, sumOp<scalar>());
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user