include/meltpooldg/compressible_flow/operation_data.hpp Source File

Developer Documentation: include/meltpooldg/compressible_flow/operation_data.hpp Source File
Developer Documentation
operation_data.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <deal.II/base/parameter_handler.h>
4
9#include <meltpooldg/utilities/better_enum.hpp>
12
13#include <string>
14#include <vector>
15
17{
18 BETTER_ENUM(NumericalFluxType,
19 char,
20 lax_friedrichs_modified,
21 lax_friedrichs_exact,
22 harten_lax_vanleer)
23
24 BETTER_ENUM(LinearizedConvectiveFluxJumpType, char, analytic, lambda_fd, complete_fd);
25
26 BETTER_ENUM(JacobianType, char, exact, finite_difference);
27
28 BETTER_ENUM(OutputType, char, conserved_variables, primitive_variables, material_quantities);
29
33 template <typename number>
35 {
38
40 TimeIntegration::TimeIntegratorData<number> time_integrator;
41
43 NumericalFluxType numerical_flux_type = NumericalFluxType::lax_friedrichs_modified;
44
48 LinearizedConvectiveFluxJumpType linearization_jump_convective_flux =
49 LinearizedConvectiveFluxJumpType::complete_fd;
50
52 JacobianType jacobian_type = JacobianType::exact;
53
55 number courant_number = 0.15;
56
58 number viscous_courant_number = 1.0;
59
61 bool do_cfl_time_stepping = false;
62
64 number gravity_constant = 0.0;
65
67 std::string domain_representation_type = "fitted";
68
70 int verbosity_level = -1;
71
73
75 std::vector<OutputType> output_variables = {OutputType::conserved_variables};
76
82 void
83 add_parameters(dealii::ParameterHandler &prm)
84 {
85 prm.enter_subsection("compressible navier stokes");
86 {
87 fe.add_parameters(prm);
88 time_integrator.add_parameters(prm);
89 prm.add_parameter(
90 "linearization jump convective flux",
91 linearization_jump_convective_flux,
92 "Calculation method of the linearized jump operator in the convective "
93 "numerical flux (required for implicit time stepping). The options are \"analytic\","
94 " \"complete_fd\" and \"lambda_fd\".");
95 prm.add_parameter("numerical flux type",
96 numerical_flux_type,
97 "Type of the numerical flux.");
98 prm.add_parameter("courant number",
99 courant_number,
100 "Courant number for convective time-step limit.");
101 prm.add_parameter("viscous courant number",
102 viscous_courant_number,
103 "Characteristic Courant-like number for viscous time-step limit.");
104
105 prm.add_parameter("jacobian type",
106 jacobian_type,
107 "Type of the jacobian. Choose between 'exact' and 'finite_difference'.");
108 prm.add_parameter(
109 "use cfl criteria",
110 do_cfl_time_stepping,
111 "If set to true, the CFL time step size criteria is used to determine the time step"
112 " size in each iteration.");
113 prm.add_parameter("gravity constant", gravity_constant, "Gravity constant.");
114 prm.add_parameter("domain representation type",
115 domain_representation_type,
116 "Domain representation type. Choose between 'fitted' and 'cut'.",
117 dealii::Patterns::Selection("fitted|cut"));
118 prm.add_parameter("verbosity level", verbosity_level, "Verbosity level for output.");
119 limiter_data.add_parameters(prm);
120 }
121 prm.leave_subsection();
122
123 prm.enter_subsection("output");
124 {
125 prm.enter_subsection("paraview");
126 {
127 prm.add_parameter("compressible output types",
128 output_variables,
129 "Type of the variables added to the output.");
130 }
131 prm.leave_subsection();
132 }
133 prm.leave_subsection();
134 }
135
142 void
143 post(const FiniteElementData &base_fe_data, const unsigned int base_verbosity_level)
144 {
145 fe.post(base_fe_data);
146 AssertThrow(fe.type == FiniteElementType::FE_DGQ,
147 dealii::ExcMessage(
148 "The compressible flow solver only supports elements of type 'FE_DGQ'."));
149
150 // set default time integration scheme for cut
151 if (domain_representation_type == "cut")
152 {
153 if (time_integrator.integrator_type ==
154 TimeIntegration::TimeIntegratorSchemes::not_initialized)
155 time_integrator.integrator_type =
156 TimeIntegration::TimeIntegratorSchemes::explicit_euler;
157 AssertThrow(
158 time_integrator.integrator_type ==
159 TimeIntegration::TimeIntegratorSchemes::explicit_euler,
160 dealii::ExcMessage(
161 "The cut compressible flow solver only supports explicit Euler time integration."));
162 }
163
164 // Synchronize verbosity with base verbosity if not set explicitly.
165 if (verbosity_level < 0)
166 verbosity_level = base_verbosity_level;
167 }
168 };
169
174 template <typename number>
176 {
180 std::string unfitted_flow_boundary_condition = "no_slip_wall";
181
184
190 void
191 add_parameters(dealii::ParameterHandler &prm)
192 {
193 prm.enter_subsection("cut");
194 {
195 prm.add_parameter("unfitted flow boundary condition",
197 "Flow boundary condition type at the unfitted boundary. "
198 "Choose between 'no_slip_wall' and 'inflow'.");
199 stabilization.add_parameters(prm);
200 }
201 prm.leave_subsection();
202 }
203 };
204} // namespace MeltPoolDG::CompressibleFlow
This file contains various functions that can be used to set and evaluate boundary conditions for the...
Definition boundary_condition_functions.hpp:17
analytic
Definition operation_data.hpp:24
lambda_fd
Definition operation_data.hpp:24
complete_fd
Definition operation_data.hpp:24
BETTER_ENUM(RampUpType, char, none, linear, exponential, cosine)
Enum for the type of ramp up function used for the velocity at an inflow boundary.
Collection of cut-related solver parameters required by the cut single-phase and multiphase compressi...
Definition operation_data.hpp:176
CutStabilizationData< number > stabilization
cut-related stabilization parameters
Definition operation_data.hpp:183
std::string unfitted_flow_boundary_condition
Definition operation_data.hpp:180
void add_parameters(dealii::ParameterHandler &prm)
Add cut parameters in the parameter handler.
Definition operation_data.hpp:191
Collection of parameters required by the compressible Navier-Stokes operator.
Definition operation_data.hpp:35
TimeIntegration::TimeIntegratorData< number > time_integrator
Time integration data.
Definition operation_data.hpp:40
void add_parameters(dealii::ParameterHandler &prm)
Add compressible flow parameters in the parameter handler.
Definition operation_data.hpp:83
Utilities::LimiterData< number > limiter_data
Definition operation_data.hpp:72
FiniteElementData fe
Finite element data.
Definition operation_data.hpp:37
void post(const FiniteElementData &base_fe_data, const unsigned int base_verbosity_level)
Finalizes, adjusts and checks compressible flow parameters after reading user input.
Definition operation_data.hpp:143
Collection of parameters for the stabilization of cutFEM and cutDG applications.
Definition cut_data.hpp:48
Definition finite_element_data.hpp:12
void add_parameters(dealii::ParameterHandler &prm)
Definition finite_element_data.cpp:8
void post(const FiniteElementData &base_fe_data)
Definition finite_element_data.cpp:30
FiniteElementType type
Definition finite_element_data.hpp:13
Definition limiters.hpp:32
void add_parameters(dealii::ParameterHandler &prm)
Definition limiters.templates.hpp:28