From 1ebe55d95b6409b2c34674bc800d24e21e19e348 Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Thu, 22 Mar 2012 11:48:09 +0000
Subject: [PATCH] multiphase solvers: remove lift and drag at fixed-flux BCs,
 i.e. inlets

---
 .../compressibleTwoPhaseEulerFoam.C           |  1 +
 .../interfacialCoeffs.H                       | 11 +++++
 .../multiphaseSystem/multiphaseSystem.C       | 40 ++++++++++++++++---
 .../twoPhaseEulerFoam/liftDragCoeffs.H        | 10 +++++
 .../twoPhaseEulerFoam/twoPhaseEulerFoam.C     |  1 +
 5 files changed, 58 insertions(+), 5 deletions(-)

diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C
index 78d70a15371..94548090b1d 100644
--- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C
+++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/compressibleTwoPhaseEulerFoam.C
@@ -33,6 +33,7 @@ Description
 #include "fvCFD.H"
 #include "nearWallDist.H"
 #include "wallFvPatch.H"
+#include "fixedValueFvsPatchFields.H"
 #include "Switch.H"
 
 #include "IFstream.H"
diff --git a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialCoeffs.H b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialCoeffs.H
index 0f28f2330d3..3b4d2be679d 100644
--- a/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialCoeffs.H
+++ b/applications/solvers/multiphase/compressibleTwoPhaseEulerFoam/interfacialCoeffs.H
@@ -77,4 +77,15 @@ volScalarField heatTransferCoeff
     heatTransferCoeff *= alpha1Coeff;
 
     liftForce = Cl*(alpha1*rho1 + alpha2*rho2)*(Ur ^ fvc::curl(U));
+
+    // Remove lift, drag and phase heat-transfer at fixed-flux boundaries
+    forAll(phi1.boundaryField(), patchi)
+    {
+        if (isA<fixedValueFvsPatchScalarField>(phi1.boundaryField()[patchi]))
+        {
+            dragCoeff.boundaryField()[patchi] = 0.0;
+            heatTransferCoeff.boundaryField()[patchi] = 0.0;
+            liftForce.boundaryField()[patchi] = vector::zero;
+        }
+    }
 }
diff --git a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C
index 2224030613f..41b79f77b96 100644
--- a/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C
+++ b/applications/solvers/multiphase/multiphaseEulerFoam/multiphaseSystem/multiphaseSystem.C
@@ -25,6 +25,7 @@ License
 
 #include "multiphaseSystem.H"
 #include "alphaContactAngleFvPatchScalarField.H"
+#include "fixedValueFvsPatchFields.H"
 #include "Time.H"
 #include "subCycle.H"
 #include "MULES.H"
@@ -610,6 +611,21 @@ Foam::tmp<Foam::volVectorField> Foam::multiphaseSystem::Svm
         }
     }
 
+    // Remove lift at fixed-flux boundaries
+    forAll(phase.phi().boundaryField(), patchi)
+    {
+        if
+        (
+            isA<fixedValueFvsPatchScalarField>
+            (
+                phase.phi().boundaryField()[patchi]
+            )
+        )
+        {
+            tSvm().boundaryField()[patchi] = vector::zero;
+        }
+    }
+
     return tSvm;
 }
 
@@ -623,9 +639,7 @@ Foam::multiphaseSystem::dragCoeffs() const
     {
         const dragModel& dm = *iter();
 
-        dragCoeffsPtr().insert
-        (
-            iter.key(),
+        volScalarField* Kptr =
             (
                 max
                 (
@@ -642,8 +656,24 @@ Foam::multiphaseSystem::dragCoeffs() const
                         dm.residualSlip()
                     )
                 )
-            ).ptr()
-        );
+            ).ptr();
+
+        // Remove drag at fixed-flux boundaries
+        forAll(dm.phase1().phi().boundaryField(), patchi)
+        {
+            if
+            (
+                isA<fixedValueFvsPatchScalarField>
+                (
+                    dm.phase1().phi().boundaryField()[patchi]
+                )
+            )
+            {
+                Kptr->boundaryField()[patchi] = 0.0;
+            }
+        }
+
+        dragCoeffsPtr().insert(iter.key(), Kptr);
     }
 
     return dragCoeffsPtr;
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/liftDragCoeffs.H b/applications/solvers/multiphase/twoPhaseEulerFoam/liftDragCoeffs.H
index 097123378cd..415afe9483b 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/liftDragCoeffs.H
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/liftDragCoeffs.H
@@ -19,3 +19,13 @@
     (
         Cl*(alpha2*rho2 + alpha1*rho1)*(Ur ^ fvc::curl(U))
     );
+
+    // Remove lift and drag at fixed-flux boundaries
+    forAll(phi1.boundaryField(), patchi)
+    {
+        if (isA<fixedValueFvsPatchScalarField>(phi1.boundaryField()[patchi]))
+        {
+            K.boundaryField()[patchi] = 0.0;
+            liftCoeff.boundaryField()[patchi] = vector::zero;
+        }
+    }
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C
index d9da532aef5..178032db6f5 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseEulerFoam.C
@@ -35,6 +35,7 @@ Description
 #include "subCycle.H"
 #include "nearWallDist.H"
 #include "wallFvPatch.H"
+#include "fixedValueFvsPatchFields.H"
 #include "Switch.H"
 
 #include "IFstream.H"
-- 
GitLab