From bbbf9dcc1c488ad1f256d5a39c256b5bf07e04f1 Mon Sep 17 00:00:00 2001
From: Thomas Fetzer <thomas.fetzer@iws.uni-stuttgart.de>
Date: Tue, 20 Mar 2018 17:18:29 +0100
Subject: [PATCH] [ransnc][doxygen] Add proper documentation

---
 doc/doxygen/modules.txt                     | 18 ++++---
 dumux/freeflow/rans/problem.hh              |  3 --
 dumux/freeflow/rans/zeroeq/model.hh         |  6 +--
 dumux/freeflow/rans/zeroeq/models.hh        | 49 +++++++++++++++++
 dumux/freeflow/ransnc/model.hh              |  4 +-
 test/freeflow/ransnc/channeltestproblem.hh  | 59 +++++++--------------
 test/freeflow/ransnc/test_channel_zeroeq.cc |  3 --
 7 files changed, 83 insertions(+), 59 deletions(-)
 create mode 100644 dumux/freeflow/rans/zeroeq/models.hh

diff --git a/doc/doxygen/modules.txt b/doc/doxygen/modules.txt
index a8f3cabf3d..2be982282e 100644
--- a/doc/doxygen/modules.txt
+++ b/doc/doxygen/modules.txt
@@ -170,7 +170,7 @@
 /* ***************** FreeflowModels ******************/
 /*!
  * \defgroup FreeflowModels Free Flow Models
- * \brief Single-phase Navier-Stokes / Stokes model
+ * \brief Single-phase models basing on the Navier-Stokes equation
  */
 	/*!
      * \ingroup FreeflowModels
@@ -197,11 +197,17 @@
      * \copydetails ./freeflow/rans/model.hh
      */
       /*!
-      * \ingroup RANSModel
-      * \defgroup ZeroEqModel 0-Eq. Models
-      * \brief Zero-equation or algebraic turbulence models
-      * \copydetails ./freeflow/rans/model.hh
-      */
+       * \ingroup RANSModel
+       * \defgroup ZeroEqModel 0-Eq. Models
+       * \brief Zero-equation or algebraic turbulence models
+       * \copydetails ./freeflow/rans/model.hh
+       */
+    /*!
+     * \ingroup FreeflowModels
+     * \defgroup RANSNCModel Reynolds-Averaged Navier-Stokes nc
+     * \brief Single-phase multi-component Reynolds-Averaged Navier-Stokes flow
+     * \copydetails ./freeflow/ransnc/model.hh
+     */
 
 /* ***************** Benchmarks and Tests ******************/
 /*!
diff --git a/dumux/freeflow/rans/problem.hh b/dumux/freeflow/rans/problem.hh
index 247a6ee5dc..b5e456f688 100644
--- a/dumux/freeflow/rans/problem.hh
+++ b/dumux/freeflow/rans/problem.hh
@@ -43,9 +43,6 @@ namespace Dumux
  * This implements some base functionality for RANS models.
  * Especially vectors containing all wall-relevant properties, which are accessed
  * by the volumevariables.
- * \todo inherit all functions (especially gravity and temperature from Navier-Stokes)
- * This implements gravity (if desired) and a function returning the temperature.
- * Includes a specialized method used only by the staggered grid discretization.
  */
 template<class TypeTag>
 class RANSProblem : public NavierStokesProblem<TypeTag>
diff --git a/dumux/freeflow/rans/zeroeq/model.hh b/dumux/freeflow/rans/zeroeq/model.hh
index e6553df11b..59691c2aa0 100644
--- a/dumux/freeflow/rans/zeroeq/model.hh
+++ b/dumux/freeflow/rans/zeroeq/model.hh
@@ -26,10 +26,8 @@
  *
  * These models calculate the eddy viscosity without solving additional PDEs,
  * only based on the wall distance and the velocity gradient.
- * The following models are available:
- *  -# Prandtl's mixing length, e.g. \cite Oertel2012a
- *  -# Van-Driest modification, \cite vanDriest1956a and \cite Hanna1981a
- *  -# Baldwin-Lomax, \cite Baldwin1978a
+ *
+ * \copydoc Dumux::EddyViscosityModels
  */
 
 #ifndef DUMUX_ZEROEQ_MODEL_HH
diff --git a/dumux/freeflow/rans/zeroeq/models.hh b/dumux/freeflow/rans/zeroeq/models.hh
new file mode 100644
index 0000000000..9a51b55fce
--- /dev/null
+++ b/dumux/freeflow/rans/zeroeq/models.hh
@@ -0,0 +1,49 @@
+// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
+// vi: set et ts=4 sw=4 sts=4:
+/*****************************************************************************
+ *   See the file COPYING for full copying permissions.                      *
+ *                                                                           *
+ *   This program is free software: you can redistribute it and/or modify    *
+ *   it under the terms of the GNU General Public License as published by    *
+ *   the Free Software Foundation, either version 2 of the License, or       *
+ *   (at your option) any later version.                                     *
+ *                                                                           *
+ *   This program is distributed in the hope that it will be useful,         *
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of          *
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the            *
+ *   GNU General Public License for more details.                            *
+ *                                                                           *
+ *   You should have received a copy of the GNU General Public License       *
+ *   along with this program.  If not, see <http://www.gnu.org/licenses/>.   *
+ *****************************************************************************/
+/*!
+ * \file
+ * \ingroup ZeroEqModel
+ * \copydoc Dumux::EddyViscosityModels
+ */
+#ifndef DUMUX_EDDYVISCOSITY_MODELS_HH
+#define DUMUX_EDDYVISCOSITY_MODELS_HH
+
+namespace Dumux {
+
+/*!
+ * \ingroup ZeroEqModel
+ * \brief The available eddy viscosity models
+ *
+ * The following models are available:
+ *  -# Prandtl's mixing length, e.g. \cite Oertel2012a
+ *  -# Van-Driest modification, \cite vanDriest1956a and \cite Hanna1981a
+ *  -# Baldwin-Lomax, \cite Baldwin1978a
+ */
+class EddyViscosityModels
+{
+public:
+    static constexpr int none = 0;
+    static constexpr int prandtl = 1;
+    static constexpr int modifiedVanDriest = 2;
+    static constexpr int baldwinLomax = 3;
+};
+
+} // end namespace Dumux
+
+#endif
diff --git a/dumux/freeflow/ransnc/model.hh b/dumux/freeflow/ransnc/model.hh
index b14ea5dbe2..fe801d4c5a 100644
--- a/dumux/freeflow/ransnc/model.hh
+++ b/dumux/freeflow/ransnc/model.hh
@@ -42,8 +42,8 @@
  *    - q = 0
  * \f]
  *
- * The eddy diffusivity \$[ D_\text{t} \$] is related to the eddy viscosity by the turbulent
- * Schmidt number:
+ * The eddy diffusivity \f$ D_\text{t} \f$ is related to the eddy viscosity \f$ \nu_\text{t} \f$
+ * by the turbulent Schmidt number:
  * \f[ D_\text{t} = \frac{\nu_\text{t}}{\mathrm{Sc}_\text{t}} \f]
  *
  * So far, only the staggered grid spatial discretization (for structured grids) is available.
diff --git a/test/freeflow/ransnc/channeltestproblem.hh b/test/freeflow/ransnc/channeltestproblem.hh
index 469dc7c7de..5bcdf3c561 100644
--- a/test/freeflow/ransnc/channeltestproblem.hh
+++ b/test/freeflow/ransnc/channeltestproblem.hh
@@ -75,7 +75,11 @@ SET_BOOL_PROP(ChannelNCTestTypeTag, UseMoles, true);
 /*!
  * \ingroup RANSNCTests
  * \brief  Test problem for the one-phase model.
- * \todo doc me!
+ *
+ * Dry air is entering the channel, in 2-D a flat plate, from the left side.
+ * In the middle of the inlet, water vapor is injected, which spreads by turbulent diffusion.
+ * For the nonisothermal model the bottom has a constant temperature
+ * which is \f$ \unit[30]{K} \f$ higher than the initial and inlet temperature.
  */
 template <class TypeTag>
 class ChannelNCTestProblem : public ZeroEqProblem<TypeTag>
@@ -121,12 +125,6 @@ public:
     {
         inletVelocity_ = getParam<Scalar>("Problem.InletVelocity");
         FluidSystem::init();
-        deltaP_.resize(this->fvGridGeometry().numCellCenterDofs());
-
-        std::cout << " massBalanceIdx " << massBalanceIdx
-                  << " transportEqIdx " << transportEqIdx
-                  << " momentumBalanceIdx " << momentumBalanceIdx
-                  << std::endl;
     }
 
    /*!
@@ -174,7 +172,7 @@ public:
         BoundaryTypes values;
 
         values.setDirichlet(momentumBalanceIdx);
-        values.setOutflow(massBalanceIdx);
+        values.setOutflow(totalMassBalanceIdx);
         values.setOutflow(transportEqIdx);
 #if NONISOTHERMAL
         values.setOutflow(energyBalanceIdx);
@@ -217,8 +215,7 @@ public:
     }
 
    /*!
-     * \brief Evaluate the boundary conditions for a dirichlet
-     *        control volume.
+     * \brief Evaluate the boundary conditions for a Dirichlet control volume.
      *
      * \param globalPos The center of the finite volume which ought to be set.
      */
@@ -226,10 +223,18 @@ public:
     {
         PrimaryVariables values = initialAtPos(globalPos);
 
-        if(isInlet(globalPos) && globalPos[1] > 0.75 * this->fvGridGeometry().bBoxMax()[1])
+        if (isInlet(globalPos)
+            && globalPos[1] > 0.4 * this->fvGridGeometry().bBoxMax()[1]
+            && globalPos[1] < 0.6 * this->fvGridGeometry().bBoxMax()[1])
         {
             values[transportCompIdx] = 1e-3;
         }
+#if NONISOTHERMAL
+        if (isOnWall(globalPos))
+        {
+            values[temperatureIdx] += 30.;
+        }
+#endif
 
         return values;
     }
@@ -249,10 +254,10 @@ public:
     PrimaryVariables initialAtPos(const GlobalPosition &globalPos) const
     {
         PrimaryVariables values(0.0);
-        values[pressureIdx] = 1.1e+5;
+        values[pressureIdx] = 1.0e+5;
         values[transportCompIdx] = 0.0;
 #if NONISOTHERMAL
-        values[temperatureIdx] = 283.15;
+        values[temperatureIdx] = temperature();
 #endif
 
         // block velocity profile
@@ -264,33 +269,6 @@ public:
         return values;
     }
 
-   /*!
-     * \brief Adds additional VTK output data to the VTKWriter. Function is called by the output module on every write.
-     *
-     * \param gridVariables The grid variables
-     * \param sol The solution vector
-     */
-    void calculateDeltaP(const GridVariables& gridVariables, const SolutionVector& sol)
-    {
-        for (const auto& element : elements(this->fvGridGeometry().gridView()))
-        {
-            auto fvGeometry = localView(this->fvGridGeometry());
-            fvGeometry.bindElement(element);
-            for (auto&& scv : scvs(fvGeometry))
-            {
-                auto ccDofIdx = scv.dofIndex();
-
-                auto elemVolVars = localView(gridVariables.curGridVolVars());
-                elemVolVars.bind(element, fvGeometry, sol);
-
-                deltaP_[ccDofIdx] = elemVolVars[scv].pressure() - 1.1e5;
-            }
-        }
-    }
-
-    auto& getDeltaP() const
-    { return deltaP_; }
-
     // \}
 
     void setTimeLoop(TimeLoopPtr timeLoop)
@@ -328,7 +306,6 @@ private:
     const Scalar eps_;
     Scalar inletVelocity_;
     TimeLoopPtr timeLoop_;
-    std::vector<Scalar> deltaP_;
 };
 } //end namespace
 
diff --git a/test/freeflow/ransnc/test_channel_zeroeq.cc b/test/freeflow/ransnc/test_channel_zeroeq.cc
index eb7add37a4..425014507d 100644
--- a/test/freeflow/ransnc/test_channel_zeroeq.cc
+++ b/test/freeflow/ransnc/test_channel_zeroeq.cc
@@ -149,7 +149,6 @@ int main(int argc, char** argv) try
     using VtkOutputFields = typename GET_PROP_TYPE(TypeTag, VtkOutputFields);
     StaggeredVtkOutputModule<TypeTag> vtkWriter(*problem, *fvGridGeometry, *gridVariables, x, problem->name());
     VtkOutputFields::init(vtkWriter); //!< Add model specific output fields
-    vtkWriter.addField(problem->getDeltaP(), "deltaP");
     vtkWriter.write(0.0);
 
     // the assembler with time loop for instationary problem
@@ -180,8 +179,6 @@ int main(int argc, char** argv) try
         // advance to the time loop to the next step
         timeLoop->advanceTimeStep();
 
-        problem->calculateDeltaP(*gridVariables, x);
-
         // update wall properties
         problem->updateDynamicWallProperties(x);
 
-- 
GitLab