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 "HeatRateDirectFlowChannel.h" 11 : #include "Function.h" 12 : 13 : #include "metaphysicl/raw_type.h" 14 : 15 : registerMooseObject("ThermalHydraulicsApp", HeatRateDirectFlowChannel); 16 : registerMooseObject("ThermalHydraulicsApp", ADHeatRateDirectFlowChannel); 17 : 18 : template <bool is_ad> 19 : InputParameters 20 0 : HeatRateDirectFlowChannelTempl<is_ad>::validParams() 21 : { 22 0 : InputParameters params = ElementIntegralPostprocessor::validParams(); 23 : 24 0 : params.addRequiredParam<MaterialPropertyName>("q_wall_prop", "Wall heat flux material property"); 25 0 : params.addRequiredParam<FunctionName>("P_hf", "Heat flux perimeter"); 26 : 27 0 : params.addClassDescription( 28 : "Computes the heat rate into a flow channel from heat flux material property"); 29 : 30 0 : return params; 31 0 : } 32 : 33 : template <bool is_ad> 34 0 : HeatRateDirectFlowChannelTempl<is_ad>::HeatRateDirectFlowChannelTempl( 35 : const InputParameters & parameters) 36 : : ElementIntegralPostprocessor(parameters), 37 : 38 0 : _q_wall(getGenericMaterialProperty<Real, is_ad>("q_wall_prop")), 39 0 : _P_hf_fn(getFunction("P_hf")) 40 : { 41 0 : } 42 : 43 : template <bool is_ad> 44 : Real 45 0 : HeatRateDirectFlowChannelTempl<is_ad>::computeQpIntegral() 46 : { 47 0 : return MetaPhysicL::raw_value(_q_wall[_qp]) * _P_hf_fn.value(_t, _q_point[_qp]); 48 : } 49 : 50 : template class HeatRateDirectFlowChannelTempl<false>; 51 : template class HeatRateDirectFlowChannelTempl<true>;