diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicACMI/cyclicACMIFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicACMI/cyclicACMIFvPatch.C index 8aad764f9b..f02ce291c1 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicACMI/cyclicACMIFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicACMI/cyclicACMIFvPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,28 +52,28 @@ void Foam::cyclicACMIFvPatch::updateAreas() const // owner couple const_cast(Sf()) = patch().faceAreas(); - const_cast(magSf()) = mag(patch().faceAreas()); + const_cast(magSf()) = patch().magFaceAreas(); // owner non-overlapping const fvPatch& nonOverlapPatch = nonOverlapFvPatch(); const_cast(nonOverlapPatch.Sf()) = nonOverlapPatch.patch().faceAreas(); const_cast(nonOverlapPatch.magSf()) = - mag(nonOverlapPatch.patch().faceAreas()); + nonOverlapPatch.patch().magFaceAreas(); // neighbour couple const cyclicACMIFvPatch& nbrACMI = neighbFvPatch(); const_cast(nbrACMI.Sf()) = nbrACMI.patch().faceAreas(); const_cast(nbrACMI.magSf()) = - mag(nbrACMI.patch().faceAreas()); + nbrACMI.patch().magFaceAreas(); // neighbour non-overlapping const fvPatch& nbrNonOverlapPatch = nbrACMI.nonOverlapFvPatch(); const_cast(nbrNonOverlapPatch.Sf()) = nbrNonOverlapPatch.patch().faceAreas(); const_cast(nbrNonOverlapPatch.magSf()) = - mag(nbrNonOverlapPatch.patch().faceAreas()); + nbrNonOverlapPatch.patch().magFaceAreas(); // set the updated flag cyclicACMIPatch().setUpdated(false); diff --git a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C index a2c9121312..3f93ebda52 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C +++ b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C @@ -73,6 +73,7 @@ void Foam::cyclicACMIPolyPatch::resetAMI() const // Trigger re-building of faceAreas (void)boundaryMesh().mesh().faceAreas(); + // Calculate the AMI using partial face-area-weighted. This leaves // the weights as fractions of local areas (sum(weights) = 1 means // face is fully covered) @@ -92,12 +93,16 @@ void Foam::cyclicACMIPolyPatch::resetAMI() const if (srcMask_.size()) { vectorField::subField Sf = faceAreas(); + scalarField::subField magSf = magFaceAreas(); vectorField::subField noSf = nonOverlapPatch.faceAreas(); + scalarField::subField noMagSf = nonOverlapPatch.magFaceAreas(); forAll(Sf, facei) { Sf[facei] *= srcMask_[facei]; + magSf[facei] = mag(Sf[facei]); noSf[facei] *= 1.0 - srcMask_[facei]; + noMagSf[facei] = mag(noSf[facei]); } } // Adapt slave side areas @@ -108,12 +113,16 @@ void Foam::cyclicACMIPolyPatch::resetAMI() const const polyPatch& pp = cp.nonOverlapPatch(); vectorField::subField Sf = cp.faceAreas(); + scalarField::subField magSf = cp.magFaceAreas(); vectorField::subField noSf = pp.faceAreas(); + scalarField::subField noMagSf = pp.magFaceAreas(); forAll(Sf, facei) { Sf[facei] *= tgtMask_[facei]; + magSf[facei] = mag(Sf[facei]); noSf[facei] *= 1.0 - tgtMask_[facei]; + noMagSf[facei] = mag(noSf[facei]); } } @@ -403,8 +412,8 @@ Foam::label Foam::cyclicACMIPolyPatch::nonOverlapPatchID() const if (size() == noPp.size()) { - const scalarField magSf(mag(faceAreas())); - const scalarField noMagSf(mag(noPp.faceAreas())); + const scalarField magSf(magFaceAreas()); + const scalarField noMagSf(noPp.magFaceAreas()); forAll(magSf, facei) { diff --git a/src/meshTools/AMIInterpolation/patches/cyclicRepeatAMI/cyclicRepeatAMIPolyPatch/cyclicRepeatAMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicRepeatAMI/cyclicRepeatAMIPolyPatch/cyclicRepeatAMIPolyPatch.C index efab8c0eab..ee9fd6b37b 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicRepeatAMI/cyclicRepeatAMIPolyPatch/cyclicRepeatAMIPolyPatch.C +++ b/src/meshTools/AMIInterpolation/patches/cyclicRepeatAMI/cyclicRepeatAMIPolyPatch/cyclicRepeatAMIPolyPatch.C @@ -127,8 +127,8 @@ void Foam::cyclicRepeatAMIPolyPatch::resetAMI() const // patch from its neighbour label n = 0; { - const scalarField thisMagAreas(mag(this->faceAreas())); - const scalarField nbrMagAreas(mag(nbrPatch().faceAreas())); + const scalarField thisMagAreas(this->magFaceAreas()); + const scalarField nbrMagAreas(nbrPatch().magFaceAreas()); vector thisCentre = gSum(this->faceCentres()*thisMagAreas)/gSum(thisMagAreas);