diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H index 94c743f740..357e81c932 100644 --- a/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H +++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/polyPatch/polyPatch.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -316,6 +316,16 @@ public: //- Return a list of all the constraint patch types static wordList constraintTypes(); + //- Extract face cell data + template + const UIndirectList patchInternalList + ( + const UList& internalValues + ) const + { + return UIndirectList(internalValues, faceCells()); + } + //- Slice list to patch template const typename List::subList patchSlice(const UList& l) const @@ -343,7 +353,7 @@ public: //- Return face normals const vectorField::subField faceAreas() const; - //- Return face neighbour cell centres + //- Return face cell centres tmp faceCellCentres() const; diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.C index ff36ee9797..7e13ba75f4 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/jumpCyclicAMI/jumpCyclicAMIFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -99,10 +99,21 @@ Foam::jumpCyclicAMIFvPatchField::patchNeighbourField() const this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells(); Field pnf(iField, nbrFaceCells); - tmp > tpnf - ( - new Field(this->cyclicAMIPatch().interpolate(pnf)) - ); + tmp > tpnf; + + if (this->cyclicAMIPatch().applyLowWeightCorrection()) + { + tpnf = + this->cyclicAMIPatch().interpolate + ( + pnf, + this->patchInternalField()() + ); + } + else + { + tpnf = this->cyclicAMIPatch().interpolate(pnf); + } if (this->doTransform()) { @@ -157,7 +168,20 @@ void Foam::jumpCyclicAMIFvPatchField::updateInterfaceMatrix Field pnf(psiInternal, nbrFaceCells); - pnf = this->cyclicAMIPatch().interpolate(pnf); + if (this->cyclicAMIPatch().applyLowWeightCorrection()) + { + pnf = + this->cyclicAMIPatch().interpolate + ( + pnf, + this->patchInternalField()() + ); + + } + else + { + pnf = this->cyclicAMIPatch().interpolate(pnf); + } // only apply jump to original field if (&psiInternal == &this->internalField()) diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C index cc9717ffac..21b62c6e2c 100644 --- a/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C +++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedJumpAMI/fixedJumpAMIFvPatchField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -123,7 +123,18 @@ Foam::tmp > Foam::fixedJumpAMIFvPatchField::jump() const this->neighbourPatchField() ); - return this->cyclicAMIPatch().interpolate(nbrPatch.jump()); + if (this->cyclicAMIPatch().applyLowWeightCorrection()) + { + return this->cyclicAMIPatch().interpolate + ( + nbrPatch.jump(), + Field(this->size(), pTraits::zero) + ); + } + else + { + return this->cyclicAMIPatch().interpolate(nbrPatch.jump()); + } } } diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicAMI/cyclicAMIFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicAMI/cyclicAMIFvPatch.C index abf1a6b395..584e9d7731 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicAMI/cyclicAMIFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicAMI/cyclicAMIFvPatch.C @@ -53,14 +53,22 @@ void Foam::cyclicAMIFvPatch::makeWeights(scalarField& w) const const scalarField deltas(nf() & fvPatch::delta()); - const scalarField nbrDeltas - ( - interpolate - ( - nbrPatch.nf() & nbrPatch.fvPatch::delta(), - scalarField(this->size(), 1.0) - ) - ); + tmp tnbrDeltas; + if (applyLowWeightCorrection()) + { + tnbrDeltas = + interpolate + ( + nbrPatch.nf() & nbrPatch.fvPatch::delta(), + scalarField(this->size(), 1.0) + ); + } + else + { + tnbrDeltas = interpolate(nbrPatch.nf() & nbrPatch.fvPatch::delta()); + } + + const scalarField& nbrDeltas = tnbrDeltas(); forAll(deltas, faceI) { @@ -86,14 +94,22 @@ Foam::tmp Foam::cyclicAMIFvPatch::delta() const { const vectorField patchD(fvPatch::delta()); - const vectorField nbrPatchD - ( - interpolate - ( - nbrPatch.fvPatch::delta(), - vectorField(this->size(), vector::zero) - ) - ); + tmp tnbrPatchD; + if (applyLowWeightCorrection()) + { + tnbrPatchD = + interpolate + ( + nbrPatch.fvPatch::delta(), + vectorField(this->size(), vector::zero) + ); + } + else + { + tnbrPatchD = interpolate(nbrPatch.fvPatch::delta()); + } + + const vectorField& nbrPatchD = tnbrPatchD(); tmp tpdv(new vectorField(patchD.size())); vectorField& pdv = tpdv(); diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicAMI/cyclicAMIFvPatch.H b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicAMI/cyclicAMIFvPatch.H index 0263fb52df..6ba8ed4356 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicAMI/cyclicAMIFvPatch.H +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclicAMI/cyclicAMIFvPatch.H @@ -120,6 +120,13 @@ public: return cyclicAMIPolyPatch_.AMI(); } + //- Return true if applying the low weight correction + virtual bool applyLowWeightCorrection() const + { + return cyclicAMIPolyPatch_.applyLowWeightCorrection(); + } + + //- Are the cyclic planes parallel virtual bool parallel() const { @@ -154,11 +161,6 @@ public: //- Return delta (P to N) vectors across coupled patch virtual tmp delta() const; - bool applyLowWeightCorrection() const - { - return cyclicAMIPolyPatch_.applyLowWeightCorrection(); - } - template tmp > interpolate ( diff --git a/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicAMIGAMGInterface/cyclicAMIGAMGInterface.H b/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicAMIGAMGInterface/cyclicAMIGAMGInterface.H index ce32308742..c05773af1c 100644 --- a/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicAMIGAMGInterface/cyclicAMIGAMGInterface.H +++ b/src/meshTools/AMIInterpolation/GAMG/interfaces/cyclicAMIGAMGInterface/cyclicAMIGAMGInterface.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -111,7 +111,7 @@ public: //- Cyclic interface functions - //- Return neigbour processor number + //- Return neighbour processor number virtual label neighbPatchID() const { return fineCyclicAMIInterface_.neighbPatchID(); diff --git a/src/meshTools/algorithms/MeshWave/FaceCellWave.C b/src/meshTools/algorithms/MeshWave/FaceCellWave.C index 946e23e53f..9b2a68fc96 100644 --- a/src/meshTools/algorithms/MeshWave/FaceCellWave.C +++ b/src/meshTools/algorithms/MeshWave/FaceCellWave.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -746,7 +746,20 @@ void Foam::FaceCellWave::handleAMICyclicPatches() // Transfer sendInfo to cycPatch combine cmb(*this, cycPatch); - cycPatch.interpolate(sendInfo, cmb, receiveInfo); + + if (cycPatch.applyLowWeightCorrection()) + { + List defVals + ( + cycPatch.patchInternalList(allCellInfo_) + ); + + cycPatch.interpolate(sendInfo, cmb, receiveInfo, defVals); + } + else + { + cycPatch.interpolate(sendInfo, cmb, receiveInfo); + } } // Apply transform to received data for non-parallel planes