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 "ConvectiveHeatFluxBC.h" 11 : 12 : registerMooseObject("HeatTransferApp", ConvectiveHeatFluxBC); 13 : 14 : InputParameters 15 146 : ConvectiveHeatFluxBC::validParams() 16 : { 17 146 : InputParameters params = IntegratedBC::validParams(); 18 146 : params.addClassDescription( 19 : "Convective heat transfer boundary condition with temperature and heat " 20 : "transfer coefficent given by material properties."); 21 292 : params.addRequiredParam<MaterialPropertyName>("T_infinity", 22 : "Material property for far-field temperature"); 23 292 : params.addRequiredParam<MaterialPropertyName>("heat_transfer_coefficient", 24 : "Material property for heat transfer coefficient"); 25 292 : params.addParam<MaterialPropertyName>( 26 : "heat_transfer_coefficient_dT", 27 : "0", 28 : "Material property for derivative of heat transfer coefficient with respect to temperature"); 29 : 30 146 : return params; 31 0 : } 32 : 33 78 : ConvectiveHeatFluxBC::ConvectiveHeatFluxBC(const InputParameters & parameters) 34 : : IntegratedBC(parameters), 35 78 : _T_infinity(getMaterialProperty<Real>("T_infinity")), 36 156 : _htc(getMaterialProperty<Real>("heat_transfer_coefficient")), 37 234 : _htc_dT(getMaterialProperty<Real>("heat_transfer_coefficient_dT")) 38 : { 39 78 : } 40 : 41 : Real 42 253328 : ConvectiveHeatFluxBC::computeQpResidual() 43 : { 44 253328 : return -_test[_i][_qp] * _htc[_qp] * (_T_infinity[_qp] - _u[_qp]); 45 : } 46 : 47 : Real 48 160896 : ConvectiveHeatFluxBC::computeQpJacobian() 49 : { 50 160896 : return -_test[_i][_qp] * _phi[_j][_qp] * 51 160896 : (-_htc[_qp] + _htc_dT[_qp] * (_T_infinity[_qp] - _u[_qp])); 52 : }