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 "CoupledConvectiveFlux.h" 11 : 12 : #include "Function.h" 13 : 14 : registerMooseObject("HeatTransferApp", CoupledConvectiveFlux); 15 : 16 : InputParameters 17 0 : CoupledConvectiveFlux::validParams() 18 : { 19 0 : InputParameters params = IntegratedBC::validParams(); 20 0 : params.addRequiredCoupledVar("T_infinity", "Field holding far-field temperature"); 21 0 : params.addRequiredParam<Real>("coefficient", "Heat transfer coefficient"); 22 0 : params.addClassDescription("Integrated boundary condition for modeling a convective heat flux."); 23 : 24 0 : return params; 25 0 : } 26 : 27 0 : CoupledConvectiveFlux::CoupledConvectiveFlux(const InputParameters & parameters) 28 : : IntegratedBC(parameters), 29 0 : _T_infinity(coupledValue("T_infinity")), 30 0 : _coefficient(getParam<Real>("coefficient")) 31 : { 32 0 : mooseDeprecated( 33 : "CoupledConvectiveFlux boundary condition is deprecated, use CoupledConvectiveHeatFluxBC " 34 : "instead. To update your input file:\n 1. change type from `CoupledConvectiveFlux` to " 35 : "`CoupledConvectiveHeatFluxBC`\n 2. change `coefficient` parameter to `htc`."); 36 0 : } 37 : 38 : Real 39 0 : CoupledConvectiveFlux::computeQpResidual() 40 : { 41 0 : return _test[_i][_qp] * _coefficient * (_u[_qp] - _T_infinity[_qp]); 42 : } 43 : 44 : Real 45 0 : CoupledConvectiveFlux::computeQpJacobian() 46 : { 47 0 : return _test[_i][_qp] * _coefficient * _phi[_j][_qp]; 48 : }