https://mooseframework.inl.gov
ADHeatFluxFromHeatStructureBaseUserObject.C
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://mooseframework.inl.gov
3 //*
4 //* All rights reserved, see COPYRIGHT for full restrictions
5 //* https://github.com/idaholab/moose/blob/master/COPYRIGHT
6 //*
7 //* Licensed under LGPL 2.1, please see LICENSE for details
8 //* https://www.gnu.org/licenses/lgpl-2.1.html
9 
11 
14 {
16  params.addRequiredCoupledVar("P_hf", "Heat flux perimeter");
17  params.addClassDescription(
18  "Base class for caching heat flux between flow channels and heat structures.");
19  return params;
20 }
21 
23  const InputParameters & parameters)
24  : FlowChannelHeatStructureCouplerUserObject(parameters), _qp(0), _P_hf(adCoupledValue("P_hf"))
25 {
26 }
27 
28 const std::vector<ADReal> &
30 {
31  return getCachedQuantity(element_id, _heated_perimeter, "heated perimeter");
32 }
33 
34 const std::vector<ADReal> &
36 {
37  return getCachedQuantity(element_id, _heat_flux, "heat flux");
38 }
39 
40 std::vector<std::map<dof_id_type, std::vector<ADReal>> *>
42 {
43  return {&_heated_perimeter, &_heat_flux};
44 }
45 
46 std::vector<const std::map<dof_id_type, std::vector<ADReal>> *>
48 {
49  return {&_heated_perimeter, &_heat_flux};
50 }
51 
52 void
54 {
55  _qp = _fc_qp;
56  const ADReal q_wall = computeQpHeatFlux();
57 
58  _heat_flux[_fc_elem_id][_fc_qp] = q_wall;
59  _heat_flux[_hs_elem_id][_hs_qp] = q_wall;
60 
63 }
const ADVariableValue & _P_hf
Coupled heated perimeter variable.
unsigned int _hs_qp
Current heat structure quadrature point index.
std::map< dof_id_type, std::vector< ADReal > > _heat_flux
Cached heat flux.
const std::vector< ADReal > & getCachedQuantity(dof_id_type elem_id, const std::map< dof_id_type, std::vector< ADReal >> &elem_id_to_values, const std::string &description) const
Gets a cached quantity from a map.
const std::vector< ADReal > & getHeatFlux(dof_id_type element_id) const
unsigned int _qp
Flow channel quadrature point index.
const std::vector< ADReal > & getHeatedPerimeter(dof_id_type element_id) const
ADHeatFluxFromHeatStructureBaseUserObject(const InputParameters &parameters)
std::map< dof_id_type, std::vector< ADReal > > _heated_perimeter
Cached heated perimeter.
virtual void computeQpCachedQuantities() override
Computes the cached quantities at a quadrature point.
dof_id_type _fc_elem_id
Current flow channel element ID.
void addRequiredCoupledVar(const std::string &name, const std::string &doc_string)
virtual std::vector< std::map< dof_id_type, std::vector< ADReal > > * > getCachedQuantityMaps() override
Gets the cached quantity maps.
Base class for caching quantities computed between flow channels and heat structures.
void addClassDescription(const std::string &doc_string)
unsigned int _fc_qp
Current flow channel quadrature point index.
uint8_t dof_id_type
dof_id_type _hs_elem_id
Current heat structure element ID.