From dcff2b94e86e05bf2d5d576027f3d9fbfd085478 Mon Sep 17 00:00:00 2001 From: Will Bainbridge Date: Thu, 19 Dec 2024 15:26:12 +0000 Subject: [PATCH] nonConformalProcessorCyclic: Corrected transformation of deltas --- .../fvPatches/basic/coupled/coupledFvPatch.C | 20 +--------- .../fvPatches/basic/coupled/coupledFvPatch.H | 3 -- .../constraint/cyclic/cyclicFvPatch.C | 6 ++- .../nonConformalCyclicFvPatch.C | 18 --------- .../nonConformalCyclicFvPatch.H | 7 ---- .../nonConformalProcessorCyclicFvPatch.C | 38 ------------------- .../nonConformalProcessorCyclicFvPatch.H | 7 ---- .../constraint/processor/processorFvPatch.C | 7 ++-- 8 files changed, 9 insertions(+), 97 deletions(-) diff --git a/src/finiteVolume/fvMesh/fvPatches/basic/coupled/coupledFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/basic/coupled/coupledFvPatch.C index 25c15395bf..0fe34bbedb 100644 --- a/src/finiteVolume/fvMesh/fvPatches/basic/coupled/coupledFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/basic/coupled/coupledFvPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -76,24 +76,6 @@ void Foam::coupledFvPatch::makeWeights } -Foam::tmp Foam::coupledFvPatch::delta -( - const vectorField& nbrDelta -) const -{ - if (transform().transforms()) - { - return - coupledFvPatch::delta() - - transform().transform(nbrDelta); - } - else - { - return coupledFvPatch::delta() - nbrDelta; - } -} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // Foam::tmp Foam::coupledFvPatch::delta() const diff --git a/src/finiteVolume/fvMesh/fvPatches/basic/coupled/coupledFvPatch.H b/src/finiteVolume/fvMesh/fvPatches/basic/coupled/coupledFvPatch.H index 12299df2f5..f2c40cf685 100644 --- a/src/finiteVolume/fvMesh/fvPatches/basic/coupled/coupledFvPatch.H +++ b/src/finiteVolume/fvMesh/fvPatches/basic/coupled/coupledFvPatch.H @@ -72,9 +72,6 @@ protected: const vectorField& nbrDelta ) const; - //- Return delta (P to N) vectors across coupled patch - tmp delta(const vectorField& nbrDelta) const; - public: diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C index 9ef7df1eac..62f911bcf9 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/cyclic/cyclicFvPatch.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2024 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -54,7 +54,9 @@ void Foam::cyclicFvPatch::makeWeights(scalarField& w) const Foam::tmp Foam::cyclicFvPatch::delta() const { - return coupledFvPatch::delta(nbrPatch().coupledFvPatch::delta()); + return + coupledFvPatch::delta() + - transform().transform(nbrPatch().coupledFvPatch::delta()); } diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/nonConformalCyclic/nonConformalCyclicFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/nonConformalCyclic/nonConformalCyclicFvPatch.C index 925de71bdf..c22ad43498 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/nonConformalCyclic/nonConformalCyclicFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/nonConformalCyclic/nonConformalCyclicFvPatch.C @@ -101,22 +101,4 @@ const Foam::labelUList& Foam::nonConformalCyclicFvPatch::faceCells() const } -void Foam::nonConformalCyclicFvPatch::makeWeights(scalarField& w) const -{ - nonConformalCoupledFvPatch::makeWeights - ( - w, - nbrPatch().Sf(), - nbrPatch().coupledFvPatch::delta() - ); -} - - -Foam::tmp -Foam::nonConformalCyclicFvPatch::delta() const -{ - return coupledFvPatch::delta(nbrPatch().coupledFvPatch::delta()); -} - - // ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/nonConformalCyclic/nonConformalCyclicFvPatch.H b/src/finiteVolume/fvMesh/fvPatches/constraint/nonConformalCyclic/nonConformalCyclicFvPatch.H index d74db2fd85..d67b34b5ef 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/nonConformalCyclic/nonConformalCyclicFvPatch.H +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/nonConformalCyclic/nonConformalCyclicFvPatch.H @@ -122,13 +122,6 @@ public: //- Return the face-cells virtual const labelUList& faceCells() const; - - - //- Make patch weighting factors - void makeWeights(scalarField&) const; - - //- Return delta (P to N) vectors across coupled patch - virtual tmp delta() const; }; diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/nonConformalProcessorCyclic/nonConformalProcessorCyclicFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/nonConformalProcessorCyclic/nonConformalProcessorCyclicFvPatch.C index 50d0120155..3bf0e0518a 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/nonConformalProcessorCyclic/nonConformalProcessorCyclicFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/nonConformalProcessorCyclic/nonConformalProcessorCyclicFvPatch.C @@ -100,42 +100,4 @@ Foam::nonConformalProcessorCyclicFvPatch::faceCells() const } -void Foam::nonConformalProcessorCyclicFvPatch::makeWeights(scalarField& w) const -{ - if (Pstream::parRun()) - { - nonConformalCoupledFvPatch::makeWeights - ( - w, - - boundaryMesh().mesh().Sf().boundaryField()[index()], - boundaryMesh().mesh().Cf().boundaryField()[index()] - - boundaryMesh().mesh().C().boundaryField()[index()] - ); - } - else - { - w = 1; - } -} - - -Foam::tmp -Foam::nonConformalProcessorCyclicFvPatch::delta() const -{ - if (Pstream::parRun()) - { - return - coupledFvPatch::delta - ( - boundaryMesh().mesh().Cf().boundaryField()[index()] - - boundaryMesh().mesh().C().boundaryField()[index()] - ); - } - else - { - return coupledFvPatch::delta(); - } -} - - // ************************************************************************* // diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/nonConformalProcessorCyclic/nonConformalProcessorCyclicFvPatch.H b/src/finiteVolume/fvMesh/fvPatches/constraint/nonConformalProcessorCyclic/nonConformalProcessorCyclicFvPatch.H index d64984fc2b..f5189cf701 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/nonConformalProcessorCyclic/nonConformalProcessorCyclicFvPatch.H +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/nonConformalProcessorCyclic/nonConformalProcessorCyclicFvPatch.H @@ -119,13 +119,6 @@ public: //- Return the face-cells virtual const labelUList& faceCells() const; - - - //- Make patch weighting factors - virtual void makeWeights(scalarField& w) const; - - //- Return delta (P to N) vectors across coupled patch - virtual tmp delta() const; }; diff --git a/src/finiteVolume/fvMesh/fvPatches/constraint/processor/processorFvPatch.C b/src/finiteVolume/fvMesh/fvPatches/constraint/processor/processorFvPatch.C index 5e86987294..c651d6dda0 100644 --- a/src/finiteVolume/fvMesh/fvPatches/constraint/processor/processorFvPatch.C +++ b/src/finiteVolume/fvMesh/fvPatches/constraint/processor/processorFvPatch.C @@ -78,8 +78,8 @@ Foam::tmp Foam::processorFvPatch::delta() const if (!boundaryMesh().mesh().conformal()) { return - coupledFvPatch::delta - ( + coupledFvPatch::delta() + - ( boundaryMesh().mesh().Cf().boundaryField()[index()] - boundaryMesh().mesh().C().boundaryField()[index()] ); @@ -87,7 +87,8 @@ Foam::tmp Foam::processorFvPatch::delta() const else { return - coupledFvPatch::delta + coupledFvPatch::delta() + - transform().transform ( procPolyPatch_.neighbFaceCentres() - procPolyPatch_.neighbFaceCellCentres()