include/meltpooldg/compressible_flow/phase_coupling_data.hpp Source File

Developer Documentation: include/meltpooldg/compressible_flow/phase_coupling_data.hpp Source File
Developer Documentation
phase_coupling_data.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <deal.II/base/parameter_handler.h>
4
5#include <meltpooldg/utilities/better_enum.hpp>
7
8#include <string>
9
11{
12 BETTER_ENUM(InterfaceNumericalMethod, char, HLLP0_and_SIPG, HLLP0_and_penalty, penalty)
13
14 // TODO: use EvaporationData for evaporation-specific parameters
15 BETTER_ENUM(EvaporationModelType, char, constant, Knight)
16
17
21 template <typename number>
23 {
25 number m_dot_evap = 0.;
26
28 EvaporationModelType evaporation_model = EvaporationModelType::constant;
29
32 {
34 bool do_ramp = false;
35
37 number ramp_time = 0.;
38
42
44 InterfaceNumericalMethod type = InterfaceNumericalMethod::HLLP0_and_SIPG;
45
47 struct Penalty
48 {
50 {
52 number density = std::numeric_limits<number>::max();
53
55 number temperature = std::numeric_limits<number>::max();
57
59 {
61 // TODO: remove from input file, only temporary required for testing
62 number density_gas_phase = 0.;
63
65 // TODO: remove from input file, only temporary required for testing
68
70
80
90
96 void
97 add_parameters(dealii::ParameterHandler &prm)
98 {
99 prm.enter_subsection("compressible flow phase coupling");
100 {
101 prm.add_parameter(
102 "evaporation mass flux",
104 "Evaporation mass"
105 " flux at the phase interface. This parameter is only relevant if a given "
106 "mass flux is considered, i.e. no thermodynamical model (Hertz-Knudsen "
107 "theory) is applied.",
108 dealii::Patterns::Double());
109 prm.add_parameter("evaporation model",
111 "Model for the computation of the evaporation mass flux. "
112 "The options are \"constant\", \"knight\".",
113 dealii::Patterns::Selection("constant|Knight"));
114 prm.enter_subsection("laser heat source");
115 prm.add_parameter("do ramp",
117 "Apply initial ramp for laser heat source?",
118 dealii::Patterns::Bool());
119 prm.add_parameter("ramp time",
121 "Time for initial ramp of laser heat source [s].",
122 dealii::Patterns::Double(0., std::numeric_limits<number>::max()));
123 prm.add_parameter("laser power density",
125 "Laser power density [W/m²]",
126 dealii::Patterns::Double(0., std::numeric_limits<number>::max()));
127 prm.leave_subsection();
128 prm.add_parameter("type",
129 type,
130 "Numerical method for enforcing interface jump conditions. "
131 "The options are \"penalty\", \"HLLP0_and_SIPG\", \"HLLP0_and_penalty\".",
132 dealii::Patterns::Selection("penalty|HLLP0_and_SIPG|HLLP0_and_penalty"));
133 prm.enter_subsection("penalty");
134 prm.enter_subsection("coefficients");
135 prm.add_parameter(
136 "density",
138 "Density constraint penalty factor for enforcing the density in the gas phase. "
139 "The minimum value is 0.",
140 dealii::Patterns::Double(0., std::numeric_limits<number>::max()));
141 prm.add_parameter(
142 "temperature",
144 "Temperature constraint penalty factor for enforcing the temperature in the "
145 "gas phase. The minimum value is 0.",
146 dealii::Patterns::Double(0., std::numeric_limits<number>::max()));
147 prm.leave_subsection();
148 // TODO: In the case that the Hertz-Knudsen theory is considered, no target values should be
149 // set in the user input
150 prm.enter_subsection("target values");
151 prm.add_parameter("density gas phase",
153 "Target density of gas phase.",
154 dealii::Patterns::Double(0., std::numeric_limits<number>::max()));
155 prm.add_parameter("temperature gas phase",
157 "Target temperature of gas phase.",
158 dealii::Patterns::Double(0., std::numeric_limits<number>::max()));
159 prm.leave_subsection();
160 prm.leave_subsection();
161 prm.enter_subsection("HLLP0 and SIPG");
162 prm.add_parameter(
163 "interior penalty parameter interface",
165 "Symmetric interior penalty parameter for the interface term. A good first "
166 "guess is O(1/cell_size). Increase the parameter in the case of instabilities at the "
167 "interface. The minimum value is 0.",
168 dealii::Patterns::Double(0., std::numeric_limits<number>::max()));
169 prm.add_parameter("delta T",
171 "Temperature jump at the interface.",
172 dealii::Patterns::Double());
173 prm.leave_subsection();
174 prm.enter_subsection("HLLP0 and penalty");
175 prm.add_parameter("penalty parameter temperature jump",
177 "Penalty parameter for the temperature jump constraint.",
178 dealii::Patterns::Double(0., std::numeric_limits<number>::max()));
179 prm.add_parameter("delta T",
181 "Temperature jump at the interface.",
182 dealii::Patterns::Double());
183 prm.leave_subsection();
184 }
185 prm.leave_subsection();
186 };
187
191 void
193 {
194 if (type == InterfaceNumericalMethod::penalty)
195 {
196 AssertThrow(penalty.coefficients.density != std::numeric_limits<number>::max(),
197 dealii::ExcMessage(
198 "You have to set the density constraint penalty factor for penalty "
199 "method."));
200 AssertThrow(penalty.coefficients.temperature != std::numeric_limits<number>::max(),
201 dealii::ExcMessage(
202 "You have to set the temperature constraint penalty factor for penalty "
203 "method."));
204 }
205
206 if (evaporation_model == EvaporationModelType::Knight)
207 AssertThrow(type == InterfaceNumericalMethod::HLLP0_and_penalty,
208 dealii::ExcMessage(
209 "Knight's evaporation model is currently only supported for the "
210 "interface numerical method 'HLLP0_and_penalty'."));
211 };
212 };
213} // namespace MeltPoolDG::Multiphase
A collection of functions for the computation of the interface terms for compressible two-phase flows...
Definition multiphase_interface_kernels.hpp:31
constant
Definition material_data.hpp:55
BETTER_ENUM(MaterialTemplate, char, none, stainless_steel, Ti64, Ti64Benchmark) BETTER_ENUM(SolidLiquidPropertiesTransitionType
Parameters specifically for the HLLP0 and SIPG interface numerical method.
Definition phase_coupling_data.hpp:73
number interior_penalty_parameter_interface
Symmetric interior penalty parameter for the viscous interface term.
Definition phase_coupling_data.hpp:75
number delta_T
Temperature jump (T_liquid - T_gas)
Definition phase_coupling_data.hpp:78
Parameters specifically for the HLLP0 and penalty interface numerical method.
Definition phase_coupling_data.hpp:83
number penalty_parameter_temperature_jump
Penalty parameter for temperature jump constraint.
Definition phase_coupling_data.hpp:85
number delta_T
Temperature jump (T_liquid - T_gas)
Definition phase_coupling_data.hpp:88
Parameters for the laser heat source.
Definition phase_coupling_data.hpp:32
number ramp_time
Time for initial ramp of laser heat source (SI: s)
Definition phase_coupling_data.hpp:37
bool do_ramp
Apply initial ramp function for laser heat source?
Definition phase_coupling_data.hpp:34
number laser_power_density
Laser power density (SI: W/m^2)
Definition phase_coupling_data.hpp:40
number temperature
Temperature constraint penalty factor.
Definition phase_coupling_data.hpp:55
number density
Density constraint penalty factor.
Definition phase_coupling_data.hpp:52
number temperature_gas_phase
Target values for temperature for gas phase.
Definition phase_coupling_data.hpp:66
number density_gas_phase
Target values for density for gas phase.
Definition phase_coupling_data.hpp:62
Parameters specifically for the penalty interface numerical method.
Definition phase_coupling_data.hpp:48
struct MeltPoolDG::Multiphase::CompressibleFlowPhaseCouplingData::Penalty::TargetValues target_values
struct MeltPoolDG::Multiphase::CompressibleFlowPhaseCouplingData::Penalty::Coefficients coefficients
Data structure, which contains parameters specifically for the phase coupling of compressible multiph...
Definition phase_coupling_data.hpp:23
number m_dot_evap
Evaporation mass flux (relevant for EvaporationModelType = "constant") (SI: kg/(m^2 s))
Definition phase_coupling_data.hpp:25
struct MeltPoolDG::Multiphase::CompressibleFlowPhaseCouplingData::Penalty penalty
struct MeltPoolDG::Multiphase::CompressibleFlowPhaseCouplingData::HLLP0_penalty hllp0_and_penalty
struct MeltPoolDG::Multiphase::CompressibleFlowPhaseCouplingData::HLLP0_SIPG hllp0_and_sipg
struct MeltPoolDG::Multiphase::CompressibleFlowPhaseCouplingData::LaserHeatSource laser_heat_source
InterfaceNumericalMethod type
Numerical method for interface jump enforcement.
Definition phase_coupling_data.hpp:44
void post()
Checks compressible flow phase coupling parameters after reading user input.
Definition phase_coupling_data.hpp:192
EvaporationModelType evaporation_model
Evaporation model (Currently available: "constant" or "Knight")
Definition phase_coupling_data.hpp:28
void add_parameters(dealii::ParameterHandler &prm)
Add compressible flow phase coupling parameters in the parameter handler.
Definition phase_coupling_data.hpp:97