diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressurePIDControlInletVelocity/pressurePIDControlInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressurePIDControlInletVelocity/pressurePIDControlInletVelocityFvPatchVectorField.C index b7d36f1a6da272499521f07fc2c6979eca885e12..f4098267d84cecbf1c2405954c158d4a99884ac1 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/pressurePIDControlInletVelocity/pressurePIDControlInletVelocityFvPatchVectorField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/pressurePIDControlInletVelocity/pressurePIDControlInletVelocityFvPatchVectorField.C @@ -30,6 +30,7 @@ License #include "surfaceFields.H" #include "linear.H" #include "steadyStateDdtScheme.H" +#include "syncTools.H" // * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // @@ -78,6 +79,8 @@ void Foam::pressurePIDControlInletVelocityFvPatchVectorField::faceZoneAverage { const fvMesh& mesh(patch().boundaryMesh().mesh()); + PackedBoolList isMasterFace(syncTools::getInternalOrMasterFaces(mesh)); + const faceZone& zone = mesh.faceZones()[name]; area = 0; @@ -87,10 +90,23 @@ void Foam::pressurePIDControlInletVelocityFvPatchVectorField::faceZoneAverage { const label f(zone[faceI]); - const scalar da(mesh.magSf()[f]); - - area += da; - average += da*field[f]; + if (mesh.isInternalFace(f)) + { + const scalar da(mesh.magSf()[f]); + + area += da; + average += da*field[f]; + } + else if (isMasterFace[f]) + { + const label bf(f-mesh.nInternalFaces()); + const label patchID = mesh.boundaryMesh().patchID()[bf]; + const label lf(mesh.boundaryMesh()[patchID].whichFace(f)); + const scalar da(mesh.magSf().boundaryField()[patchID][lf]); + + area += da; + average += da*field.boundaryField()[patchID][lf]; + } } reduce(area, sumOp<scalar>());