From 47e95170aee9897371cb39aa9470daaaf3923276 Mon Sep 17 00:00:00 2001
From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de>
Date: Fri, 3 Aug 2018 16:51:59 +0200
Subject: [PATCH] [rans] Clean-up problems

---
 dumux/freeflow/rans/problem.hh                    | 15 +++++++--------
 dumux/freeflow/rans/twoeq/komega/problem.hh       | 13 +++----------
 .../freeflow/rans/twoeq/lowrekepsilon/problem.hh  |  1 -
 3 files changed, 10 insertions(+), 19 deletions(-)

diff --git a/dumux/freeflow/rans/problem.hh b/dumux/freeflow/rans/problem.hh
index a886af7141..468194bb86 100644
--- a/dumux/freeflow/rans/problem.hh
+++ b/dumux/freeflow/rans/problem.hh
@@ -24,6 +24,7 @@
 #ifndef DUMUX_RANS_PROBLEM_HH
 #define DUMUX_RANS_PROBLEM_HH
 
+#include <dune/common/fmatrix.hh>
 #include <dumux/common/properties.hh>
 #include <dumux/common/staggeredfvproblem.hh>
 #include <dumux/discretization/localview.hh>
@@ -49,24 +50,22 @@ class RANSProblem : public NavierStokesProblem<TypeTag>
     using ParentType = NavierStokesProblem<TypeTag>;
     using Implementation = typename GET_PROP_TYPE(TypeTag, Problem);
 
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Grid = typename GridView::Grid;
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
 
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
-    using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
+    using FVElementGeometry = typename FVGridGeometry::LocalView;
+    using GridView = typename FVGridGeometry::GridView;
     using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
     using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
     using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
-    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using PrimaryVariables = typename VolumeVariables::PrimaryVariables;
     using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
     using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
-    enum {
-        dim = Grid::dimension,
-      };
     using GlobalPosition = typename SubControlVolumeFace::GlobalPosition;
-    using DimVector = Dune::FieldVector<Scalar, dim>;
+
+    static constexpr auto dim = GridView::dimension;
+    using DimVector = GlobalPosition;
     using DimMatrix = Dune::FieldMatrix<Scalar, dim, dim>;
 
 public:
diff --git a/dumux/freeflow/rans/twoeq/komega/problem.hh b/dumux/freeflow/rans/twoeq/komega/problem.hh
index 33f41525f0..a4ee39561e 100644
--- a/dumux/freeflow/rans/twoeq/komega/problem.hh
+++ b/dumux/freeflow/rans/twoeq/komega/problem.hh
@@ -52,7 +52,6 @@ class KOmegaProblem : public RANSProblem<TypeTag>
 
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
 
     using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
     using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
@@ -60,14 +59,8 @@ class KOmegaProblem : public RANSProblem<TypeTag>
     using CellCenterPrimaryVariables = typename GET_PROP_TYPE(TypeTag, CellCenterPrimaryVariables);
     using Indices = typename GET_PROP_TYPE(TypeTag, ModelTraits)::Indices;
 
-    using GridView = typename GET_PROP_TYPE(TypeTag, GridView);
-    using Grid = typename GridView::Grid;
-    enum {
-        dim = Grid::dimension,
-      };
-    using GlobalPosition = Dune::FieldVector<Scalar, dim>;
-    using DimVector = Dune::FieldVector<Scalar, dim>;
-    using DimMatrix = Dune::FieldMatrix<Scalar, dim, dim>;
+    using Element = typename FVGridGeometry::GridView::template Codim<0>::Entity;
+    using DimVector = typename Element::Geometry::GlobalCoordinate;
 
 public:
     KOmegaProblem(std::shared_ptr<const FVGridGeometry> fvGridGeometry, const std::string& paramGroup = "")
@@ -127,7 +120,7 @@ public:
         {
             unsigned int elementIdx = this->fvGridGeometry().elementMapper().index(element);
 
-            for (unsigned int dimIdx = 0; dimIdx < dim; ++dimIdx)
+            for (unsigned int dimIdx = 0; dimIdx < DimVector::dimension; ++dimIdx)
             {
                 unsigned backwardNeighbor = ParentType::neighborIdx_[elementIdx][dimIdx][0];
                 unsigned forwardNeighbor = ParentType::neighborIdx_[elementIdx][dimIdx][1];
diff --git a/dumux/freeflow/rans/twoeq/lowrekepsilon/problem.hh b/dumux/freeflow/rans/twoeq/lowrekepsilon/problem.hh
index 1b420db7aa..34d30266e6 100644
--- a/dumux/freeflow/rans/twoeq/lowrekepsilon/problem.hh
+++ b/dumux/freeflow/rans/twoeq/lowrekepsilon/problem.hh
@@ -52,7 +52,6 @@ class LowReKEpsilonProblem : public RANSProblem<TypeTag>
 
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
     using FVElementGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry)::LocalView;
-    using SubControlVolumeFace = typename FVElementGeometry::SubControlVolumeFace;
 
     using VolumeVariables = typename GET_PROP_TYPE(TypeTag, VolumeVariables);
     using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
-- 
GitLab