From ea522e76bb61e1e1de022c7cf58659587a1d9bd9 Mon Sep 17 00:00:00 2001
From: Andrew Heather <>
Date: Mon, 5 Nov 2018 09:14:59 +0000
Subject: [PATCH] ENH: totalFlowRateAdvectiveDiffusive BC - removed hard-coded
 LES model lookup. Fixes #1097

---
 ...RateAdvectiveDiffusiveFvPatchScalarField.C | 24 +++++++++----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C
index e63eae2117..6c92cc5c1c 100644
--- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C
+++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/totalFlowRateAdvectiveDiffusive/totalFlowRateAdvectiveDiffusiveFvPatchScalarField.C
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2018 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -81,6 +81,7 @@ totalFlowRateAdvectiveDiffusiveFvPatchScalarField
     }
 }
 
+
 Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::
 totalFlowRateAdvectiveDiffusiveFvPatchScalarField
 (
@@ -109,6 +110,7 @@ totalFlowRateAdvectiveDiffusiveFvPatchScalarField
     massFluxFraction_(tppsf.massFluxFraction_)
 {}
 
+
 Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::
 totalFlowRateAdvectiveDiffusiveFvPatchScalarField
 (
@@ -153,11 +155,8 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::updateCoeffs()
 
     const label patchi = patch().index();
 
-    const LESModel<EddyDiffusivity<compressible::turbulenceModel>>& turbModel =
-        db().lookupObject
-        <
-            LESModel<EddyDiffusivity<compressible::turbulenceModel>>
-        >
+    const compressible::turbulenceModel& turbModel =
+        db().lookupObject<compressible::turbulenceModel>
         (
             IOobject::groupName
             (
@@ -176,10 +175,9 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::updateCoeffs()
 
     valueFraction() =
         1.0
-        /
-        (
-            1.0 +
-            alphap*patch().deltaCoeffs()*patch().magSf()/max(mag(phip), SMALL)
+       /(
+            1.0
+          + alphap*patch().deltaCoeffs()*patch().magSf()/max(mag(phip), SMALL)
         );
 
     mixedFvPatchField<scalar>::updateCoeffs();
@@ -197,8 +195,10 @@ void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::updateCoeffs()
 }
 
 
-void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::
-write(Ostream& os) const
+void Foam::totalFlowRateAdvectiveDiffusiveFvPatchScalarField::write
+(
+    Ostream& os
+) const
 {
     fvPatchField<scalar>::write(os);
     os.writeEntry("phi", phiName_);
-- 
GitLab