ExaDG
Loading...
Searching...
No Matches
viscosity_model_data.h
1/* ______________________________________________________________________
2 *
3 * ExaDG - High-Order Discontinuous Galerkin for the Exa-Scale
4 *
5 * Copyright (C) 2023 by the ExaDG authors
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 * ______________________________________________________________________
20 */
21
22#ifndef INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_USER_INTERFACE_VISCOSITY_MODEL_DATA_H_
23#define INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_USER_INTERFACE_VISCOSITY_MODEL_DATA_H_
24
25// ExaDG
26#include <exadg/utilities/print_functions.h>
27
28namespace ExaDG
29{
30namespace IncNS
31{
41enum class TurbulenceEddyViscosityModel
42{
43 Undefined,
44 Smagorinsky,
45 Vreman,
46 WALE,
47 Sigma
48};
49
51{
53 {
54 }
55
56 TurbulenceEddyViscosityModel turbulence_model{TurbulenceEddyViscosityModel::Undefined};
57 bool is_active{false};
58 double constant{0.0}; // model constant
59
60 void
61 check() const
62 {
63 AssertThrow(is_active, dealii::ExcMessage("Turbulence model is inactive."));
64 AssertThrow(constant > 1e-20, dealii::ExcMessage("Parameter must be greater than zero."));
65 }
66
67 void
68 print(dealii::ConditionalOStream const & pcout) const
69 {
70 pcout << std::endl << "Turbulence:" << std::endl;
71
72 print_parameter(pcout, "Use turbulence model", is_active);
73
74 if(is_active)
75 {
76 print_parameter(pcout, "Turbulence model", turbulence_model);
77 print_parameter(pcout, "Turbulence model constant", constant);
78 }
79 }
80};
81
85enum class GeneralizedNewtonianViscosityModel
86{
87 Undefined,
88 GeneralizedCarreauYasuda
89};
90
92{
94 {
95 }
96
97 GeneralizedNewtonianViscosityModel generalized_newtonian_model{
98 GeneralizedNewtonianViscosityModel::Undefined};
99 bool is_active{false};
100
101 // parameters of generalized Carreau-Yasuda model
102 double viscosity_margin{0.0};
103 double kappa{0.0};
104 double lambda{0.0};
105 double a{0.0};
106 double n{0.0};
107
108 void
109 check() const
110 {
111 AssertThrow(is_active, dealii::ExcMessage("Generalized Newtonian model is inactive."));
112 AssertThrow(generalized_newtonian_model != GeneralizedNewtonianViscosityModel::Undefined,
113 dealii::ExcMessage("GenerelizedNewtonianViscosityModel not defined."));
114 }
115
116 void
117 print(dealii::ConditionalOStream const & pcout) const
118 {
119 pcout << std::endl << "Rheology:" << std::endl;
120
121 print_parameter(pcout, "Use generalized Newtonian model", is_active);
122
123 if(is_active)
124 {
125 print_parameter(pcout, "Generalized Newtonian model", generalized_newtonian_model);
126 print_parameter(pcout, "viscosity margin", viscosity_margin);
127 print_parameter(pcout, "parameter kappa", kappa);
128 print_parameter(pcout, "parameter lambda", lambda);
129 print_parameter(pcout, "parameter a", a);
130 print_parameter(pcout, "parameter n", n);
131 }
132 }
133};
134
135} // namespace IncNS
136} // namespace ExaDG
137
138#endif /* INCLUDE_EXADG_INCOMPRESSIBLE_NAVIER_STOKES_USER_INTERFACE_VISCOSITY_MODEL_DATA_H_ */
Definition driver.cpp:33
Definition viscosity_model_data.h:92
Definition viscosity_model_data.h:51