From 0e6f7a14e9fbac6e17bc0bb691e31eeb9cacc2c7 Mon Sep 17 00:00:00 2001
From: Timo Koch <timo.koch@iws.uni-stuttgart.de>
Date: Thu, 7 Jan 2021 17:38:30 +0100
Subject: [PATCH] [test][ff][pipe] Test for non-zero initial pressure

---
 test/freeflow/navierstokes/channel/pipe/params.input | 3 +--
 test/freeflow/navierstokes/channel/pipe/problem.hh   | 8 +++++++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/test/freeflow/navierstokes/channel/pipe/params.input b/test/freeflow/navierstokes/channel/pipe/params.input
index 9bcb4dacc3..66b549898c 100644
--- a/test/freeflow/navierstokes/channel/pipe/params.input
+++ b/test/freeflow/navierstokes/channel/pipe/params.input
@@ -9,8 +9,7 @@ Grading1 = 1
 [Problem]
 Name = test_ff_stokes_channel_pipe
 MeanInletVelocity = 0.1 # [m/s]
-
-[Problem]
+InitialPressure = 1.0e5 # [Pa]
 EnableGravity = false
 EnableInertiaTerms = false
 
diff --git a/test/freeflow/navierstokes/channel/pipe/problem.hh b/test/freeflow/navierstokes/channel/pipe/problem.hh
index 91668701cd..21ed3446d6 100644
--- a/test/freeflow/navierstokes/channel/pipe/problem.hh
+++ b/test/freeflow/navierstokes/channel/pipe/problem.hh
@@ -52,6 +52,7 @@ public:
     {
         name_ = getParamFromGroup<std::string>(this->paramGroup(), "Problem.Name");
         meanInletVelocity_ = getParamFromGroup<Scalar>(this->paramGroup(), "Problem.MeanInletVelocity");
+        initialPressure_ = getParamFromGroup<Scalar>(this->paramGroup(), "Problem.InitialPressure");
         mu_ = getParam<Scalar>("Component.LiquidKinematicViscosity")*getParam<Scalar>("Component.LiquidDensity");
 
         pipeRadius_ = this->gridGeometry().bBoxMax()[0] - this->gridGeometry().bBoxMin()[0];
@@ -109,7 +110,11 @@ public:
     { return analyticalSolution(globalPos); }
 
     PrimaryVariables initialAtPos(const GlobalPosition& globalPos) const
-    { return PrimaryVariables(0.0); }
+    {
+        PrimaryVariables values(0.0);
+        values[Indices::pressureIdx] = initialPressure_;
+        return values;
+    }
 
     PrimaryVariables analyticalSolution(const GlobalPosition& globalPos) const
     {
@@ -139,6 +144,7 @@ private:
     { return globalPos[1] > this->gridGeometry().bBoxMax()[1] - eps_; }
 
     std::string name_;
+    Scalar initialPressure_;
     Scalar meanInletVelocity_;
     Scalar mu_;
     Scalar pipeRadius_, pipeLength_;
-- 
GitLab