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");
34 Moose::RelationshipManagerType::GEOMETRIC |
35 Moose::RelationshipManagerType::ALGEBRAIC,
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);
110 !neighbor->is_remote(),
111 "The neighbor best not be remote because we request at least one layer of ghosting");
112 T_inf_can_use_neighbor = T_inf_can_use_neighbor && neighbor &&
114 htc_can_use_neighbor =
115 htc_can_use_neighbor && neighbor &&
_htc_functor->hasBlocks(neighbor->subdomain_id());
121 const std::string error_msg =
122 "Functor must either be defined on all of the primary side of the boundary or on all "
123 "of the secondary side.";
127 paramError(
"heat_transfer_coefficient_functor", error_msg);
157 return -
_test[
_i][
_qp] * (*_htc_functor)(htc_space_arg, time_arg) *
registerMooseObject("HeatTransferApp", ADConvectiveHeatFluxBC)
DualNumber< Real, DNDerivativeType, true > ADReal
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 Moose::Functor< ADReal > *const _htc_functor
Convective heat transfer coefficient as a functor.
const ADMaterialProperty< Real > *const _T_infinity
Far-field temperature variable.
bool _htc_use_neighbor
Whether the heat transfer coefficient functor should be evaluated on neighbor elements.
const Moose::Functor< ADReal > *const _T_infinity_functor
Far-field temperature functor.
ADConvectiveHeatFluxBC(const InputParameters ¶meters)
unsigned int _current_neighbor_side
Corresponding side on the neighbor.
virtual ADReal computeQpResidual() override
const Elem * _current_neighbor_elem
Neighbor of the current element's side (can be nullptr)
static InputParameters validParams()
const ADMaterialProperty< Real > *const _htc
Convective heat transfer coefficient.
virtual void initialSetup() override
Here we check if the functors are defined on primary side of the boundary.
const ADTemplateVariableValue< T > & _u
static InputParameters validParams()
const ADTemplateVariableTestValue< T > & _test
bool hasBoundary(const BoundaryName &name) const
const unsigned int & _current_side
const QBase *const & _qrule
const Elem *const & _current_elem
const MooseArray< Point > & _q_point
void paramError(const std::string ¶m, Args... args) const
libMesh::StoredRange< MooseMesh::const_bnd_elem_iterator, const BndElement * > * getBoundaryElementRange()
void max(const T &r, T &o, Request &req) const
const Parallel::Communicator & _communicator
processor_id_type processor_id() const