diff --git a/src/finiteVolume/cfdTools/general/constrainPressure/constrainPressure.C b/src/finiteVolume/cfdTools/general/constrainPressure/constrainPressure.C index 760a335465..bbc967fb4f 100644 --- a/src/finiteVolume/cfdTools/general/constrainPressure/constrainPressure.C +++ b/src/finiteVolume/cfdTools/general/constrainPressure/constrainPressure.C @@ -63,7 +63,7 @@ void Foam::constrainPressure refCast ( pBf[patchi] - ).updateCoeffs + ).updateSnGrad ( ( phiHbyABf[patchi] diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C index 19c4e91a2b..2c0458d00a 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C @@ -270,6 +270,21 @@ void Foam::cyclicACMIFvPatchField::manipulateMatrix } +template +void Foam::cyclicACMIFvPatchField::updateCoeffs() +{ + // Update non-overlap patch - some will implement updateCoeffs, and + // others will implement evaluate + + // Pass in (1 - mask) to give non-overlap patch the chance to do + // manipulation of non-face based data + + const scalarField& mask = cyclicACMIPatch_.cyclicACMIPatch().mask(); + const fvPatchField& npf = nonOverlapPatchField(); + const_cast&>(npf).updateCoeffs(1.0 - mask); +} + + template void Foam::cyclicACMIFvPatchField::write(Ostream& os) const { diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.H index 33a6d6935f..1b860af7d6 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.H @@ -218,6 +218,9 @@ public: const Pstream::commsTypes commsType ) const; + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + //- Manipulate matrix virtual void manipulateMatrix(fvMatrix& matrix); diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C index 7c2da576c9..68f6605c10 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation - \\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd. + \\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -133,7 +133,7 @@ Foam::fixedFluxPressureFvPatchScalarField::fixedFluxPressureFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::fixedFluxPressureFvPatchScalarField::updateCoeffs +void Foam::fixedFluxPressureFvPatchScalarField::updateSnGrad ( const scalarField& snGradp ) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.H index 85002bb092..c9f43edfdc 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.H +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.H @@ -3,7 +3,7 @@ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation - \\/ M anipulation | + \\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -144,7 +144,7 @@ public: // Member functions //- Update the patch pressure gradient field from the given snGradp - virtual void updateCoeffs(const scalarField& snGradp); + virtual void updateSnGrad(const scalarField& snGradp); //- Update the patch pressure gradient field virtual void updateCoeffs(); @@ -175,7 +175,7 @@ namespace Foam { if (isA(bf[patchi])) { - refCast(bf[patchi]).updateCoeffs(snGrad[patchi]); + refCast(bf[patchi]).updateSnGrad(snGrad[patchi]); } } } diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C index 917872aaa4..6f78dde06f 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C @@ -323,9 +323,6 @@ void Foam::fvPatchField::updateCoeffs(const scalarField& weights) { updateCoeffs(); - Field& fld = *this; - fld *= weights; - updated_ = true; } } diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H index f91107ab1e..3b32138930 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -417,7 +417,7 @@ public: virtual void updateCoeffs(); //- Update the coefficients associated with the patch field - // and apply weight field + // and optionally apply weight field. // Sets Updated to true virtual void updateCoeffs(const scalarField& weights); diff --git a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C index 05dc64449d..82e17c21f1 100644 --- a/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C +++ b/src/meshTools/AMIInterpolation/patches/cyclicACMI/cyclicACMIPolyPatch/cyclicACMIPolyPatch.C @@ -60,16 +60,16 @@ void Foam::cyclicACMIPolyPatch::resetAMI if (boundaryMesh().mesh().hasCellCentres()) { - WarningInFunction - << "The mesh already has cellCentres calculated when" - << " resetting ACMI " << name() << "." << endl - << "This is a problem since ACMI adapts the face areas" - << " (to close cells) so this has" << endl - << "to be done before cell centre calculation." << endl - << "This can happen if e.g. the cyclicACMI is after" - << " any processor patches in the boundary." << endl - << "Continuing with potential for incorrect geometry" - << " calculation and mass loss" << endl; + if (debug) + { + Pout<< "cyclicACMIPolyPatch::resetAMI : detected cell centres." + << " Clearing cell centres to guarantee closed volumes" + << endl; + } + const_cast + ( + boundaryMesh().mesh() + ).primitiveMesh::clearGeom(); }