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 "ConvectionHeatTransferBC.h" 11 : #include "Function.h" 12 : 13 : registerMooseObject("ThermalHydraulicsApp", ConvectionHeatTransferBC); 14 : 15 : InputParameters 16 8 : ConvectionHeatTransferBC::validParams() 17 : { 18 8 : InputParameters params = IntegratedBC::validParams(); 19 16 : params.addRequiredParam<FunctionName>("T_ambient", "Ambient temperature function"); 20 16 : params.addRequiredParam<FunctionName>("htc_ambient", 21 : "Ambient heat transfer coefficient function"); 22 16 : params.addParam<PostprocessorName>( 23 16 : "scale_pp", 1.0, "Post-processor by which to scale boundary condition"); 24 8 : params.addClassDescription("Adds a convective heat flux boundary condition with user-specified " 25 : "ambient temperature and heat transfer coefficient functions"); 26 8 : return params; 27 0 : } 28 : 29 4 : ConvectionHeatTransferBC::ConvectionHeatTransferBC(const InputParameters & parameters) 30 : : IntegratedBC(parameters), 31 4 : _T_ambient_fn(getFunction("T_ambient")), 32 4 : _htc_ambient_fn(getFunction("htc_ambient")), 33 8 : _scale_pp(getPostprocessorValue("scale_pp")) 34 : { 35 4 : } 36 : 37 : Real 38 288 : ConvectionHeatTransferBC::computeQpResidual() 39 : { 40 288 : return _scale_pp * _htc_ambient_fn.value(_t, _q_point[_qp]) * 41 288 : (_u[_qp] - _T_ambient_fn.value(_t, _q_point[_qp])) * _test[_i][_qp]; 42 : } 43 : 44 : Real 45 128 : ConvectionHeatTransferBC::computeQpJacobian() 46 : { 47 128 : return _scale_pp * _htc_ambient_fn.value(_t, _q_point[_qp]) * _phi[_j][_qp] * _test[_i][_qp]; 48 : }