From 2cc7c923c00c9978cbe99b6c7a2b66ff271a6a62 Mon Sep 17 00:00:00 2001
From: Thomas Fetzer <thomas.fetzer@iws.uni-stuttgart.de>
Date: Fri, 29 Jun 2018 11:11:22 +0200
Subject: [PATCH] [rans] Move Prandtl and Schmidt numbers to problem on RANS
 level

---
 dumux/freeflow/rans/problem.hh                | 22 +++++++++++++++++++
 .../rans/twoeq/kepsilon/volumevariables.hh    |  6 ++---
 .../rans/twoeq/komega/volumevariables.hh      |  6 ++---
 .../twoeq/lowrekepsilon/volumevariables.hh    |  6 ++---
 dumux/freeflow/rans/volumevariables.hh        |  6 +----
 dumux/freeflow/rans/zeroeq/volumevariables.hh |  6 ++---
 6 files changed, 31 insertions(+), 21 deletions(-)

diff --git a/dumux/freeflow/rans/problem.hh b/dumux/freeflow/rans/problem.hh
index dc07959d55..f7147298ad 100644
--- a/dumux/freeflow/rans/problem.hh
+++ b/dumux/freeflow/rans/problem.hh
@@ -371,6 +371,28 @@ public:
     const Scalar karmanConstant() const
     { return 0.41; }
 
+    /*!
+     * \brief Return the turbulent Prandtl number \f$ [-] \f$ which is used to convert
+     *        the eddy viscosity to an eddy thermal conductivity
+     */
+    Scalar turbulentPrandtlNumber() const
+    {
+        static const Scalar turbulentPrandtlNumber
+            = getParamFromGroup<Scalar>(this->paramGroup(), "RANS.TurbulentPrandtlNumber", 1.0);
+        return turbulentPrandtlNumber;
+    }
+
+    /*!
+     * \brief Return the turbulent Schmidt number \f$ [-] \f$ which is used to convert
+     *        the eddy viscosity to an eddy diffusivity
+     */
+    Scalar turbulentSchmidtNumber() const
+    {
+        static const Scalar turbulentSchmidtNumber
+            = getParamFromGroup<Scalar>(this->paramGroup(), "RANS.TurbulentSchmidtNumber", 1.0);
+        return turbulentSchmidtNumber;
+    }
+
 public:
     std::vector<unsigned int> wallElementID_;
     std::vector<Scalar> wallDistance_;
diff --git a/dumux/freeflow/rans/twoeq/kepsilon/volumevariables.hh b/dumux/freeflow/rans/twoeq/kepsilon/volumevariables.hh
index 8edfa0e4f4..b1039e9167 100644
--- a/dumux/freeflow/rans/twoeq/kepsilon/volumevariables.hh
+++ b/dumux/freeflow/rans/twoeq/kepsilon/volumevariables.hh
@@ -155,10 +155,8 @@ public:
     template<class Problem>
     void calculateEddyDiffusivity(const Problem& problem)
     {
-        static const auto turbulentSchmidtNumber
-            = getParamFromGroup<Scalar>(problem.paramGroup(),
-                                        "RANS.TurbulentSchmidtNumber", 1.0);
-        eddyDiffusivity_ = RANSParentType::kinematicEddyViscosity() / turbulentSchmidtNumber;
+        eddyDiffusivity_ = RANSParentType::kinematicEddyViscosity()
+                           / problem.turbulentSchmidtNumber();
     }
 
     /*!
diff --git a/dumux/freeflow/rans/twoeq/komega/volumevariables.hh b/dumux/freeflow/rans/twoeq/komega/volumevariables.hh
index cdf9205793..7220511bee 100644
--- a/dumux/freeflow/rans/twoeq/komega/volumevariables.hh
+++ b/dumux/freeflow/rans/twoeq/komega/volumevariables.hh
@@ -161,10 +161,8 @@ public:
     template<class Problem>
     void calculateEddyDiffusivity(const Problem& problem)
     {
-        static const auto turbulentSchmidtNumber
-            = getParamFromGroup<Scalar>(problem.paramGroup(),
-                                        "RANS.TurbulentSchmidtNumber", 1.0);
-        eddyDiffusivity_ = RANSParentType::kinematicEddyViscosity() / turbulentSchmidtNumber;
+        eddyDiffusivity_ = RANSParentType::kinematicEddyViscosity()
+                           / problem.turbulentSchmidtNumber();
     }
 
     /*!
diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh
index c8bec8f879..5521c6f5fd 100644
--- a/dumux/freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh
+++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/volumevariables.hh
@@ -144,10 +144,8 @@ public:
     template<class Problem>
     void calculateEddyDiffusivity(const Problem& problem)
     {
-        static const auto turbulentSchmidtNumber
-            = getParamFromGroup<Scalar>(problem.paramGroup(),
-                                        "RANS.TurbulentSchmidtNumber", 1.0);
-        eddyDiffusivity_ = RANSParentType::kinematicEddyViscosity() / turbulentSchmidtNumber;
+        eddyDiffusivity_ = RANSParentType::kinematicEddyViscosity()
+                           / problem.turbulentSchmidtNumber();
     }
 
     /*!
diff --git a/dumux/freeflow/rans/volumevariables.hh b/dumux/freeflow/rans/volumevariables.hh
index 24ba47261a..a0182d4430 100644
--- a/dumux/freeflow/rans/volumevariables.hh
+++ b/dumux/freeflow/rans/volumevariables.hh
@@ -215,14 +215,10 @@ public:
     template<class Problem>
     void calculateEddyThermalConductivity(const Problem& problem)
     {
-        static const auto turbulentPrandtlNumber
-            = getParamFromGroup<Scalar>(problem.paramGroup(),
-                                        "RANS.TurbulentPrandtlNumber", 1.0);
-
         eddyThermalConductivity_ = ParentType::kinematicEddyViscosity()
                                    * ParentType::asImp_().density()
                                    * ParentType::asImp_().heatCapacity()
-                                   / turbulentPrandtlNumber;
+                                   / problem.turbulentPrandtlNumber();
     }
 
     /*!
diff --git a/dumux/freeflow/rans/zeroeq/volumevariables.hh b/dumux/freeflow/rans/zeroeq/volumevariables.hh
index 4f61a3d95f..efb256f856 100644
--- a/dumux/freeflow/rans/zeroeq/volumevariables.hh
+++ b/dumux/freeflow/rans/zeroeq/volumevariables.hh
@@ -183,10 +183,8 @@ public:
     template<class Problem>
     void calculateEddyDiffusivity(const Problem& problem)
     {
-        static const auto turbulentSchmidtNumber
-            = getParamFromGroup<Scalar>(problem.paramGroup(),
-                                        "RANS.TurbulentSchmidtNumber", 1.0);
-        eddyDiffusivity_ = RANSParentType::kinematicEddyViscosity() / turbulentSchmidtNumber;
+        eddyDiffusivity_ = RANSParentType::kinematicEddyViscosity()
+                           / problem.turbulentSchmidtNumber();
     }
 
     /*!
-- 
GitLab