From 4fe6ed3c6a66d6ca0b52c4703fc81e2c8028e692 Mon Sep 17 00:00:00 2001
From: Henry Weller <http://openfoam.org>
Date: Fri, 25 May 2018 23:43:41 +0100
Subject: [PATCH] BUG: compressibleInterFoam: Corrected handling of thermal
 diffusivity with mixture turbulence model

Resolves bug-report https://bugs.openfoam.org/view.php?id=2958
---
 .../compressibleInterPhaseTransportModel.C    | 20 +++++++++++++------
 .../compressibleInterPhaseTransportModel.H    | 12 ++++++++---
 .../twoPhaseMixtureThermo.C                   |  6 ++----
 3 files changed, 25 insertions(+), 13 deletions(-)

diff --git a/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.C b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.C
index 52089420b88..424c7dc8b98 100644
--- a/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.C
+++ b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2017 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2017-2018 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -94,7 +94,8 @@ Foam::compressibleInterPhaseTransportModel::compressibleInterPhaseTransportModel
 
         turbulence1_ =
         (
-            PhaseCompressibleTurbulenceModel<fluidThermo>::New
+            ThermalDiffusivity<PhaseCompressibleTurbulenceModel<fluidThermo>>
+            ::New
             (
                 alpha1,
                 rho1,
@@ -107,7 +108,8 @@ Foam::compressibleInterPhaseTransportModel::compressibleInterPhaseTransportModel
 
         turbulence2_ =
         (
-            PhaseCompressibleTurbulenceModel<fluidThermo>::New
+            ThermalDiffusivity<PhaseCompressibleTurbulenceModel<fluidThermo>>
+            ::New
             (
                 alpha2,
                 rho2,
@@ -141,12 +143,18 @@ Foam::compressibleInterPhaseTransportModel::alphaEff() const
     if (twoPhaseTransport_)
     {
         return
-            mixture_.alpha1()*mixture_.thermo1().alphaEff(turbulence1_->mut())
-          + mixture_.alpha2()*mixture_.thermo2().alphaEff(turbulence2_->mut());
+            mixture_.alpha1()*mixture_.thermo1().alphaEff
+            (
+                turbulence1_->alphat()
+            )
+          + mixture_.alpha2()*mixture_.thermo2().alphaEff
+            (
+                turbulence2_->alphat()
+            );
     }
     else
     {
-        return turbulence_->mut();
+        return mixture_.alphaEff(turbulence_->alphat());
     }
 }
 
diff --git a/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.H b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.H
index 72eabf12d1e..70a3b1338d2 100644
--- a/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.H
+++ b/applications/solvers/multiphase/compressibleInterFoam/VoFphaseCompressibleTurbulenceModels/compressibleInterPhaseTransportModel.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2017 OpenFOAM Foundation
+    \\  /    A nd           | Copyright (C) 2017-2018 OpenFOAM Foundation
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -84,10 +84,16 @@ class compressibleInterPhaseTransportModel
         autoPtr<compressible::turbulenceModel> turbulence_;
 
         //- Phase-1 transport model (constructed for two-phase transport)
-        autoPtr<PhaseCompressibleTurbulenceModel<fluidThermo>> turbulence1_;
+        autoPtr
+        <
+            ThermalDiffusivity<PhaseCompressibleTurbulenceModel<fluidThermo>>
+        > turbulence1_;
 
         //- Phase-2 transport model (constructed for two-phase transport)
-        autoPtr<PhaseCompressibleTurbulenceModel<fluidThermo>> turbulence2_;
+        autoPtr
+        <
+            ThermalDiffusivity<PhaseCompressibleTurbulenceModel<fluidThermo>>
+        > turbulence2_;
 
 
     // Private Member Functions
diff --git a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C
index 69daa03abb6..f4a90a275bd 100644
--- a/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C
+++ b/applications/solvers/multiphase/compressibleInterFoam/twoPhaseMixtureThermo/twoPhaseMixtureThermo.C
@@ -343,8 +343,7 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::kappaEff
 {
     return
         alpha1().boundaryField()[patchi]*thermo1_->kappaEff(alphat, patchi)
-      + alpha2().boundaryField()[patchi]*thermo2_->kappaEff(alphat, patchi)
-    ;
+      + alpha2().boundaryField()[patchi]*thermo2_->kappaEff(alphat, patchi);
 }
 
 
@@ -367,8 +366,7 @@ Foam::tmp<Foam::scalarField> Foam::twoPhaseMixtureThermo::alphaEff
 {
     return
         alpha1().boundaryField()[patchi]*thermo1_->alphaEff(alphat, patchi)
-      + alpha2().boundaryField()[patchi]*thermo2_->alphaEff(alphat, patchi)
-    ;
+      + alpha2().boundaryField()[patchi]*thermo2_->alphaEff(alphat, patchi);
 }
 
 
-- 
GitLab