From 2c0a10ff9e966e4cb733011ec2c249fc3eab5934 Mon Sep 17 00:00:00 2001 From: Kilian Weishaupt <kilian.weishaupt@iws.uni-stuttgart.de> Date: Tue, 4 Sep 2018 08:49:44 +0200 Subject: [PATCH] [freeflow] Add TurbulenceModel enum --- dumux/freeflow/navierstokes/model.hh | 4 +++ dumux/freeflow/properties.hh | 1 + dumux/freeflow/turbulencemodel.hh | 51 ++++++++++++++++++++++++++++ 3 files changed, 56 insertions(+) create mode 100644 dumux/freeflow/turbulencemodel.hh diff --git a/dumux/freeflow/navierstokes/model.hh b/dumux/freeflow/navierstokes/model.hh index a8d9866d33..de9d04b601 100644 --- a/dumux/freeflow/navierstokes/model.hh +++ b/dumux/freeflow/navierstokes/model.hh @@ -101,6 +101,10 @@ struct NavierStokesModelTraits //! The model does not include a turbulence model static constexpr bool usesTurbulenceModel() { return false; } + //! return the type of turbulence model used + static constexpr auto turbulenceModel() + { return TurbulenceModel::none; } + //! the indices using Indices = NavierStokesIndices<dim()>; }; diff --git a/dumux/freeflow/properties.hh b/dumux/freeflow/properties.hh index 0b4e738105..4e45920c1c 100644 --- a/dumux/freeflow/properties.hh +++ b/dumux/freeflow/properties.hh @@ -28,6 +28,7 @@ #include <dumux/common/properties.hh> #include <dumux/common/properties/model.hh> #include <dumux/flux/fourierslaw.hh> +#include "turbulencemodel.hh" namespace Dumux { namespace Properties { diff --git a/dumux/freeflow/turbulencemodel.hh b/dumux/freeflow/turbulencemodel.hh new file mode 100644 index 0000000000..0a39d9e03e --- /dev/null +++ b/dumux/freeflow/turbulencemodel.hh @@ -0,0 +1,51 @@ +// -*- 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 FreeflowModels + * \brief The available free flow turbulence models in Dumux + */ +#ifndef DUMUX_FREEFLOW_TURBLENCEMODEL_HH +#define DUMUX_FREEFLOW_TURBLENCEMODEL_HH + +namespace Dumux { + + /*! + * \brief The available free flow turbulence models in Dumux + * \ingroup FreeflowModels + * \note Use none for plain (Navier-) Stokes models (DNS) + */ + enum class TurbulenceModel + { + none, zeroeq, oneeq, kepsilon, lowrekepsilon, komega + }; + + constexpr unsigned int numTurbulenceEq(TurbulenceModel model) + { + if (model == TurbulenceModel::none || model == TurbulenceModel::zeroeq) + return 0; + else if (model == TurbulenceModel::oneeq) + return 1; + else + return 2; + } + +} // end namespace Dumux + +#endif -- GitLab