23 params.
addRequiredParam<std::vector<Real>>(
"emissivities",
"Emissivities of each surface");
25 "view_factors",
"View factors between each surface, as a matrix");
27 "include_environment",
28 "Whether or not to include an environment surrounding all of the surfaces.");
29 params.
addParam<
Real>(
"T_environment", 0.0,
"Environment temperature.");
32 "StoreVariableByElemIDSideUserObjects containing the temperature values for each element");
44 _emissivities(getParam<
std::vector<
Real>>(
"emissivities")),
45 _view_factors(getParam<
std::vector<
std::vector<
Real>>>(
"view_factors")),
46 _include_environment(getParam<bool>(
"include_environment")),
47 _T_environment(getParam<
Real>(
"T_environment")),
50 _n_hs(_emissivities.size()),
51 _n_surfaces(_include_environment ? _n_hs + 1 : _n_hs)
65 std::vector<dof_id_type> elem_ids;
68 elem_ids.insert(elem_ids.end(), coupled_elem_ids.begin(), coupled_elem_ids.end());
71 std::vector<std::vector<ADReal>> temperatures;
72 for (
const auto & elem_id : elem_ids)
76 const auto n_qp =
_qrule->n_points();
77 std::vector<std::vector<ADReal>> heat_fluxes(
_n_hs, std::vector<ADReal>(n_qp, 0.0));
78 for (
unsigned int qp = 0; qp < n_qp; qp++)
102 matrix.lu_solve(emittances, radiosities);
105 for (
unsigned int i = 0; i <
_n_hs; ++i)
111 for (
unsigned int i = 0; i <
_n_hs; ++i)
119 for (
auto & it : other_uo._elem_id_to_heat_flux)
126 existing[qp] += it.second[qp];
136 const std::vector<ADReal> &
139 Threads::spin_mutex::scoped_lock lock(Threads::spin_mtx);
145 mooseError(
name(),
": Requested heat flux for element ", elem_id,
" was not computed.");
static InputParameters validParams()
const std::vector< ADReal > & getVariableValues(dof_id_type elem_id) const
Gets the variable values at each quadrature point on the provided element.
static InputParameters validParams()
virtual void execute() override
registerMooseObject("ThermalHydraulicsApp", HSCoupler2D2DRadiationUserObject)
const std::vector< ADReal > & getHeatFlux(dof_id_type elem_id) const
Gets the heat fluxes for each quadrature point for a given element ID.
const bool _include_environment
Whether or not to include an environment surrounding all of the surfaces.
std::map< dof_id_type, std::vector< ADReal > > _elem_id_to_heat_flux
Map of the element ID to the heat flux.
const std::vector< Real > & _emissivities
Emissivities of each boundary.
Stores variable values at each quadrature point on a side by element ID.
const Parallel::Communicator & comm() const
virtual void threadJoin(const UserObject &uo) override
virtual const std::string & name() const
const std::vector< std::vector< Real > > & _view_factors
View factors between each surface.
Builds mapping between multiple 2D boundaries.
const unsigned int _n_hs
Number of heat structures.
HSCoupler2D2DRadiationUserObject(const InputParameters ¶meters)
const StoreVariableByElemIDSideUserObject & _temperature_uo
User object containing the temperature values on the boundary.
const Real & _T_environment
Environment temperature.
virtual void initialize() override
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const QBase *const & _qrule
void allGatherADVectorMapSum(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.
void mooseError(Args &&... args) const
const unsigned int _n_surfaces
Number of surfaces.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
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 Elem *const & _current_elem
Computes heat fluxes for HSCoupler2D2DRadiation.
virtual void finalize() override
MooseUnits pow(const MooseUnits &, int)
for(PetscInt i=0;i< nvars;++i)
auto index_range(const T &sizable)
const MeshAlignment2D2D & _mesh_alignment
Mesh alignment object.