From b1a1a0c60d7a9721a092fe6bc79a21a488b4e539 Mon Sep 17 00:00:00 2001
From: Henry Weller <http://cfd.direct>
Date: Tue, 16 Jun 2015 12:43:40 +0100
Subject: [PATCH] filmViscosityModel/thixotropicViscosity: Corrected the
 handling of the effect of droplet deposition on the lambda of the film

---
 .../thixotropicViscosity.C                    | 43 ++++++++-----------
 1 file changed, 17 insertions(+), 26 deletions(-)

diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/thixotropicViscosity/thixotropicViscosity.C b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/thixotropicViscosity/thixotropicViscosity.C
index bb0546f1930..d29d9d3ff41 100644
--- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/thixotropicViscosity/thixotropicViscosity.C
+++ b/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/thixotropicViscosity/thixotropicViscosity.C
@@ -115,11 +115,12 @@ void thixotropicViscosity::correct
     const volScalarField& deltaRho = film.deltaRho();
     const surfaceScalarField& phi = film.phi();
     const volScalarField& alpha = film.alpha();
+    const Time& runTime = this->owner().regionMesh().time();
 
     // Shear rate
     volScalarField gDot("gDot", alpha*mag(U - Uw)/(delta + film.deltaSmall()));
 
-    if (debug && this->owner().regionMesh().time().outputTime())
+    if (debug && runTime.outputTime())
     {
         gDot.write();
     }
@@ -130,6 +131,19 @@ void thixotropicViscosity::correct
     dimensionedScalar c0("c0", dimless/dimTime, ROOTVSMALL);
     volScalarField coeff("coeff", -c_*pow(gDot, d_) + c0);
 
+    // Limit the filmMass and deltaMass to calculate the effect of the added
+    // droplets with lambda = 0 to the film
+    const volScalarField filmMass
+    (
+        "thixotropicViscosity:filmMass",
+        film.netMass() + dimensionedScalar("SMALL", dimMass, ROOTVSMALL)
+    );
+    const volScalarField deltaMass
+    (
+        "thixotropicViscosity:deltaMass",
+        max(dimensionedScalar("zero", dimMass, 0), film.deltaMass())
+    );
+
     fvScalarMatrix lambdaEqn
     (
         fvm::ddt(lambda_)
@@ -138,39 +152,16 @@ void thixotropicViscosity::correct
       ==
         a_*pow((1.0 - lambda_), b_)
       + fvm::SuSp(coeff, lambda_)
+      - fvm::Sp(deltaMass/(runTime.deltaT()*filmMass), lambda_)
     );
 
-
     lambdaEqn.relax();
-
     lambdaEqn.solve();
 
     lambda_.min(1.0);
     lambda_.max(0.0);
 
-
-    // Blend based on mass fraction of added- to existing film mass
-    const dimensionedScalar m0("zero", dimMass, 0.0);
-    const dimensionedScalar mSMALL("SMALL", dimMass, ROOTVSMALL);
-    const volScalarField deltaMass
-    (
-        "thixotropicViscosity:deltaMass",
-        max(m0, film.deltaMass())
-    );
-    const volScalarField filmMass
-    (
-        "thixotropicViscosity:filmMass",
-        film.netMass() + mSMALL
-    );
-
-    // Weighting field to blend new and existing mass contributions
-    const volScalarField w
-    (
-        "thixotropicViscosity:w",
-        max(scalar(0.0), min(scalar(1.0), deltaMass/(deltaMass + filmMass)))
-    );
-
-    mu_ = w*muInf_ + (1 - w)*muInf_/(sqr(1.0 - K_*lambda_) + ROOTVSMALL);
+    mu_ = muInf_/(sqr(1.0 - K_*lambda_) + ROOTVSMALL);
     mu_.correctBoundaryConditions();
 }
 
-- 
GitLab