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