From d812879fdb609a5aecd01b8192647ebde591c369 Mon Sep 17 00:00:00 2001
From: Henry Weller <http://cfd.direct>
Date: Tue, 24 Nov 2015 22:36:50 +0000
Subject: [PATCH] TurbulenceModels: updated the mapping of k to R BCs Now k BCs
 which do not have a symmTensor equivalent are converted to "calculated"

---
 .../eddyViscosity/eddyViscosity.C             | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/src/TurbulenceModels/turbulenceModels/eddyViscosity/eddyViscosity.C b/src/TurbulenceModels/turbulenceModels/eddyViscosity/eddyViscosity.C
index 70307f6456d..641f012bee2 100644
--- a/src/TurbulenceModels/turbulenceModels/eddyViscosity/eddyViscosity.C
+++ b/src/TurbulenceModels/turbulenceModels/eddyViscosity/eddyViscosity.C
@@ -84,6 +84,23 @@ Foam::eddyViscosity<BasicTurbulenceModel>::R() const
 {
     tmp<volScalarField> tk(k());
 
+    // Get list of patchField type names from k
+    wordList patchFieldTypes(tk().boundaryField().types());
+
+    // For k patchField types which do not have an equivalent for symmTensor
+    // set to calculated
+    forAll(patchFieldTypes, i)
+    {
+        if
+        (
+           !fvPatchField<symmTensor>::patchConstructorTablePtr_
+                ->found(patchFieldTypes[i])
+        )
+        {
+            patchFieldTypes[i] = calculatedFvPatchField<symmTensor>::typeName;
+        }
+    }
+
     return tmp<volSymmTensorField>
     (
         new volSymmTensorField
@@ -98,7 +115,7 @@ Foam::eddyViscosity<BasicTurbulenceModel>::R() const
                 false
             ),
             ((2.0/3.0)*I)*tk() - (nut_)*dev(twoSymm(fvc::grad(this->U_))),
-            tk().boundaryField().types()
+            patchFieldTypes
         )
     );
 }
-- 
GitLab