Line data Source code
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 : 10 : #include "ADHeatFluxFromHeatStructureBaseUserObject.h" 11 : 12 : InputParameters 13 320 : ADHeatFluxFromHeatStructureBaseUserObject::validParams() 14 : { 15 320 : InputParameters params = FlowChannelHeatStructureCouplerUserObject::validParams(); 16 640 : params.addRequiredCoupledVar("P_hf", "Heat flux perimeter"); 17 320 : params.addClassDescription( 18 : "Base class for caching heat flux between flow channels and heat structures."); 19 320 : return params; 20 0 : } 21 : 22 173 : ADHeatFluxFromHeatStructureBaseUserObject::ADHeatFluxFromHeatStructureBaseUserObject( 23 173 : const InputParameters & parameters) 24 173 : : FlowChannelHeatStructureCouplerUserObject(parameters), _qp(0), _P_hf(adCoupledValue("P_hf")) 25 : { 26 173 : } 27 : 28 : const std::vector<ADReal> & 29 552130 : ADHeatFluxFromHeatStructureBaseUserObject::getHeatedPerimeter(dof_id_type element_id) const 30 : { 31 1104260 : return getCachedQuantity(element_id, _heated_perimeter, "heated perimeter"); 32 : } 33 : 34 : const std::vector<ADReal> & 35 552130 : ADHeatFluxFromHeatStructureBaseUserObject::getHeatFlux(dof_id_type element_id) const 36 : { 37 1104260 : return getCachedQuantity(element_id, _heat_flux, "heat flux"); 38 : } 39 : 40 : std::vector<std::map<dof_id_type, std::vector<ADReal>> *> 41 78513 : ADHeatFluxFromHeatStructureBaseUserObject::getCachedQuantityMaps() 42 : { 43 78513 : return {&_heated_perimeter, &_heat_flux}; 44 : } 45 : 46 : std::vector<const std::map<dof_id_type, std::vector<ADReal>> *> 47 1475 : ADHeatFluxFromHeatStructureBaseUserObject::getCachedQuantityMaps() const 48 : { 49 1475 : return {&_heated_perimeter, &_heat_flux}; 50 : } 51 : 52 : void 53 113006 : ADHeatFluxFromHeatStructureBaseUserObject::computeQpCachedQuantities() 54 : { 55 113006 : _qp = _fc_qp; 56 113006 : const ADReal q_wall = computeQpHeatFlux(); 57 : 58 113006 : _heat_flux[_fc_elem_id][_fc_qp] = q_wall; 59 113006 : _heat_flux[_hs_elem_id][_hs_qp] = q_wall; 60 : 61 113006 : _heated_perimeter[_fc_elem_id][_fc_qp] = _P_hf[_fc_qp]; 62 113006 : _heated_perimeter[_hs_elem_id][_hs_qp] = _P_hf[_fc_qp]; 63 113006 : }