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 "HeatRateConvection.h" 11 : 12 : registerMooseObject("ThermalHydraulicsApp", HeatRateConvection); 13 : 14 : InputParameters 15 181 : HeatRateConvection::validParams() 16 : { 17 181 : InputParameters params = SideIntegralPostprocessor::validParams(); 18 : 19 362 : params.addRequiredCoupledVar("T", "Temperature"); 20 362 : params.addRequiredParam<MooseFunctorName>("T_ambient", "Ambient temperature functor"); 21 362 : params.addRequiredParam<MooseFunctorName>("htc", "Ambient heat transfer coefficient functor"); 22 362 : params.addParam<MooseFunctorName>("scale", 1.0, "Functor by which to scale the heat flux"); 23 : 24 181 : params.addClassDescription("Integrates a convective heat flux over a boundary."); 25 : 26 181 : return params; 27 0 : } 28 : 29 89 : HeatRateConvection::HeatRateConvection(const InputParameters & parameters) 30 : : SideIntegralPostprocessor(parameters), 31 : 32 89 : _T(coupledValue("T")), 33 178 : _T_ambient(getFunctor<Real>("T_ambient")), 34 178 : _htc_ambient(getFunctor<Real>("htc")), 35 267 : _scale(getFunctor<Real>("scale")) 36 : { 37 89 : } 38 : 39 : Real 40 3720 : HeatRateConvection::computeQpIntegral() 41 : { 42 3720 : const Moose::ElemSideQpArg space_arg = {_current_elem, _current_side, _qp, _qrule, _q_point[_qp]}; 43 3720 : const auto scale = _scale(space_arg, Moose::currentState()); 44 3720 : const auto htc = _htc_ambient(space_arg, Moose::currentState()); 45 3720 : const auto T_ambient = _T_ambient(space_arg, Moose::currentState()); 46 : 47 3720 : return scale * htc * (T_ambient - _T[_qp]); 48 : }