From 3885c4933d44453be2d74682b1e4a8afca9eff67 Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Tue, 29 Apr 2014 11:42:13 +0100
Subject: [PATCH] driftFluxFoam: add support for alphaMax and d of the
 dispersed-phase

---
 .../multiphase/driftFluxFoam/alphaEqn.H       | 54 ++++++++++++++++---
 ...incompressibleTwoPhaseInteractingMixture.C | 21 ++++++++
 ...incompressibleTwoPhaseInteractingMixture.H | 19 +++++++
 3 files changed, 88 insertions(+), 6 deletions(-)

diff --git a/applications/solvers/multiphase/driftFluxFoam/alphaEqn.H b/applications/solvers/multiphase/driftFluxFoam/alphaEqn.H
index daec8efa921..1c4aa0a179e 100644
--- a/applications/solvers/multiphase/driftFluxFoam/alphaEqn.H
+++ b/applications/solvers/multiphase/driftFluxFoam/alphaEqn.H
@@ -43,9 +43,23 @@
         {
             Info<< "Applying the previous iteration correction flux" << endl;
             #ifdef LTSSOLVE
-            MULES::LTScorrect(alpha1, phiAlpha, tphiAlphaCorr0(), 1, 0);
+            MULES::LTScorrect
+            (
+                alpha1,
+                phiAlpha,
+                tphiAlphaCorr0(),
+                mixture.alphaMax(),
+                0
+            );
             #else
-            MULES::correct(alpha1, phiAlpha, tphiAlphaCorr0(), 1, 0);
+            MULES::correct
+            (
+                alpha1,
+                phiAlpha,
+                tphiAlphaCorr0(),
+                mixture.alphaMax(),
+                0
+            );
             #endif
 
             phiAlpha += tphiAlphaCorr0();
@@ -79,9 +93,23 @@
             volScalarField alpha10(alpha1);
 
             #ifdef LTSSOLVE
-            MULES::LTScorrect(alpha1, tphiAlphaUn(), tphiAlphaCorr(), 1, 0);
+            MULES::LTScorrect
+            (
+                alpha1,
+                tphiAlphaUn(),
+                tphiAlphaCorr(),
+                mixture.alphaMax(),
+                0
+            );
             #else
-            MULES::correct(alpha1, tphiAlphaUn(), tphiAlphaCorr(), 1, 0);
+            MULES::correct
+            (
+                alpha1,
+                tphiAlphaUn(),
+                tphiAlphaCorr(),
+                mixture.alphaMax(),
+                0
+            );
             #endif
 
             // Under-relax the correction for all but the 1st corrector
@@ -100,9 +128,23 @@
             phiAlpha = tphiAlphaUn;
 
             #ifdef LTSSOLVE
-            MULES::explicitLTSSolve(alpha1, phi, phiAlpha, 1, 0);
+            MULES::explicitLTSSolve
+            (
+                alpha1,
+                phi,
+                phiAlpha,
+                mixture.alphaMax(),
+                0
+            );
             #else
-            MULES::explicitSolve(alpha1, phi, phiAlpha, 1, 0);
+            MULES::explicitSolve
+            (
+                alpha1,
+                phi,
+                phiAlpha,
+                mixture.alphaMax(),
+                0
+            );
             #endif
         }
     }
diff --git a/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.C b/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.C
index d656f92b14b..fded594b70e 100644
--- a/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.C
+++ b/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.C
@@ -82,6 +82,13 @@ incompressibleTwoPhaseInteractingMixture
 
     rhod_("rho", dimDensity, muModel_->viscosityProperties().lookup("rho")),
     rhoc_("rho", dimDensity, nucModel_->viscosityProperties().lookup("rho")),
+    dd_
+    (
+        "d",
+        dimLength,
+        muModel_->viscosityProperties().lookupOrDefault("d", 0.0)
+    ),
+    alphaMax_(muModel_->viscosityProperties().lookupOrDefault("alphaMax", 1.0)),
 
     U_(U),
     phi_(phi),
@@ -118,6 +125,20 @@ bool Foam::incompressibleTwoPhaseInteractingMixture::read()
             muModel_->viscosityProperties().lookup("rho") >> rhod_;
             nucModel_->viscosityProperties().lookup("rho") >> rhoc_;
 
+            dd_ = dimensionedScalar
+            (
+                "d",
+                dimLength,
+                muModel_->viscosityProperties().lookupOrDefault("d", 0)
+            );
+
+            alphaMax_ =
+                muModel_->viscosityProperties().lookupOrDefault
+                (
+                    "alphaMax",
+                    1.0
+                );
+
             return true;
         }
         else
diff --git a/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.H b/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.H
index e22179c87fa..8339ce293ef 100644
--- a/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.H
+++ b/applications/solvers/multiphase/driftFluxFoam/incompressibleTwoPhaseInteractingMixture/incompressibleTwoPhaseInteractingMixture.H
@@ -69,6 +69,12 @@ protected:
         dimensionedScalar rhod_;
         dimensionedScalar rhoc_;
 
+        //- Optional diameter of the dispersed phase particles
+        dimensionedScalar dd_;
+
+        //- Optional maximum dispersed phase-fraction (e.g. packing limit)
+        scalar alphaMax_;
+
         const volVectorField& U_;
         const surfaceScalarField& phi_;
 
@@ -121,6 +127,19 @@ public:
             return rhoc_;
         };
 
+        //- Return the diameter of the dispersed-phase particles
+        const dimensionedScalar& dd() const
+        {
+            return dd_;
+        }
+
+        //- Optional maximum phase-fraction (e.g. packing limit)
+        //  Defaults to 1
+        scalar alphaMax() const
+        {
+            return alphaMax_;
+        }
+
         //- Return const-access to the mixture velocity
         const volVectorField& U() const
         {
-- 
GitLab