From d2f582e980e4f032d3822f82ec08c922c46960cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dennis=20Gl=C3=A4ser?= <dennis.glaeser@iws.uni-stuttgart.de> Date: Fri, 6 Apr 2018 09:54:23 +0200 Subject: [PATCH] [DimLessNums] pull out Nusselt and sherwood formulation and turn into enum class This removes their dependency on Scalar --- dumux/common/dimensionlessnumbers.hh | 43 ++++++++++++++-------------- 1 file changed, 21 insertions(+), 22 deletions(-) diff --git a/dumux/common/dimensionlessnumbers.hh b/dumux/common/dimensionlessnumbers.hh index 8efc0366da..6dfec8855b 100644 --- a/dumux/common/dimensionlessnumbers.hh +++ b/dumux/common/dimensionlessnumbers.hh @@ -28,11 +28,30 @@ #define DIMENSIONLESS_NUMBERS_HH #include <cmath> +#include <iostream> #include <dune/common/exceptions.hh> namespace Dumux { +/*! + * \brief A container for possible values of the property for selecting which nusselt parametrization to choose. + * The actual value is set vie the property NusseltFormulation + */ +enum class NusseltFormulation +{ + dittusBoelter, WakaoKaguei, VDI +}; + +/*! + * \brief A container for possible values of the property for selecting which sherwood parametrization to choose. + * The actual value is set vie the property SherwoodFormulation + */ +enum class SherwoodFormulation +{ + WakaoKaguei +}; + /*! * \brief Collection of functions which calculate dimensionless numbers. * \ingroup Common @@ -102,17 +121,6 @@ static Scalar prandtlNumber(const Scalar dynamicViscosity, return dynamicViscosity * heatCapacity / thermalConductivity; } -/*! - * \brief A container for possible values of the property for selecting which nusselt parametrization to choose. - * The actual value is set vie the property NusseltFormulation - */ -struct NusseltFormulation -{ - static const int dittusBoelter = 0; - static const int WakaoKaguei = 1; - static const int VDI = 2; -}; - /*! * \brief Calculate the Nusselt Number [-] (Nu). * @@ -142,7 +150,7 @@ struct NusseltFormulation static Scalar nusseltNumberForced(const Scalar reynoldsNumber, const Scalar prandtlNumber, const Scalar porosity, - const int formulation ) + NusseltFormulation formulation) { if (formulation == NusseltFormulation::dittusBoelter){ /* example: very common and simple case: flow straight circular pipe, only convection (no boiling), @@ -218,15 +226,6 @@ static Scalar schmidtNumber(const Scalar dynamicViscosity, return dynamicViscosity / (massDensity * diffusionCoefficient); } -/*! - * \brief A container for possible values of the property for selecting which sherwood parametrization to choose. - * The actual value is set vie the property SherwoodFormulation - */ -struct SherwoodFormulation -{ - static const int WakaoKaguei = 0; -}; - /*! * \brief Calculate the Sherwood Number [-] (Sh). * @@ -258,7 +257,7 @@ struct SherwoodFormulation static Scalar sherwoodNumber(const Scalar reynoldsNumber, const Scalar schmidtNumber, - const int formulation) + SherwoodFormulation formulation) { if (formulation == SherwoodFormulation::WakaoKaguei){ /* example: flow through porous medium *single phase* -- GitLab