19 "Convective heat transfer boundary condition with temperature and heat " 20 "transfer coefficient given by material properties.");
22 params.
addParam<MaterialPropertyName>(
"T_infinity",
23 "Material property for far-field temperature");
24 params.
addParam<MaterialPropertyName>(
"heat_transfer_coefficient",
25 "Material property for heat transfer coefficient");
27 params.
addParam<MooseFunctorName>(
"T_infinity_functor",
"Functor for far-field temperature");
28 params.
addParam<MooseFunctorName>(
"heat_transfer_coefficient_functor",
29 "Functor for heat transfer coefficient");
38 rm_params.
set<
unsigned short>(
"layers") =
46 _T_infinity(isParamValid(
"T_infinity") ? &getADMaterialProperty<
Real>(
"T_infinity") : nullptr),
47 _htc(isParamValid(
"heat_transfer_coefficient")
48 ? &getADMaterialProperty<
Real>(
"heat_transfer_coefficient")
51 isParamValid(
"T_infinity_functor") ? &getFunctor<
ADReal>(
"T_infinity_functor") : nullptr),
52 _htc_functor(isParamValid(
"heat_transfer_coefficient_functor")
53 ? &getFunctor<
ADReal>(
"heat_transfer_coefficient_functor")
60 "Either material properties or functors should be specified for both T_infinity " 61 "and the heat transfer coefficient.");
63 paramError(
"heat_transfer_coefficient_functor",
64 "Either material properties or functors should be specified for both T_infinity " 65 "and the heat transfer coefficient");
68 "Heat transfer coefficient material property must be specified");
70 paramError(
"T_infinity",
"Far field temperature material property must be specified");
75 paramError(
"heat_transfer_coefficient_functor",
76 "Heat transfer coefficient functor must be specified");
78 paramError(
"T_infinity_functor",
"Far field temperature functor must be specified");
82 "Far field temperature and heat transfer coefficients must be specified");
91 bool T_inf_can_use_neighbor =
true;
92 bool htc_can_use_neighbor =
true;
96 const auto & [elem, side, bid] = *bnd_elem;
107 const auto neighbor = elem->neighbor_ptr(side);
108 T_inf_can_use_neighbor = T_inf_can_use_neighbor && neighbor &&
110 htc_can_use_neighbor =
111 htc_can_use_neighbor && neighbor &&
_htc_functor->hasBlocks(neighbor->subdomain_id());
114 const std::string error_msg =
115 "Functor must either be defined on all of the primary side of the boundary or on all " 116 "of the secondary side.";
120 paramError(
"heat_transfer_coefficient_functor", error_msg);
150 return -
_test[
_i][
_qp] * (*_htc_functor)(htc_space_arg, time_arg) *
Boundary condition for convective heat flux where temperature and heat transfer coefficient are given...
bool _T_infinity_use_neighbor
Whether the far-field temperature functor should be evaluated on neighbor elements.
const ADTemplateVariableValue< T > & _u
registerMooseObject("HeatTransferApp", ADConvectiveHeatFluxBC)
virtual ADReal computeQpResidual() override
static InputParameters validParams()
const Elem *const & _current_elem
const ADMaterialProperty< Real > *const _htc
Convective heat transfer coefficient.
const Elem * _current_neighbor_elem
Neighbor of the current element's side (can be nullptr)
const ADMaterialProperty< Real > *const _T_infinity
Far-field temperature variable.
ADConvectiveHeatFluxBC(const InputParameters ¶meters)
DualNumber< Real, DNDerivativeType, true > ADReal
static InputParameters validParams()
const MooseArray< Point > & _q_point
unsigned int _current_neighbor_side
Corresponding side on the neighbor.
virtual void initialSetup() override
Here we check if the functors are defined on primary side of the boundary.
void paramError(const std::string ¶m, Args... args) const
bool hasBoundary(const BoundaryName &name) const
const QBase *const & _qrule
const unsigned int & _current_side
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const ADTemplateVariableTestValue< T > & _test
const Moose::Functor< ADReal > *const _T_infinity_functor
Far-field temperature functor.
bool _htc_use_neighbor
Whether the heat transfer coefficient functor should be evaluated on neighbor elements.
libMesh::StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement *> * getBoundaryElementRange()
const Moose::Functor< ADReal > *const _htc_functor
Convective heat transfer coefficient as a functor.