ExaDG
Loading...
Searching...
No Matches
parameters.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 EXADG_AERO_ACOUSTIC_USER_INTERFACE_INPUT_PARAMETERS_H_
23#define EXADG_AERO_ACOUSTIC_USER_INTERFACE_INPUT_PARAMETERS_H_
24
25// deal.II
26#include <deal.II/base/conditional_ostream.h>
27#include <deal.II/base/parameter_handler.h>
28
29namespace ExaDG
30{
31namespace AeroAcoustic
32{
33enum class FluidToAcousticCouplingStrategy
34{
35 Undefined,
36 ConservativeInterpolation
37};
38
40{
41public:
43 : density(-1.0),
44 source_term_with_convection(false),
45 blend_in_source_term(false),
46 fluid_to_acoustic_coupling_strategy(FluidToAcousticCouplingStrategy::Undefined)
47 {
48 }
49
50 void
51 check() const
52 {
53 AssertThrow(density >= 0.0, dealii::ExcMessage("Density has to be set."));
54
55 AssertThrow(fluid_to_acoustic_coupling_strategy != FluidToAcousticCouplingStrategy::Undefined,
56 dealii::ExcMessage("Coupling strategy has to be set."));
57 }
58
59 void
60 print(dealii::ConditionalOStream const & pcout, std::string const & name) const
61 {
62 pcout << std::endl << name << std::endl << std::endl;
63 print_parameter(pcout, "Density", density);
64 print_parameter(pcout, "Source term has convective part", source_term_with_convection);
65 print_parameter(pcout, "Blend in source term", blend_in_source_term);
66 print_parameter(pcout, "Fluid to acoustic coupling", fluid_to_acoustic_coupling_strategy);
67 }
68
69 void
70 add_parameters(dealii::ParameterHandler & prm, std::string const & subsection_name)
71 {
72 prm.enter_subsection(subsection_name);
73 {
74 prm.add_parameter(
75 "Density", density, "Mean density of underlying fluid.", dealii::Patterns::Double(), true);
76
77 prm.add_parameter("SourceTermWithConvection",
78 source_term_with_convection,
79 "Source term includes convective part.",
80 dealii::Patterns::Bool(),
81 true);
82
83 prm.add_parameter("BlendInSourceTerm",
84 blend_in_source_term,
85 "Blend in the aeroacoustic source term.",
86 dealii::Patterns::Bool(),
87 true);
88
89 prm.add_parameter("FluidToAcousticCouplingStrategy",
90 fluid_to_acoustic_coupling_strategy,
91 "Volume coupling strategy from the fluid to the acoustic field.",
92 Patterns::Enum<FluidToAcousticCouplingStrategy>(),
93 true);
94 }
95 prm.leave_subsection();
96 }
97
98 // mean density of underlying fluid
99 double density;
100
101 // The aero-acoustic source term is the material derivative of the
102 // pressure. Sometimes, it is sufficient to neglect the convective
103 // part of the material derivative.
104 bool source_term_with_convection;
105
106 // Blend in aero-acoustic source terms in time or space?
107 bool blend_in_source_term;
108
109 // Strategy to couple from fluid to acoustic
110 FluidToAcousticCouplingStrategy fluid_to_acoustic_coupling_strategy;
111};
112
113} // namespace AeroAcoustic
114} // namespace ExaDG
115
116#endif /* EXADG_AERO_ACOUSTIC_USER_INTERFACE_INPUT_PARAMETERS_H_ */
Definition parameters.h:40
Definition driver.cpp:33