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 "ADExternalAppConvectionHeatTransferBC.h" 11 : #include "Function.h" 12 : 13 : registerMooseObject("ThermalHydraulicsApp", ADExternalAppConvectionHeatTransferBC); 14 : 15 : InputParameters 16 39 : ADExternalAppConvectionHeatTransferBC::validParams() 17 : { 18 39 : InputParameters params = ADIntegratedBC::validParams(); 19 : 20 78 : params.addRequiredCoupledVar("T_ext", "Temperature from external application"); 21 78 : params.addRequiredCoupledVar("htc_ext", "Heat transfer coefficient from external application"); 22 117 : params.addDeprecatedParam<PostprocessorName>( 23 : "scale_pp", 24 : "1.0", 25 : "Post-processor by which to scale boundary condition", 26 : "The 'scale' parameter is replacing the 'scale_pp' parameter. 'scale' is a function " 27 : "parameter instead of a post-processor parameter. If you need to scale from a post-processor " 28 : "value, use a PostprocessorFunction."); 29 78 : params.addParam<FunctionName>("scale", 1.0, "Function by which to scale the boundary condition"); 30 : 31 39 : params.addClassDescription("Convection BC from an external application"); 32 : 33 39 : return params; 34 0 : } 35 : 36 21 : ADExternalAppConvectionHeatTransferBC::ADExternalAppConvectionHeatTransferBC( 37 21 : const InputParameters & parameters) 38 : : ADIntegratedBC(parameters), 39 : 40 21 : _T_ext(adCoupledValue("T_ext")), 41 21 : _htc_ext(adCoupledValue("htc_ext")), 42 21 : _scale_pp(getPostprocessorValue("scale_pp")), 43 42 : _scale_fn(getFunction("scale")) 44 : { 45 21 : } 46 : 47 : ADReal 48 185600 : ADExternalAppConvectionHeatTransferBC::computeQpResidual() 49 : { 50 371200 : return _scale_pp * _scale_fn.value(_t, _q_point[_qp]) * _htc_ext[_qp] * (_u[_qp] - _T_ext[_qp]) * 51 185600 : _test[_i][_qp]; 52 : }