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 "ADConvectionHeatTransferBC.h" 11 : 12 : registerMooseObject("ThermalHydraulicsApp", ADConvectionHeatTransferBC); 13 : 14 : InputParameters 15 113 : ADConvectionHeatTransferBC::validParams() 16 : { 17 113 : InputParameters params = ADIntegratedBC::validParams(); 18 226 : params.addRequiredParam<MooseFunctorName>("T_ambient", "Ambient temperature functor"); 19 226 : params.addRequiredParam<MooseFunctorName>("htc_ambient", 20 : "Ambient heat transfer coefficient functor"); 21 226 : params.addParam<MooseFunctorName>( 22 226 : "scale", 1.0, "Functor by which to scale the boundary condition"); 23 113 : params.addClassDescription("Adds a convective heat flux boundary condition with user-specified " 24 : "ambient temperature and heat transfer coefficient functions"); 25 113 : return params; 26 0 : } 27 : 28 59 : ADConvectionHeatTransferBC::ADConvectionHeatTransferBC(const InputParameters & parameters) 29 : : ADIntegratedBC(parameters), 30 59 : _T_ambient(getFunctor<ADReal>("T_ambient")), 31 118 : _htc_ambient(getFunctor<ADReal>("htc_ambient")), 32 177 : _scale(getFunctor<ADReal>("scale")) 33 : { 34 59 : } 35 : 36 : ADReal 37 84832 : ADConvectionHeatTransferBC::computeQpResidual() 38 : { 39 84832 : const Moose::ElemSideQpArg space_arg = {_current_elem, _current_side, _qp, _qrule, _q_point[_qp]}; 40 84832 : const auto scale = _scale(space_arg, Moose::currentState()); 41 84832 : const auto htc = _htc_ambient(space_arg, Moose::currentState()); 42 84832 : const auto T_ambient = _T_ambient(space_arg, Moose::currentState()); 43 : 44 84832 : return scale * htc * (_u[_qp] - T_ambient) * _test[_i][_qp]; 45 : }