From 2c81f867f78bbc397459771726662039cde29b59 Mon Sep 17 00:00:00 2001 From: mattijs <mattijs> Date: Wed, 21 Jul 2021 20:25:00 +0100 Subject: [PATCH] BUG: cyclicPeriodicAMI: consistent use of interpolation. See #2145 --- .../cyclicPeriodicAMIFvPatchField.C | 24 ------- .../cyclicPeriodicAMIFvPatchField.H | 8 --- .../cyclicPeriodicAMIFvsPatchFields.C | 62 ------------------- .../cyclicPeriodicAMIFvPatch.C | 15 +++-- src/meshTools/Make/files | 5 -- 5 files changed, 11 insertions(+), 103 deletions(-) diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicPeriodicAMI/cyclicPeriodicAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicPeriodicAMI/cyclicPeriodicAMIFvPatchField.C index 8658b924727..37af5d7b35e 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicPeriodicAMI/cyclicPeriodicAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicPeriodicAMI/cyclicPeriodicAMIFvPatchField.C @@ -129,13 +129,6 @@ Foam::cyclicPeriodicAMIFvPatchField<Type>::cyclicPeriodicAMIFvPatchField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -//template<class Type> -//bool Foam::cyclicPeriodicAMIFvPatchField<Type>::coupled() const -//{ -// return cyclicPeriodicAMIPatch_.coupled(); -//} - - template<class Type> Foam::tmp<Foam::Field<Type>> Foam::cyclicPeriodicAMIFvPatchField<Type>::patchNeighbourField() const @@ -176,23 +169,6 @@ Foam::cyclicPeriodicAMIFvPatchField<Type>::patchNeighbourField() const } -//template<class Type> -//const Foam::cyclicPeriodicAMIFvPatchField<Type>& -//Foam::cyclicPeriodicAMIFvPatchField<Type>::neighbourPatchField() const -//{ -// const GeometricField<Type, fvPatchField, volMesh>& fld = -// static_cast<const GeometricField<Type, fvPatchField, volMesh>&> -// ( -// this->primitiveField() -// ); -// -// return refCast<const cyclicPeriodicAMIFvPatchField<Type>> -// ( -// fld.boundaryField()[cyclicPeriodicAMIPatch_.neighbPatchID()] -// ); -//} - - template<class Type> void Foam::cyclicPeriodicAMIFvPatchField<Type>::updateInterfaceMatrix ( diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicPeriodicAMI/cyclicPeriodicAMIFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicPeriodicAMI/cyclicPeriodicAMIFvPatchField.H index 2afe2551e99..f52ad4d1f12 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/cyclicPeriodicAMI/cyclicPeriodicAMIFvPatchField.H +++ b/src/finiteVolume/fields/fvPatchFields/constraint/cyclicPeriodicAMI/cyclicPeriodicAMIFvPatchField.H @@ -165,17 +165,9 @@ public: // Evaluation functions -// //- Return true if coupled. Note that the underlying patch -// // is not coupled() - the points don't align. -// virtual bool coupled() const; - //- Return neighbour coupled internal cell data virtual tmp<Field<Type>> patchNeighbourField() const; - //- Return reference to neighbour patchField - const cyclicPeriodicAMIFvPatchField<Type>& neighbourPatchField() - const; - //- Update result field based on interface functionality virtual void updateInterfaceMatrix ( diff --git a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicPeriodicAMI/cyclicPeriodicAMIFvsPatchFields.C b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicPeriodicAMI/cyclicPeriodicAMIFvsPatchFields.C index 2ec05458527..5c02afee222 100644 --- a/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicPeriodicAMI/cyclicPeriodicAMIFvsPatchFields.C +++ b/src/finiteVolume/fields/fvsPatchFields/constraint/cyclicPeriodicAMI/cyclicPeriodicAMIFvsPatchFields.C @@ -26,7 +26,6 @@ License \*---------------------------------------------------------------------------*/ #include "cyclicPeriodicAMIFvsPatchFields.H" -//#include "cyclicAMIFvsPatchFields.H" #include "fvsPatchFields.H" #include "addToRunTimeSelectionTable.H" @@ -39,67 +38,6 @@ namespace Foam makeFvsPatchFields(cyclicPeriodicAMI); -//// Redirect cyclicPeriodicAMI to cyclicAMI for now -// -//#define addNamedToFvsPatchFieldRunTimeSelection\ -//(PatchTypeField,typePatchTypeField,lookup) \ -// addNamedToRunTimeSelectionTable \ -// ( \ -// PatchTypeField, \ -// typePatchTypeField, \ -// patch, \ -// lookup \ -// ); \ -// addNamedToRunTimeSelectionTable \ -// ( \ -// PatchTypeField, \ -// typePatchTypeField, \ -// patchMapper, \ -// lookup \ -// ); \ -// addNamedToRunTimeSelectionTable \ -// ( \ -// PatchTypeField, \ -// typePatchTypeField, \ -// dictionary, \ -// lookup \ -// ); -// -//#define makeNamedFvsPatchFields(type,lookupType)\ -// addNamedToFvsPatchFieldRunTimeSelection \ -// ( \ -// fvsPatchScalarField, \ -// type##FvsPatchScalarField, \ -// lookupType \ -// ); \ -// addNamedToFvsPatchFieldRunTimeSelection \ -// ( \ -// fvsPatchVectorField, \ -// type##FvsPatchVectorField, \ -// lookupType \ -// ); \ -// addNamedToFvsPatchFieldRunTimeSelection \ -// ( \ -// fvsPatchSphericalTensorField, \ -// type##FvsPatchSphericalTensorField, \ -// lookupType \ -// ); \ -// addNamedToFvsPatchFieldRunTimeSelection \ -// ( \ -// fvsPatchSymmTensorField, \ -// type##FvsPatchSymmTensorField, \ -// lookupType \ -// ); \ -// addNamedToFvsPatchFieldRunTimeSelection \ -// ( \ -// fvsPatchTensorField, \ -// type##FvsPatchTensorField, \ -// lookupType \ -//); -// -//makeNamedFvsPatchFields(cyclicAMI, cyclicPeriodicAMI); - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicPeriodicAMI/cyclicPeriodicAMIFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicPeriodicAMI/cyclicPeriodicAMIFvPatch.C index 78494a42084..1802813e410 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicPeriodicAMI/cyclicPeriodicAMIFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicPeriodicAMI/cyclicPeriodicAMIFvPatch.C @@ -71,7 +71,7 @@ void Foam::cyclicPeriodicAMIFvPatch::makeWeights(scalarField& w) const if (applyLowWeightCorrection()) { tnbrDeltas = - interpolate + cyclicPeriodicAMIPolyPatch_.interpolate ( nbrPatch.nf() & nbrPatch.coupledFvPatch::delta(), scalarField(this->size(), 1.0) @@ -80,7 +80,10 @@ void Foam::cyclicPeriodicAMIFvPatch::makeWeights(scalarField& w) const else { tnbrDeltas = - interpolate(nbrPatch.nf() & nbrPatch.coupledFvPatch::delta()); + cyclicPeriodicAMIPolyPatch_.interpolate + ( + nbrPatch.nf() & nbrPatch.coupledFvPatch::delta() + ); } const scalarField& nbrDeltas = tnbrDeltas(); @@ -148,7 +151,7 @@ Foam::tmp<Foam::vectorField> Foam::cyclicPeriodicAMIFvPatch::delta() const if (applyLowWeightCorrection()) { tnbrPatchD = - interpolate + cyclicPeriodicAMIPolyPatch_.interpolate ( nbrPatch.coupledFvPatch::delta(), vectorField(this->size(), Zero) @@ -156,7 +159,11 @@ Foam::tmp<Foam::vectorField> Foam::cyclicPeriodicAMIFvPatch::delta() const } else { - tnbrPatchD = interpolate(nbrPatch.coupledFvPatch::delta()); + tnbrPatchD = + cyclicPeriodicAMIPolyPatch_.interpolate + ( + nbrPatch.coupledFvPatch::delta() + ); } const vectorField& nbrPatchD = tnbrPatchD(); diff --git a/src/meshTools/Make/files b/src/meshTools/Make/files index ec5b663e54a..cdcdae3b153 100644 --- a/src/meshTools/Make/files +++ b/src/meshTools/Make/files @@ -301,13 +301,8 @@ PeriodicAMICycPatches=$(AMI)/patches/cyclicPeriodicAMI $(PeriodicAMICycPatches)/cyclicPeriodicAMILduInterfaceField/cyclicPeriodicAMILduInterface.C $(PeriodicAMICycPatches)/cyclicPeriodicAMILduInterfaceField/cyclicPeriodicAMILduInterfaceField.C $(PeriodicAMICycPatches)/cyclicPeriodicAMIPolyPatch/cyclicPeriodicAMIPolyPatch.C -/* -$(PeriodicAMICycPatches)/cyclicPeriodicAMIPointPatch/cyclicPeriodicAMIPointPatch.C -*/ $(PeriodicAMICycPatches)/cyclicPeriodicAMIPointPatchField/cyclicPeriodicAMIPointPatchFields.C - - multiWorld/multiWorldConnectionsObject.C mappedPatches/mappedPolyPatch/mappedPatchBase.C -- GitLab