From b5d7ba319060d97d77f7ecb03dbd6916e46ac99b Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 15 Jun 2016 09:06:16 +0100 Subject: [PATCH] fvPatchField, cyclicACMI: Renamed weighted updateCoeffs updateCoeffs(const scalarField&) -> updateWeightedCoeffs(const scalarField&) to avoid confusion with other specialized forms of updateCoeffs. Patch contributed by Mattijs Janssens --- .../epsilonWallFunctionFvPatchScalarField.C | 2 +- .../epsilonWallFunctionFvPatchScalarField.H | 2 +- .../omegaWallFunctionFvPatchScalarField.C | 2 +- .../omegaWallFunctionFvPatchScalarField.H | 2 +- .../cyclicACMI/cyclicACMIFvPatchField.C | 15 +++++++++++++++ .../cyclicACMI/cyclicACMIFvPatchField.H | 3 +++ .../fvPatchFields/fvPatchField/fvPatchField.C | 6 ++---- .../fvPatchFields/fvPatchField/fvPatchField.H | 7 ++++--- 8 files changed, 28 insertions(+), 11 deletions(-) diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C index 8cd4cdb045..754eb2f131 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C @@ -445,7 +445,7 @@ void Foam::epsilonWallFunctionFvPatchScalarField::updateCoeffs() } -void Foam::epsilonWallFunctionFvPatchScalarField::updateCoeffs +void Foam::epsilonWallFunctionFvPatchScalarField::updateWeightedCoeffs ( const scalarField& weights ) diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H index 3ee2d514b3..944af6f82f 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.H @@ -257,7 +257,7 @@ public: virtual void updateCoeffs(); //- Update the coefficients associated with the patch field - virtual void updateCoeffs(const scalarField& weights); + virtual void updateWeightedCoeffs(const scalarField& weights); //- Manipulate matrix virtual void manipulateMatrix(fvMatrix& matrix); diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C index 3c131a0884..ff3002aa28 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C @@ -455,7 +455,7 @@ void omegaWallFunctionFvPatchScalarField::updateCoeffs() } -void omegaWallFunctionFvPatchScalarField::updateCoeffs +void omegaWallFunctionFvPatchScalarField::updateWeightedCoeffs ( const scalarField& weights ) diff --git a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H index daf4899344..3efc6d1cc6 100644 --- a/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H +++ b/src/TurbulenceModels/turbulenceModels/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.H @@ -264,7 +264,7 @@ public: virtual void updateCoeffs(); //- Update the coefficients associated with the patch field - virtual void updateCoeffs(const scalarField& weights); + virtual void updateWeightedCoeffs(const scalarField& weights); //- Manipulate matrix virtual void manipulateMatrix(fvMatrix& matrix); diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.C index f516b2ab8a..c32b6f33d6 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).updateWeightedCoeffs(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..a72d68f676 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicACMI/cyclicACMIFvPatchField.H @@ -221,6 +221,9 @@ public: //- Manipulate matrix virtual void manipulateMatrix(fvMatrix& matrix); + //- Update the coefficients associated with the patch field + void updateCoeffs(); + // Cyclic AMI coupled interface functions diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C index 88cd19d712..5ecbd2b1fa 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.C @@ -315,15 +315,13 @@ void Foam::fvPatchField::updateCoeffs() template -void Foam::fvPatchField::updateCoeffs(const scalarField& weights) +void Foam::fvPatchField::updateWeightedCoeffs(const scalarField& weights) { + // Default behaviour ignores the weights if (!updated_) { 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 cf462267f0..aaddcdc468 100644 --- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H @@ -417,9 +417,10 @@ public: virtual void updateCoeffs(); //- Update the coefficients associated with the patch field - // and apply weight field - // Sets Updated to true - virtual void updateCoeffs(const scalarField& weights); + // with a weight field (0..1). This weight field is ususally + // provided as the amount of geometric overlap for 'duplicate' + // patches. Sets Updated to true + virtual void updateWeightedCoeffs(const scalarField& weights); //- Return internal field next to patch as patch field virtual tmp> patchInternalField() const;