version 3.8
turbulencemodel.hh
Go to the documentation of this file.
1// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2// vi: set et ts=4 sw=4 sts=4:
3//
4// SPDX-FileCopyrightInfo: Copyright © DuMux Project contributors, see AUTHORS.md in root folder
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
12#ifndef DUMUX_FREEFLOW_TURBLENCEMODEL_HH
13#define DUMUX_FREEFLOW_TURBLENCEMODEL_HH
14
15#include <string>
17
18namespace Dumux {
19
25 enum class TurbulenceModel
26 {
28 };
29
30 constexpr unsigned int numTurbulenceEq(TurbulenceModel model)
31 {
32 if (model == TurbulenceModel::none || model == TurbulenceModel::zeroeq)
33 return 0;
34 else if (model == TurbulenceModel::oneeq)
35 return 1;
36 else
37 return 2;
38 }
39
43 std::string turbulenceModelToString(TurbulenceModel turbulenceModel)
44 {
45 switch (turbulenceModel)
46 {
47 case TurbulenceModel::none: return "No_TurbModel";
48 case TurbulenceModel::zeroeq: return "ZeroEq";
49 case TurbulenceModel::oneeq: return "OneEq";
50 case TurbulenceModel::kepsilon: return "KEpsilon";
51 case TurbulenceModel::lowrekepsilon: return "LowReKEpsilon";
52 case TurbulenceModel::komega: return "KOmega";
53 case TurbulenceModel::sst: return "KOmegaSST";
54 default: return "Invalid"; // should never be reached
55 }
56 }
57
62 enum class SSTModel
63 { BSL, SST };
64
68 std::string sstModelToString(SSTModel sstModel)
69 {
70 switch (sstModel)
71 {
72 case SSTModel::BSL: return "BSL";
73 case SSTModel::SST: return "SST";
74 default: return "Invalid";
75 }
76 }
77
82 SSTModel sstModelFromString(const std::string& sstModel)
83 {
84 if (sstModel == "BSL") return SSTModel::BSL;
85 if (sstModel == "SST") return SSTModel::SST;
86 DUNE_THROW(ParameterException, "\nThis SST Model approach : \"" << sstModel << "\" is not implemented.\n"
87 << "The available SST models are as follows: \n"
88 << sstModelToString(SSTModel::BSL) << ": The Baseline SST Model n\n"
89 << sstModelToString(SSTModel::SST) << ": The full standard SST Model");
90 }
91
92} // end namespace Dumux
93
94#endif
Exception thrown if a run-time parameter is not specified correctly.
Definition: exceptions.hh:48
Some exceptions thrown in DuMux
TurbulenceModel
The available free flow turbulence models in Dumux.
Definition: turbulencemodel.hh:26
SSTModel
The available variations of the SST Turbulence Model.
Definition: turbulencemodel.hh:63
Definition: adapt.hh:17
std::string turbulenceModelToString(TurbulenceModel turbulenceModel)
return the name of the Turbulence Model
Definition: turbulencemodel.hh:43
std::string sstModelToString(SSTModel sstModel)
return the name of the sst Model as a string
Definition: turbulencemodel.hh:68
constexpr unsigned int numTurbulenceEq(TurbulenceModel model)
Definition: turbulencemodel.hh:30
SSTModel sstModelFromString(const std::string &sstModel)
Convenience function to convert user input given as std::string to the corresponding enum class used ...
Definition: turbulencemodel.hh:82