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