7#include <deal.II/base/parameter_handler.h>
8#include <deal.II/base/parsed_function.h>
9#include <deal.II/base/patterns.h>
19 <<
"Heat transfer boundary id: " << arg1
20 <<
" has already been declared as a boundary condition");
27 ParameterHandler &prm,
28 const types::boundary_id default_boundary_id)
33 "Type of boundary condition for heat transfer.",
37 prm.declare_entry(
"id",
38 Utilities::to_string(default_boundary_id, 2),
39 Patterns::List(Patterns::Integer()),
40 "Mesh id for boundary conditions");
42 Functions::ParsedFunction<dim> temporary_function;
45 prm.enter_subsection(
"value");
46 temporary_function.declare_parameters(prm);
47 prm.leave_subsection();
50 prm.enter_subsection(
"h");
51 temporary_function.declare_parameters(prm);
52 prm.leave_subsection();
55 prm.enter_subsection(
"Tinf");
56 temporary_function.declare_parameters(prm);
57 prm.leave_subsection();
60 prm.enter_subsection(
"emissivity");
61 temporary_function.declare_parameters(prm);
62 prm.leave_subsection();
65 prm.enter_subsection(
"heat_flux");
66 temporary_function.declare_parameters(prm);
67 prm.leave_subsection();
74 "Mesh id for periodic face matching. Default entry is -1 to ensure that the periodic id is set by the user");
76 prm.declare_entry(
"periodic direction",
79 "Direction for periodic boundary condition");
85 ParameterHandler &prm,
88 prm.enter_subsection(
"boundary conditions heat transfer");
90 prm.declare_entry(
"number",
93 "Number of boundary conditions");
99 "Bool to define if the boundary condition is time-dependent");
103 prm.enter_subsection(
"bc " + std::to_string(n));
107 prm.leave_subsection();
109 prm.declare_entry(
"Stefan-Boltzmann constant",
112 "Stefan-Boltzmann constant");
114 prm.leave_subsection();
122 std::vector<types::boundary_id> boundary_ids =
127 boundary_ids.size() > 0,
129 "A boundary id has not been set for one of the heat transfer boundary conditions. Please ensure that the id is set for every boundary condition."));
133 for (
const auto boundary_id : boundary_ids)
135 AssertThrow(this->
type.find(boundary_id) == this->type.end(),
136 HeatTransferBoundaryDuplicated(boundary_id));
144 this->
type[boundary_id] = boundary_type;
154 types::boundary_id periodic_boundary_id =
155 prm.get_integer(
"periodic id");
159 this->
type[periodic_boundary_id] =
164 .neighbor_id = periodic_boundary_id,
165 .direction =
static_cast<unsigned int>(
166 prm.get_integer(
"periodic direction"))};
171 prm.enter_subsection(
"value");
173 std::make_shared<Functions::ParsedFunction<dim>>();
175 prm.leave_subsection();
176 prm.enter_subsection(
"h");
177 this->
h[boundary_id] =
178 std::make_shared<Functions::ParsedFunction<dim>>();
179 this->
h[boundary_id]->parse_parameters(prm);
180 prm.leave_subsection();
181 prm.enter_subsection(
"Tinf");
182 this->
Tinf[boundary_id] =
183 std::make_shared<Functions::ParsedFunction<dim>>();
184 this->
Tinf[boundary_id]->parse_parameters(prm);
185 prm.leave_subsection();
186 prm.enter_subsection(
"emissivity");
188 std::make_shared<Functions::ParsedFunction<dim>>();
189 this->
emissivity[boundary_id]->parse_parameters(prm);
190 prm.leave_subsection();
191 prm.enter_subsection(
"heat_flux");
193 std::make_shared<Functions::ParsedFunction<dim>>();
195 prm.leave_subsection();
203 prm.enter_subsection(
"boundary conditions heat transfer");
209 prm.enter_subsection(
"bc " + std::to_string(n));
213 prm.leave_subsection();
216 prm.get_double(
"Stefan-Boltzmann constant");
218 prm.leave_subsection();
Parameters::PeriodicBoundaries periodic_boundaries
std::map< types::boundary_id, HeatTransferBoundaryType > type
unsigned int number_of_boundary_conditions
This class manages the boundary conditions for Heat-Transfer solver It introduces the boundary functi...
std::map< types::boundary_id, std::shared_ptr< Functions::ParsedFunction< dim > > > heat_flux_bc
Heat-flux values for flux boundary conditions.
bool has_convection_radiation_bc
std::map< types::boundary_id, std::shared_ptr< Functions::ParsedFunction< dim > > > emissivity
Emissivity coefficients for radiation boundary conditions.
std::map< types::boundary_id, std::shared_ptr< Functions::ParsedFunction< dim > > > h
Convective heat transfer coefficients for Robin conditions.
void declare_parameters(ParameterHandler &prm, unsigned int number_of_boundary_conditions)
Declare the heat transfer boundary condition parameters.
void declare_default_entry(ParameterHandler &prm, types::boundary_id default_boundary_id)
Declare the default parameters for one heat transfer boundary condition.
void parse_parameters(ParameterHandler &prm)
Parse the heat transfer boundary condition parameters.
std::map< types::boundary_id, std::shared_ptr< Functions::ParsedFunction< dim > > > Tinf
Environment temperatures for Robin conditions.
void parse_boundary(ParameterHandler &prm)
Parse the information for one heat transfer boundary condition.
std::map< types::boundary_id, std::shared_ptr< Functions::ParsedFunction< dim > > > dirichlet_value
Temperature values for Dirichlet boundary conditions.
double Stefan_Boltzmann_constant
Stefan-Boltzmann constant used in radiation boundary conditions.
std::vector< T > convert_string_to_vector(const ParameterHandler &prm, const std::string &entry_string)
Return the vector of size N of entry @entry_string. If the entry is specified in the ....
EnumType string_to_enum(const std::string &name)
Return the enumerator whose identifier is name, e.g. to parse the value of a parameter entry into its...
void declare_enum_entry(ParameterHandler &prm, const std::string &entry_name, const EnumType default_value, const std::string &description, const DeprecatedEnumNames< EnumType > &deprecated_names={}, const std::vector< EnumType > &allowed_values={})
Declare a parameter entry whose value is an enumerator. The default value, the accepted values and th...
DeclException1(HeatTransferBoundaryDuplicated, types::boundary_id,<< "Heat transfer boundary id: "<< arg1<< " has already been declared as a boundary condition")
const std::vector< HeatTransferBoundaryType > heat_transfer_boundary_types
const DeprecatedEnumNames< HeatTransferBoundaryType > deprecated_heat_transfer_boundary_type_names