include/meltpooldg/compressible_flow/material.hpp Source File

Developer Documentation: include/meltpooldg/compressible_flow/material.hpp Source File
Developer Documentation
material.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <deal.II/base/parameter_handler.h>
4
6
7#include <array>
8#include <cstddef>
9#include <limits>
10#include <memory>
11
13{
16 BETTER_ENUM(EquationOfState,
17 char,
18 ideal_gas,
19 stiffened_gas,
20 noble_abel_stiffened_gas,
21 weakly_compressible)
22
23
27 template <typename number>
28 struct EOSData
29 {
32 number stiffening_pressure = std::numeric_limits<number>::max();
33
37 number covolume = std::numeric_limits<number>::max();
38
42 number heat_bound = std::numeric_limits<number>::min();
43
45 struct WeaklyCompressibleSpecificData
46 {
48 number reference_state_pressure = std::numeric_limits<number>::max();
49
51 number reference_state_density = std::numeric_limits<number>::max();
52
54 number reference_state_sound_speed = std::numeric_limits<number>::max();
55 } weakly_compressible;
56
62 void
63 add_parameters(dealii::ParameterHandler &prm);
64
72 void
73 post(const EquationOfState eos_type) const;
74 };
75
79 template <typename number>
81 {
83 number specific_isobaric_heat = 1000.0;
84
86 number specific_isochoric_heat = 1000.0;
87
89 number dynamic_viscosity = 1. / 1600.;
90
93 number gamma = 1.4;
94
96 number specific_gas_constant = 287.1;
97
99 number thermal_conductivity = std::numeric_limits<number>::max();
100
102 EOSData<number> eos_data;
103
105 number molar_mass = std::numeric_limits<number>::max();
106
107 // Name of the species (for output purposes)
108 std::string name = "species";
109
122 void
123 add_parameters(dealii::ParameterHandler &prm, const unsigned species_number);
124
125 private:
131 void
132 add_parameters(dealii::ParameterHandler &prm);
133 };
134
138 template <typename number>
140 {
144 constexpr static std::size_t n_max_species = 2;
145
149 constexpr static std::size_t n_max_diffusion_coefficients =
150 n_max_species * (n_max_species - 1) / 2;
151
153 EquationOfState eos_type = EquationOfState::ideal_gas;
154
156 unsigned int number_of_species = 1;
157
160 std::array<MaterialSpeciesData<number>, n_max_species> species_data;
161
163 number reference_density = 1.0;
164
166 number reference_dynamic_viscosity = 1. / 1600.;
167
175 number gamma;
178 EOSData<number> eos_data;
179
187 number
188 get_diffusion_coefficient(const unsigned int i, const unsigned int j) const;
189
197 void
198 add_parameters(dealii::ParameterHandler &prm, const bool is_gas_phase);
199
205 void
206 post(const bool is_gas);
207
208 private:
212 {
213 unsigned int species_i = 1;
214 unsigned int species_j = 2;
216 };
217
221 std::array<SpeciesInteraction, n_max_diffusion_coefficients> species_interactions_input{};
222
229 std::array<number, n_max_diffusion_coefficients> species_interactions{};
230
238 std::size_t
239 get_species_interaction_index(const unsigned int i, const unsigned int j) const;
240 };
241} // 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
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 material parameters for a specific fluid phase.
Definition material.hpp:140
std::array< number, n_max_diffusion_coefficients > species_interactions
Definition material.hpp:229
std::size_t get_species_interaction_index(const unsigned int i, const unsigned int j) const
Get the index of the diffusion coefficient for the interaction between species i and j.
Definition material.cpp:312
std::array< MaterialSpeciesData< number >, n_max_species > species_data
Definition material.hpp:160
static constexpr std::size_t n_max_species
Definition material.hpp:144
number thermal_conductivity
Definition material.hpp:177
static constexpr std::size_t n_max_diffusion_coefficients
Definition material.hpp:149
EquationOfState eos_type
Type of equation of state.
Definition material.hpp:153
void add_parameters(dealii::ParameterHandler &prm, const bool is_gas_phase)
Add material parameters in the parameter handler.
Definition material.cpp:151
number gamma
Definition material.hpp:175
number specific_isochoric_heat
Definition material.hpp:173
number get_diffusion_coefficient(const unsigned int i, const unsigned int j) const
Get the diffusion coefficient for the interaction between species i and j.
Definition material.cpp:327
number specific_isobaric_heat
Definition material.hpp:172
EOSData< number > eos_data
Definition material.hpp:178
number dynamic_viscosity
Definition material.hpp:174
number specific_gas_constant
Definition material.hpp:176
unsigned int number_of_species
Number of different species in the fluid phase. For single-component simulations, set to 1.
Definition material.hpp:156
std::array< SpeciesInteraction, n_max_diffusion_coefficients > species_interactions_input
Definition material.hpp:221
number reference_dynamic_viscosity
Reference dynamic viscosity for interior penalty (SI: kg/(m s))
Definition material.hpp:166
void post(const bool is_gas)
Post-process material data parameters.
Definition material.cpp:223
number reference_density
Reference density for interior penalty (SI: kg/m3)
Definition material.hpp:163
Collection of material parameters for a specific species.
Definition material.hpp:81
number specific_isobaric_heat
Specific isobaric heat (SI: J/(kg K))
Definition material.hpp:83
std::string name
Definition material.hpp:108
number specific_gas_constant
Specific gas constant (SI: J/(kg K))
Definition material.hpp:96
number gamma
Definition material.hpp:93
EOSData< number > eos_data
Data for the equation of state.
Definition material.hpp:102
void add_parameters(dealii::ParameterHandler &prm, const unsigned species_number)
Definition material.cpp:95
number molar_mass
Molar mass of the species.
Definition material.hpp:105
number dynamic_viscosity
Dynamic viscosity (SI: kg/(m s))
Definition material.hpp:89
number specific_isochoric_heat
Specific isochoric heat (SI: J/(kg K))
Definition material.hpp:86
number thermal_conductivity
Thermal conductivity (SI: W/(m K))
Definition material.hpp:99