From bc3eaefc75e5a91af5810c6dbbc520d3607b7f0a Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Thu, 22 Jul 2021 10:47:06 +0100
Subject: [PATCH] BUG: cyclicPeriodicAMI: some more logic. See #2145

---
 applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H  | 1 +
 .../finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C            | 5 ++++-
 .../MomentumTransferPhaseSystem.C                            | 1 +
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H b/applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H
index 71d75bd26e0..972fb84d9ef 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/pU/pEqn.H
@@ -162,6 +162,7 @@ while (pimple.correct())
             (
                !mesh.boundary()[patchi].coupled()
              || isA<cyclicAMIFvPatch>(mesh.boundary()[patchi])
+             || isA<cyclicPeriodicAMIFvPatch>(mesh.boundary()[patchi])
             )
             {
                 phiCorrCoeff1Bf[patchi] = 0;
diff --git a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C
index 6ce56fc73c4..deebbbc03d2 100644
--- a/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C
+++ b/src/finiteVolume/finiteVolume/ddtSchemes/ddtScheme/ddtScheme.C
@@ -6,7 +6,7 @@
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
     Copyright (C) 2011-2018 OpenFOAM Foundation
-    Copyright (C) 2017-2019 OpenCFD Ltd.
+    Copyright (C) 2017-2021 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -31,6 +31,7 @@ License
 #include "surfaceInterpolate.H"
 #include "fvMatrix.H"
 #include "cyclicAMIFvPatch.H"
+#include "cyclicPeriodicAMIFvPatch.H"
 #include "registerSwitch.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -193,6 +194,7 @@ tmp<surfaceScalarField> ddtScheme<Type>::fvcDdtPhiCoeff
         (
             U.boundaryField()[patchi].fixesValue()
          || isA<cyclicAMIFvPatch>(mesh().boundary()[patchi])
+         || isA<cyclicPeriodicAMIFvPatch>(mesh().boundary()[patchi])
         )
         {
             ccbf[patchi] = 0.0;
@@ -274,6 +276,7 @@ tmp<surfaceScalarField> ddtScheme<Type>::fvcDdtPhiCoeffExperimental
         (
             U.boundaryField()[patchi].fixesValue()
          || isA<cyclicAMIFvPatch>(mesh().boundary()[patchi])
+         || isA<cyclicPeriodicAMIFvPatch>(mesh().boundary()[patchi])
         )
         {
             ccbf[patchi] = 0.0;
diff --git a/src/phaseSystemModels/reactingEuler/multiphaseSystem/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C b/src/phaseSystemModels/reactingEuler/multiphaseSystem/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C
index 7623bd2d702..5a88e4bf6ca 100644
--- a/src/phaseSystemModels/reactingEuler/multiphaseSystem/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C
+++ b/src/phaseSystemModels/reactingEuler/multiphaseSystem/PhaseSystems/MomentumTransferPhaseSystem/MomentumTransferPhaseSystem.C
@@ -964,6 +964,7 @@ Foam::MomentumTransferPhaseSystem<BasePhaseSystem>::ddtCorrByAs
             (
                 !this->mesh_.boundary()[patchi].coupled()
              || isA<cyclicAMIFvPatch>(this->mesh_.boundary()[patchi])
+             || isA<cyclicPeriodicAMIFvPatch>(this->mesh_.boundary()[patchi])
             )
             {
                 phiCorrCoeffBf[patchi] = 0;
-- 
GitLab