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, char, ideal_gas, stiffened_gas, noble_abel_stiffened_gas)
17
18
22 template <typename number>
23 struct EOSData
24 {
27 number stiffening_pressure = std::numeric_limits<number>::max();
28
32 number covolume = std::numeric_limits<number>::max();
33
37 number heat_bound = std::numeric_limits<number>::min();
38
44 void
45 add_parameters(dealii::ParameterHandler &prm);
46
54 void
55 post(const EquationOfState eos_type) const;
56 };
57
61 template <typename number>
63 {
65 number specific_isobaric_heat = 1000.0;
66
68 number dynamic_viscosity = 1. / 1600.;
69
72 number gamma = 1.4;
73
75 number specific_gas_constant = 287.1;
76
78 number thermal_conductivity = std::numeric_limits<number>::max();
79
82
84 number molar_mass = std::numeric_limits<number>::max();
85
86 // Name of the species (for output purposes)
87 std::string name = "species";
88
101 void
102 add_parameters(dealii::ParameterHandler &prm, const unsigned species_number);
103
104 private:
110 void
111 add_parameters(dealii::ParameterHandler &prm);
112 };
113
117 template <typename number>
119 {
123 constexpr static std::size_t n_max_species = 2;
124
128 constexpr static std::size_t n_max_diffusion_coefficients =
129 n_max_species * (n_max_species - 1) / 2;
130
132 EquationOfState eos_type = EquationOfState::ideal_gas;
133
135 unsigned int number_of_species = 1;
136
139 std::array<MaterialSpeciesData<number>, n_max_species> species_data;
140
142 number reference_density = 1.0;
143
145 number reference_dynamic_viscosity = 1. / 1600.;
146
153 number gamma;
157
165 number
166 get_diffusion_coefficient(const unsigned int i, const unsigned int j) const;
167
175 void
176 add_parameters(dealii::ParameterHandler &prm, const bool is_gas_phase);
177
183 void
184 post(const bool is_gas);
185
186 private:
190 {
191 unsigned int species_i = 1;
192 unsigned int species_j = 2;
194 };
195
199 std::array<SpeciesInteraction, n_max_diffusion_coefficients> species_interactions_input{};
200
207 std::array<number, n_max_diffusion_coefficients> species_interactions{};
208
216 std::size_t
217 get_species_interaction_index(const unsigned int i, const unsigned int j) const;
218 };
219} // 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 parameters related to the equation of state for a compressible or nearly incompressible...
Definition material.hpp:24
void post(const EquationOfState eos_type) const
Definition material.cpp:49
number stiffening_pressure
Definition material.hpp:27
number covolume
Definition material.hpp:32
void add_parameters(dealii::ParameterHandler &prm)
Add EOS-specific material parameters in the parameter handler.
Definition material.cpp:16
number heat_bound
Definition material.hpp:37
Collection of material parameters for a specific fluid phase.
Definition material.hpp:119
std::array< number, n_max_diffusion_coefficients > species_interactions
Definition material.hpp:207
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:277
std::array< MaterialSpeciesData< number >, n_max_species > species_data
Definition material.hpp:139
static constexpr std::size_t n_max_species
Definition material.hpp:123
number thermal_conductivity
Definition material.hpp:155
static constexpr std::size_t n_max_diffusion_coefficients
Definition material.hpp:128
EquationOfState eos_type
Type of equation of state.
Definition material.hpp:132
void add_parameters(dealii::ParameterHandler &prm, const bool is_gas_phase)
Add material parameters in the parameter handler.
Definition material.cpp:119
number gamma
Definition material.hpp:153
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:292
number specific_isobaric_heat
Definition material.hpp:151
EOSData< number > eos_data
Definition material.hpp:156
number dynamic_viscosity
Definition material.hpp:152
number specific_gas_constant
Definition material.hpp:154
unsigned int number_of_species
Number of different species in the fluid phase. For single-component simulations, set to 1.
Definition material.hpp:135
std::array< SpeciesInteraction, n_max_diffusion_coefficients > species_interactions_input
Definition material.hpp:199
number reference_dynamic_viscosity
Reference dynamic viscosity for interior penalty (SI: kg/(m s))
Definition material.hpp:145
void post(const bool is_gas)
Post-process material data parameters.
Definition material.cpp:190
number reference_density
Reference density for interior penalty (SI: kg/m3)
Definition material.hpp:142
Collection of material parameters for a specific species.
Definition material.hpp:63
number specific_isobaric_heat
Specific isobaric heat (SI: J/(kg K))
Definition material.hpp:65
std::string name
Definition material.hpp:87
number specific_gas_constant
Specific gas constant (SI: J/(kg K))
Definition material.hpp:75
number gamma
Definition material.hpp:72
EOSData< number > eos_data
Data for the equation of state.
Definition material.hpp:81
void add_parameters(dealii::ParameterHandler &prm, const unsigned species_number)
Definition material.cpp:67
number molar_mass
Molar mass of the species.
Definition material.hpp:84
number dynamic_viscosity
Dynamic viscosity (SI: kg/(m s))
Definition material.hpp:68
number thermal_conductivity
Thermal conductivity (SI: W/(m K))
Definition material.hpp:78