23 params.
addRequiredParam<MaterialPropertyName>(
"Hw",
"Convective heat transfer coefficient");
24 params.
addClassDescription(
"Caches heat flux information (fluid temperature and heat transfer "
25 "coefficient) between flow channel and 3D heat structure.");
33 _P_hf(adCoupledValue(
"P_hf")),
34 _Hw(getADMaterialProperty<Real>(
"Hw")),
35 _T(getADMaterialProperty<Real>(
"T"))
54 for (
const auto & secondary_elem_id : secondary_elem_ids)
58 _T_fluid[secondary_elem_id].resize(secondary_n_qps);
59 _htc[secondary_elem_id].resize(secondary_n_qps);
62 for (
unsigned int secondary_qp = 0; secondary_qp < secondary_n_qps; secondary_qp++)
64 const auto primary_qp =
67 _T_fluid[secondary_elem_id][secondary_qp] =
_T[primary_qp];
68 _htc[secondary_elem_id][secondary_qp] =
_Hw[primary_qp];
86 for (
auto & it : uo._heated_perimeter)
88 for (
auto & it : uo._T_fluid)
90 for (
auto & it : uo._htc)
91 _htc[it.first] = it.second;
94const std::vector<ADReal> &
97 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
103 name(),
": Requested heated perimeter for element ", element_id,
" was not computed.");
106const std::vector<ADReal> &
108 dof_id_type element_id)
const
110 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
111 auto it =
_htc.find(element_id);
112 if (it !=
_htc.end())
116 ": Requested heat transfer coefficient for element ",
118 " was not computed.");
121const std::vector<ADReal> &
124 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
125 auto it =
_T_fluid.find(element_id);
130 name(),
": Requested fluid temperature for element ", element_id,
" was not computed.");
registerMooseObject("ThermalHydraulicsApp", ADHeatTransferFromHeatStructure3D1PhaseUserObject)
const std::vector< double > y
Caching heat flux data (fluid temperature and heat transfer coefficient) between a flow channel and a...
const std::vector< ADReal > & getHeatedPerimeter(dof_id_type element_id) const
virtual void execute() override
const std::vector< ADReal > & getHeatTransferCoeff(dof_id_type element_id) const
const ADMaterialProperty< Real > & _Hw
Heat transfer coefficient.
std::map< dof_id_type, std::vector< ADReal > > _heated_perimeter
Map of the element ID to the heated perimeter at the quadrature points.
virtual void finalize() override
MeshAlignment1D3D & _mesh_alignment
Mesh alignment object.
static InputParameters validParams()
const ADVariableValue & _P_hf
Coupled heated perimeter variable.
const ADMaterialProperty< Real > & _T
Fluid temperature.
virtual void initialize() override
std::map< dof_id_type, std::vector< ADReal > > _T_fluid
Map of the element ID to the fluid temperature at the quadrature points.
std::map< dof_id_type, std::vector< ADReal > > _htc
Map of the element ID to the wall heat transfer coefficient at the quadrature points.
ADHeatTransferFromHeatStructure3D1PhaseUserObject(const InputParameters ¶meters)
virtual void threadJoin(const UserObject &y) override
const std::vector< ADReal > & getTfluid(dof_id_type element_id) const
static InputParameters validParams()
const Elem *const & _current_elem
Builds mapping between a 1D subdomain and a 3D boundary.
void buildCoupledElemQpIndexMap(Assembly &assembly)
Builds the map used for getting the coupled quadrature point index.
unsigned int getSecondaryNumberOfQuadraturePoints() const
Gets the number of quadrature points for faces on the secondary boundary.
unsigned int getCoupledPrimaryElemQpIndex(const dof_id_type &secondary_elem_id, const unsigned int &secondary_qp) const
Gets the quadrature point index on the primary element corresponding to the quadrature point index on...
const std::vector< dof_id_type > & getCoupledSecondaryElemIDs(const dof_id_type &primary_elem_id) const
Gets the coupled secondary element IDs for a given primary element ID.
const std::string & name() const
void mooseError(Args &&... args) const
const Parallel::Communicator & comm() const
void allGatherADVectorMap(const Parallel::Communicator &comm, std::map< dof_id_type, std::vector< ADReal > > &this_map)
Parallel gather of a map of DoF ID to AD vector.