19 params.addCoupledVar(
"temperature",
"temperature variable");
21 params.addRequiredParam<MaterialPropertyName>(
"htc",
"heat transfer coefficient");
26 "emissivity of the surface");
28 params.addRequiredParam<std::vector<Real>>(
29 "thermal_conductivities",
30 "vector of thermal conductivity values used for the conduction layers");
31 params.addRequiredParam<std::vector<Real>>(
"conduction_thicknesses",
32 "vector of conduction layer thicknesses");
34 MooseEnum geometry(
"cartesian cylindrical",
"cartesian");
35 params.addParam<
MooseEnum>(
"geometry", geometry,
"type of geometry");
36 params.addRangeCheckedParam<
Real>(
"inner_radius",
38 "coordinate corresponding to the first resistance layer");
40 params.addRangeCheckedParam<
Real>(
41 "step_size", 0.1,
"step_size > 0.0",
"underrelaxation step size");
43 params.addRangeCheckedParam<
unsigned int>(
44 "max_iterations", 100,
"max_iterations >= 0",
"maximum iterations");
46 params.addRangeCheckedParam<
Real>(
47 "tolerance", 1E-3,
"tolerance > 0.0",
"tolerance to converge iterations");
48 params.addClassDescription(
"Thermal resistance Heat flux boundary condition for the " 49 "fluid and solid energy equations");
58 _T(isParamValid(
"temperature") ? adCoupledValue(
"temperature") : _u),
60 _k(getParam<
std::vector<
Real>>(
"thermal_conductivities")),
61 _dx(getParam<
std::vector<
Real>>(
"conduction_thicknesses")),
62 _h(getADMaterialPropertyByName<
Real>(getParam<MaterialPropertyName>(
"htc"))),
64 _max_iterations(getParam<unsigned
int>(
"max_iterations")),
65 _tolerance(getParam<
Real>(
"tolerance")),
66 _alpha(getParam<
Real>(
"step_size")),
68 _outer_radius(_inner_radius),
69 _conduction_resistance(0.0),
70 _parallel_resistance(0.0)
72 if (
_k.size() !=
_dx.size())
74 "Number of specified thermal conductivities must match " 75 "the number of conduction layers!");
77 if (
_geometry == Moose::CoordinateSystemType::COORD_RZ)
78 for (
const auto &
d :
_dx)
95 case Moose::CoordinateSystemType::COORD_XYZ:
98 case Moose::CoordinateSystemType::COORD_RZ:
105 mooseError(
"Unhandled 'GeometryEnum' in 'FVThermalResistanceBC'!");
127 unsigned int iteration = 0;
129 ADReal T_surface_previous;
146 norm = std::abs(
_T_surface - T_surface_previous) / std::abs(T_surface_previous);
150 mooseWarning(
"Maximum number of iterations reached in 'FVThermalResistanceBC'!");
FVThermalResistanceBC(const InputParameters ¶meters)
const Real _inner_radius
Radius corresponding to the cylindrical surface (when using a cylindrical geometry) ...
static InputParameters validParams()
const Real _T_ambient
ambient temperature for convection and radiation heat transfer
ADReal _T_surface
surface temperature
DualNumber< Real, DNDerivativeType, true > ADReal
void mooseWarning(Args &&... args) const
const Moose::CoordinateSystemType _geometry
Whether to use a cylindrical or cartesian form for the thermal resistances.
ADReal _conduction_resistance
conduction thermal resistance
static const std::string T_ambient
const unsigned int & _max_iterations
maximum number of iterations (when radiative heat transfer is included)
ADReal _parallel_resistance
parallel convection and radiation thermal resistance
void paramError(const std::string ¶m, Args... args) const
void computeConductionResistance()
Computes the serial resistance of multiple conductive layers.
static InputParameters validParams()
const Real & _emissivity
boundary emissivity
const std::vector< Real > & _k
thermal conductivities for each conduction layer, listed in order closest to the boundary ...
const Real & _alpha
underrelaxation factor (when radiative heat transfer is included)
const Real & _tolerance
tolerance of iterations (when radiative heat transfer is included)
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
void mooseError(Args &&... args) const
void computeParallelResistance()
Computes the parallel heat flux resistance for a combined radiation-convection boundary.
virtual ADReal computeQpResidual() override
This BC applies a heat flux to a boundary, where the heat flux is determined using series conduction ...
const ADVariableValue & _T
temperature variable
void ErrorVector unsigned int
auto index_range(const T &sizable)
const std::vector< Real > & _dx
thicknesses for each conduction layer, listed in order closest to the boundary
static const std::string emissivity
registerMooseObject("HeatTransferApp", FVThermalResistanceBC)
ADReal _outer_radius
outer radius of surface
const ADMaterialProperty< Real > & _h
convective heat transfer coefficient