From 86cd2150a265edf61a38ed8462886b13c656e5ff Mon Sep 17 00:00:00 2001
From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de>
Date: Sun, 17 Dec 2017 20:23:06 +0100
Subject: [PATCH] [navierstokes][problem] Add method to set init face solution

* staggered grid specific method to set velocity
---
 dumux/freeflow/navierstokes/problem.hh | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/dumux/freeflow/navierstokes/problem.hh b/dumux/freeflow/navierstokes/problem.hh
index 5046e29772..b755600aae 100644
--- a/dumux/freeflow/navierstokes/problem.hh
+++ b/dumux/freeflow/navierstokes/problem.hh
@@ -63,6 +63,10 @@ class NavierStokesProblem : public NavierStokesParentProblem<TypeTag>
     using Scalar = typename GET_PROP_TYPE(TypeTag, Scalar);
 
     using FVGridGeometry = typename GET_PROP_TYPE(TypeTag, FVGridGeometry);
+    using SubControlVolumeFace = typename GET_PROP_TYPE(TypeTag, SubControlVolumeFace);
+    using SolutionVector = typename GET_PROP_TYPE(TypeTag, SolutionVector);
+    using PrimaryVariables = typename GET_PROP_TYPE(TypeTag, PrimaryVariables);
+    using Indices = typename GET_PROP_TYPE(TypeTag, Indices);
 
     enum {
         dim = Grid::dimension,
@@ -113,6 +117,18 @@ public:
     const GlobalPosition &gravity() const
     { return gravity_; }
 
+    //! Applys the initial face solution. Specialization for staggered grid discretization.
+    template <class T = TypeTag>
+    typename std::enable_if<GET_PROP_VALUE(T, DiscretizationMethod) == DiscretizationMethods::Staggered, void>::type
+    applyInititalFaceSolution(SolutionVector& sol,
+                              const SubControlVolumeFace& scvf,
+                              const PrimaryVariables& initSol) const
+    {
+        typename GET_PROP(TypeTag, DofTypeIndices)::FaceIdx faceIdx;
+        const auto numEqCellCenter = GET_PROP_VALUE(TypeTag, NumEqCellCenter);
+        sol[faceIdx][scvf.dofIndex()][numEqCellCenter] = initSol[Indices::velocity(scvf.directionIndex())];
+    }
+
     // \}
 
 private:
-- 
GitLab