From e144940047aa4893957ea6196288d07765b144aa Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Fri, 17 Apr 2015 20:00:29 +0100
Subject: [PATCH] interfaceProperties: Add support for re-read of sigma and
 cAlpha

Note that currently when transportProperties is changed sigma is re-read
from this dictionary but cAlpha is read from fvSolution but cAlpha is
not re-read when fvSolution is changed but transportProperties is not
touched.  To avoid this problem cAlpha would need to be moved to the
transportProperties dictionary which is not ideal or moved out of the
interfaceProperties class back to the top-level solver.

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1657
---
 .../immiscibleIncompressibleTwoPhaseMixture.H        | 12 ++++++++++--
 .../interfaceProperties/interfaceProperties.C        | 11 ++++++++++-
 .../interfaceProperties/interfaceProperties.H        |  5 ++++-
 3 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/src/transportModels/immiscibleIncompressibleTwoPhaseMixture/immiscibleIncompressibleTwoPhaseMixture.H b/src/transportModels/immiscibleIncompressibleTwoPhaseMixture/immiscibleIncompressibleTwoPhaseMixture.H
index 84140229f52..ded416b068f 100644
--- a/src/transportModels/immiscibleIncompressibleTwoPhaseMixture/immiscibleIncompressibleTwoPhaseMixture.H
+++ b/src/transportModels/immiscibleIncompressibleTwoPhaseMixture/immiscibleIncompressibleTwoPhaseMixture.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2014 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2014-2015 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -44,7 +44,7 @@ namespace Foam
 {
 
 /*---------------------------------------------------------------------------*\
-                      Class immiscibleIncompressibleTwoPhaseMixture Declaration
+           Class immiscibleIncompressibleTwoPhaseMixture Declaration
 \*---------------------------------------------------------------------------*/
 
 class immiscibleIncompressibleTwoPhaseMixture
@@ -78,6 +78,14 @@ public:
             incompressibleTwoPhaseMixture::correct();
             interfaceProperties::correct();
         }
+
+        //- Read base transportProperties dictionary
+        virtual bool read()
+        {
+            return
+                incompressibleTwoPhaseMixture::read()
+             && interfaceProperties::read();
+        }
 };
 
 
diff --git a/src/transportModels/interfaceProperties/interfaceProperties.C b/src/transportModels/interfaceProperties/interfaceProperties.C
index daa1967c990..0091aeee8f1 100644
--- a/src/transportModels/interfaceProperties/interfaceProperties.C
+++ b/src/transportModels/interfaceProperties/interfaceProperties.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2014 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -222,4 +222,13 @@ Foam::interfaceProperties::nearInterface() const
 }
 
 
+bool Foam::interfaceProperties::read()
+{
+    alpha1_.mesh().solverDict(alpha1_.name()).lookup("cAlpha") >> cAlpha_;
+    transportPropertiesDict_.lookup("sigma") >> sigma_;
+
+    return true;
+}
+
+
 // ************************************************************************* //
diff --git a/src/transportModels/interfaceProperties/interfaceProperties.H b/src/transportModels/interfaceProperties/interfaceProperties.H
index b14f118ac51..060d516d324 100644
--- a/src/transportModels/interfaceProperties/interfaceProperties.H
+++ b/src/transportModels/interfaceProperties/interfaceProperties.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2014 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -152,6 +152,9 @@ public:
         {
             calculateK();
         }
+
+        //- Read transportProperties dictionary
+        bool read();
 };
 
 
-- 
GitLab