diff --git a/src/overset/cellCellStencil/cellVolumeWeight/cellVolumeWeightCellCellStencil.C b/src/overset/cellCellStencil/cellVolumeWeight/cellVolumeWeightCellCellStencil.C index 121c8c724433881ccc76fc2c9a2374677480dae3..4f02c9d466c48c7dffa7d2fcf728ef939b51c584 100644 --- a/src/overset/cellCellStencil/cellVolumeWeight/cellVolumeWeightCellCellStencil.C +++ b/src/overset/cellCellStencil/cellVolumeWeight/cellVolumeWeightCellCellStencil.C @@ -35,6 +35,7 @@ License #include "oversetFvPatch.H" #include "zeroGradientFvPatchFields.H" #include "syncTools.H" +#include "dynamicOversetFvMesh.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -1116,7 +1117,12 @@ bool Foam::cellCellStencils::cellVolumeWeight::update() { patchTypes[cellI] = allPatchTypes[cellI]; } - patchTypes.correctBoundaryConditions(); + //patchTypes.correctBoundaryConditions(); + dynamicOversetFvMesh::correctBoundaryConditions + < + volScalarField, + oversetFvPatchField<scalar> + >(patchTypes.boundaryFieldRef(), false); patchTypes.write(); } if (debug) @@ -1141,7 +1147,12 @@ bool Foam::cellCellStencils::cellVolumeWeight::update() { volTypes[cellI] = allCellTypes[cellI]; } - volTypes.correctBoundaryConditions(); + //volTypes.correctBoundaryConditions(); + dynamicOversetFvMesh::correctBoundaryConditions + < + volScalarField, + oversetFvPatchField<scalar> + >(volTypes.boundaryFieldRef(), false); volTypes.write(); } @@ -1185,7 +1196,12 @@ bool Foam::cellCellStencils::cellVolumeWeight::update() cellStencil_.transfer(allStencil); cellInterpolationWeights_.transfer(allWeights); cellInterpolationWeight_.transfer(allWeight); - cellInterpolationWeight_.correctBoundaryConditions(); + //cellInterpolationWeight_.correctBoundaryConditions(); + dynamicOversetFvMesh::correctBoundaryConditions + < + volScalarField, + oversetFvPatchField<scalar> + >(cellInterpolationWeight_.boundaryFieldRef(), false); DynamicList<label> interpolationCells; forAll(cellStencil_, cellI) diff --git a/src/overset/cellCellStencil/inverseDistance/inverseDistanceCellCellStencil.C b/src/overset/cellCellStencil/inverseDistance/inverseDistanceCellCellStencil.C index 9bb6c6fef8548122a78015fa7673da98aa8ec829..a595d80d15c4889520427226109d48ed661490a9 100644 --- a/src/overset/cellCellStencil/inverseDistance/inverseDistanceCellCellStencil.C +++ b/src/overset/cellCellStencil/inverseDistance/inverseDistanceCellCellStencil.C @@ -37,6 +37,7 @@ License #include "waveMethod.H" #include "regionSplit.H" +#include "dynamicOversetFvMesh.H" //#include "minData.H" //#include "FaceCellWave.H" @@ -2152,7 +2153,11 @@ bool Foam::cellCellStencils::inverseDistance::update() new mapDistribute(globalCells, cellStencil_, compactMap) ); cellInterpolationWeight_.transfer(allWeight); - cellInterpolationWeight_.correctBoundaryConditions(); + dynamicOversetFvMesh::correctBoundaryConditions + < + volScalarField, + oversetFvPatchField<scalar> + >(cellInterpolationWeight_.boundaryFieldRef(), false); if (debug&2) @@ -2226,7 +2231,11 @@ bool Foam::cellCellStencils::inverseDistance::update() ( createField(mesh_, "maxMagWeight", maxMagWeight) ); - tfld.ref().correctBoundaryConditions(); + dynamicOversetFvMesh::correctBoundaryConditions + < + volScalarField, + oversetFvPatchField<scalar> + >(tfld.ref().boundaryFieldRef(), false); tfld().write(); } @@ -2236,7 +2245,12 @@ bool Foam::cellCellStencils::inverseDistance::update() ( createField(mesh_, "cellTypes", cellTypes_) ); - tfld.ref().correctBoundaryConditions(); + //tfld.ref().correctBoundaryConditions(); + dynamicOversetFvMesh::correctBoundaryConditions + < + volScalarField, + oversetFvPatchField<scalar> + >(tfld.ref().boundaryFieldRef(), false); tfld().write(); } diff --git a/src/overset/cellCellStencil/trackingInverseDistance/trackingInverseDistanceCellCellStencil.C b/src/overset/cellCellStencil/trackingInverseDistance/trackingInverseDistanceCellCellStencil.C index db10a358c455d2eac13230fb4164d62774ea91a2..a4c315dd81577c344b7d9d78cfafc79e02732582 100644 --- a/src/overset/cellCellStencil/trackingInverseDistance/trackingInverseDistanceCellCellStencil.C +++ b/src/overset/cellCellStencil/trackingInverseDistance/trackingInverseDistanceCellCellStencil.C @@ -34,6 +34,7 @@ License #include "syncTools.H" #include "treeBoundBoxList.H" #include "voxelMeshSearch.H" +#include "dynamicOversetFvMesh.H" // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // @@ -961,7 +962,12 @@ bool Foam::cellCellStencils::trackingInverseDistance::update() ) ); cellInterpolationWeight_.transfer(allWeight); - cellInterpolationWeight_.correctBoundaryConditions(); + //cellInterpolationWeight_.correctBoundaryConditions(); + dynamicOversetFvMesh::correctBoundaryConditions + < + volScalarField, + oversetFvPatchField<scalar> + >(cellInterpolationWeight_.boundaryFieldRef(), false); if (debug & 2) @@ -1024,7 +1030,12 @@ bool Foam::cellCellStencils::trackingInverseDistance::update() { volTypes[celli] = cellTypes_[celli]; } - volTypes.correctBoundaryConditions(); + //volTypes.correctBoundaryConditions(); + dynamicOversetFvMesh::correctBoundaryConditions + < + volScalarField, + oversetFvPatchField<scalar> + >(volTypes.boundaryFieldRef(), false); volTypes.write(); // Dump stencil diff --git a/src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.H b/src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.H index ff499f7142b778e3c6c542f03f1868bce75ed657..0f7bfc18ad03e1310a43d34337c5c8c86136d592 100644 --- a/src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.H +++ b/src/overset/dynamicOversetFvMesh/dynamicOversetFvMesh.H @@ -128,15 +128,6 @@ protected: //template<class GeoField, class PatchType> //lduInterfaceFieldPtrsList scalarInterfaces(const GeoField& psi) const; - //- Correct boundary conditions of certain type (typeOnly = true) - // or explicitly not of the type (typeOnly = false) - template<class GeoField, class PatchType> - static void correctBoundaryConditions - ( - typename GeoField::Boundary& bfld, - const bool typeOnly - ); - //- Determine normalisation for interpolation. This equals the // original diagonal except stabilised for zero diagonals (possible // in hole cells) @@ -358,6 +349,15 @@ public: //- Debug: check halo swap is ok template<class GeoField> static void checkCoupledBC(const GeoField& fld); + + //- Correct boundary conditions of certain type (typeOnly = true) + // or explicitly not of the type (typeOnly = false) + template<class GeoField, class PatchType> + static void correctBoundaryConditions + ( + typename GeoField::Boundary& bfld, + const bool typeOnly + ); }; diff --git a/src/overset/dynamicOversetFvMesh/dynamicOversetFvMeshTemplates.C b/src/overset/dynamicOversetFvMesh/dynamicOversetFvMeshTemplates.C index a875867238e71ce61d84dca317a01c610edc302d..f0331304959c350018fb38c0b26f05c6666889e8 100644 --- a/src/overset/dynamicOversetFvMesh/dynamicOversetFvMeshTemplates.C +++ b/src/overset/dynamicOversetFvMesh/dynamicOversetFvMeshTemplates.C @@ -155,11 +155,10 @@ Foam::tmp<Foam::scalarField> Foam::dynamicOversetFvMesh::normalisation tmp<scalarField> tnorm(tmp<scalarField>::New(m.diag())); scalarField& norm = tnorm.ref(); - // Add boundary coeffs to duplicate behaviour of fvMatrix + // Add boundary coeffs to duplicate behaviour of fvMatrix::addBoundaryDiag const FieldField<Field, Type>& internalCoeffs = m.internalCoeffs(); for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++) { - //m.addBoundaryDiag(norm, cmpt); forAll(internalCoeffs, patchi) { const labelUList& fc = lduAddr().patchAddr(patchi);