diff --git a/src/transportModels/geometricVoF/advectionSchemes/isoAdvection/isoAdvection.C b/src/transportModels/geometricVoF/advectionSchemes/isoAdvection/isoAdvection.C index a2296c3c6bf3833de1d56e73ddd3f318a9b698c4..6ecf2ad0176a77300c86985d68893001cabd6184 100644 --- a/src/transportModels/geometricVoF/advectionSchemes/isoAdvection/isoAdvection.C +++ b/src/transportModels/geometricVoF/advectionSchemes/isoAdvection/isoAdvection.C @@ -397,6 +397,15 @@ void Foam::isoAdvection::timeIntegratedFlux() magSf ); + // Handling upwind cyclic boundary patches + const polyPatch& pp = boundaryMesh[patchi]; + const cyclicPolyPatch* cpp = isA<cyclicPolyPatch>(pp); + if (cpp) + { + const label neiPatchID(cpp->neighbPolyPatchID()); + dVfb[neiPatchID][patchFacei] = -dVfb[patchi][patchFacei]; + } + // Check if the face is on processor patch and append it to // the list if necessary checkIfOnProcPatch(facei); diff --git a/src/transportModels/geometricVoF/advectionSchemes/isoAdvection/isoAdvectionTemplates.C b/src/transportModels/geometricVoF/advectionSchemes/isoAdvection/isoAdvectionTemplates.C index c79592c3b4a83a7ba598ec15938de31595f18f35..422d86c89634ba9e4c132ce02a72935a06a649e9 100644 --- a/src/transportModels/geometricVoF/advectionSchemes/isoAdvection/isoAdvectionTemplates.C +++ b/src/transportModels/geometricVoF/advectionSchemes/isoAdvection/isoAdvectionTemplates.C @@ -188,8 +188,43 @@ void Foam::isoAdvection::limitFluxes + faceValue(dVfcorrectionValues, facei); setFaceValue(dVf_, facei, corrVf); + + // If facei is on a cyclic patch correct dVf of facej on + // neighbour patch and alpha value of facej's owner cell. + if (!mesh_.isInternalFace(facei)) + { + const polyBoundaryMesh& boundaryMesh = + mesh_.boundaryMesh(); + const label patchi = boundaryMesh.patchID(facei); + const polyPatch& pp = boundaryMesh[patchi]; + const cyclicPolyPatch* cpp = isA<cyclicPolyPatch>(pp); + const label patchFacei = pp.whichFace(facei); + + if (cpp) + { + const label neiPatchID(cpp->neighbPolyPatchID()); + surfaceScalarField::Boundary& dVfb = + dVf_.boundaryFieldRef(); + dVfb[neiPatchID][patchFacei] = + -dVfb[patchi][patchFacei]; + const polyPatch& np = boundaryMesh[neiPatchID]; + const label globalFacei = np.start() + patchFacei; + const label neiOwn(owner[globalFacei]); + scalar VneiOwn = mesh_.V()[neiOwn]; + if (porosityEnabled_) + { + VneiOwn *= + porosityPtr_->primitiveField()[neiOwn]; + } + alpha1_[neiOwn] += + faceValue(dVfcorrectionValues, facei)/VneiOwn; + } + } + } + } + syncProcPatches(dVf_, phi_); } else