11 #include "MathUtils.h"
13 #include "libmesh/quadrature.h"
23 params.addParam<Real>(
24 "stefan_boltzmann_constant",
26 "The Stefan-Boltzmann constant. Default value is in units of [W / m^2 K^4].");
27 params.addRequiredCoupledVar(
"temperature",
"The coupled temperature variable.");
28 params.addRequiredParam<std::vector<Real>>(
"emissivity",
"Emissivities for each boundary.");
29 params.addParam<std::vector<BoundaryName>>(
30 "fixed_temperature_boundary",
31 "The list of boundary IDs from the mesh with fixed temperatures.");
32 params.addParam<std::vector<FunctionName>>(
"fixed_boundary_temperatures",
33 "The temperatures of the fixed boundary.");
34 params.addParam<std::vector<BoundaryName>>(
35 "adiabatic_boundary",
"The list of boundary IDs from the mesh that are adiabatic.");
37 params.addClassDescription(
38 "This object implements the exchange of heat by radiation between sidesets.");
43 : SideUserObject(parameters),
44 _sigma_stefan_boltzmann(getParam<Real>(
"stefan_boltzmann_constant")),
45 _n_sides(boundaryIDs().size()),
46 _temperature(coupledValue(
"temperature")),
47 _emissivity(getParam<std::vector<Real>>(
"emissivity")),
49 _heat_flux_density(_n_sides),
50 _side_temperature(_n_sides),
54 _surface_irradiation(_n_sides)
59 std::vector<BoundaryName> boundary_names = getParam<std::vector<BoundaryName>>(
"boundary");
61 for (
unsigned int j = 0; j < boundary_names.size(); ++j)
63 if (boundary_names[j] ==
"ANY_BOUNDARY_ID")
64 paramError(
"boundary",
"boundary must be explicitly provided.");
72 paramError(
"emissivity",
"The number of entries must match the number of boundary entries.");
76 if (isParamValid(
"fixed_temperature_boundary"))
80 if (!isParamValid(
"fixed_boundary_temperatures"))
81 paramError(
"fixed_boundary_temperatures",
82 "fixed_temperature_boundary is provided, but fixed_boundary_temperatures is not.");
84 auto fst_fn = getParam<std::vector<FunctionName>>(
"fixed_boundary_temperatures");
85 for (
auto & fn : fst_fn)
89 std::vector<BoundaryName> boundary_names =
90 getParam<std::vector<BoundaryName>>(
"fixed_temperature_boundary");
94 "fixed_boundary_temperatures",
95 "fixed_boundary_temperatures and fixed_temperature_boundary must have the same length.");
97 unsigned int index = 0;
98 for (
auto &
name : boundary_names)
109 paramError(
"fixed_temperature_boundary",
110 "fixed_temperature_boundary must be a subset of boundary.");
116 if (isParamValid(
"adiabatic_boundary"))
119 std::vector<BoundaryName> boundary_names =
120 getParam<std::vector<BoundaryName>>(
"adiabatic_boundary");
122 for (
auto &
name : boundary_names)
130 paramError(
"adiabatic_boundary",
"adiabatic_boundary must be a subset of boundary.");
137 paramError(
"adiabatic_boundary",
"Isothermal boundary cannot also be adiabatic boundary.");
145 "Current boundary id not in _side_id_index.");
146 unsigned int index =
_side_id_index.find(_current_boundary_id)->second;
148 for (
unsigned int qp = 0; qp < _qrule->n_points(); qp++)
150 _areas[index] += _JxW[qp] * _coord[qp];
177 for (
unsigned int j = 0; j <
_n_sides; ++j)
194 for (
unsigned int j = 0; j <
_n_sides; ++j)
203 DenseVector<Real> radiosity(
_n_sides);
204 for (
unsigned int i = 0; i <
_n_sides; ++i)
208 for (
unsigned int j = 0; j <
_n_sides; ++j)
218 matrix.lu_solve(rhs, radiosity);
221 for (
unsigned int i = 0; i <
_n_sides; ++i)
229 for (
unsigned int j = 0; j <
_n_sides; ++j)
240 for (
unsigned int j = 0; j <
_n_sides; ++j)
249 static_cast<const GrayLambertSurfaceRadiationBase &>(y);
251 for (
unsigned int j = 0; j <
_n_sides; ++j)
262 std::set<BoundaryID> surface_ids;
264 surface_ids.insert(p.first);