From 5252c800ebb00fbf31db3959a9acb6e8111a91cd Mon Sep 17 00:00:00 2001
From: Henry <Henry>
Date: Thu, 22 Jan 2015 10:59:45 +0000
Subject: [PATCH] twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE: Added
 fvOptions support Resolves bug-report
 http://www.openfoam.org/mantisbt/view.php?id=1402

---
 .../twoPhaseEulerFoam/twoPhaseSystem/Make/options  |  7 +++++--
 .../twoPhaseSystem/diameterModels/IATE/IATE.C      | 14 +++++++++++++-
 2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/Make/options b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/Make/options
index c403e6fe211..abefe54c4ef 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/Make/options
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/Make/options
@@ -1,13 +1,16 @@
 EXE_INC = \
     -I../twoPhaseSystem \
     -I../interfacialModels/lnInclude \
-    -I$(LIB_SRC)/finiteVolume/lnInclude \
     -I$(LIB_SRC)/transportModels/compressible/lnInclude \
     -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
     -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
     -I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
     -I$(LIB_SRC)/TurbulenceModels/compressible/lnInclude \
-    -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude
+    -I$(LIB_SRC)/TurbulenceModels/phaseCompressible/lnInclude \
+    -I$(LIB_SRC)/finiteVolume/lnInclude \
+    -I$(LIB_SRC)/fvOptions/lnInclude \
+    -I$(LIB_SRC)/meshTools/lnInclude \
+    -I$(LIB_SRC)/sampling/lnInclude
 
 LIB_LIBS = \
     -lincompressibleTransportModels \
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C
index 8cedcc1e4f1..f6e1a535cb4 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/twoPhaseSystem/diameterModels/IATE/IATE.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2013-2014 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2013-2015 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -32,6 +32,7 @@ License
 #include "fvcDdt.H"
 #include "fvcDiv.H"
 #include "fvcAverage.H"
+#include "fvOptionList.H"
 #include "mathematicalConstants.H"
 #include "fundamentalConstants.H"
 #include "addToRunTimeSelectionTable.H"
@@ -155,6 +156,13 @@ void Foam::diameterModels::IATE::correct()
         R -= sources_[j].R();
     }
 
+    // const_cast needed because the operators and functions of fvOptions
+    // are currently non-const.
+    fv::optionList& fvOptions = const_cast<fv::optionList&>
+    (
+        phase_.U().mesh().lookupObject<fv::optionList>("fvOptions")
+    );
+
     // Construct the interfacial curvature equation
     fvScalarMatrix kappaiEqn
     (
@@ -163,9 +171,13 @@ void Foam::diameterModels::IATE::correct()
      ==
       - fvm::SuSp(R, kappai_)
     //+ Rph() // Omit the nucleation/condensation term
+      + fvOptions(kappai_)
     );
 
     kappaiEqn.relax();
+
+    fvOptions.constrain(kappaiEqn);
+
     kappaiEqn.solve();
 
     // Update the Sauter-mean diameter
-- 
GitLab