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 "ADRadiativeHeatFluxBC.h" 11 : 12 : registerMooseObject("ThermalHydraulicsApp", ADRadiativeHeatFluxBC); 13 : 14 : InputParameters 15 97 : ADRadiativeHeatFluxBC::validParams() 16 : { 17 97 : InputParameters params = ADIntegratedBC::validParams(); 18 : 19 194 : params.addRequiredParam<MooseFunctorName>("T_ambient", "Ambient temperature functor"); 20 194 : params.addRequiredParam<MooseFunctorName>("emissivity", "Emissivity functor"); 21 194 : params.addParam<MooseFunctorName>("view_factor", 1.0, "View factor functor"); 22 291 : 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 194 : params.addParam<MooseFunctorName>( 30 194 : "scale", 1.0, "Functor by which to scale the boundary condition"); 31 194 : params.addParam<Real>("stefan_boltzmann_constant", 5.670367e-8, "Stefan-Boltzmann constant"); 32 : 33 97 : params.addClassDescription( 34 : "Radiative heat transfer boundary condition for a plate heat structure"); 35 : 36 97 : return params; 37 0 : } 38 : 39 53 : ADRadiativeHeatFluxBC::ADRadiativeHeatFluxBC(const InputParameters & parameters) 40 : : ADIntegratedBC(parameters), 41 53 : _T_ambient(getFunctor<ADReal>("T_ambient")), 42 106 : _emissivity(getFunctor<ADReal>("emissivity")), 43 106 : _view_factor(getFunctor<ADReal>("view_factor")), 44 53 : _scale_pp(getPostprocessorValue("scale_pp")), 45 106 : _scale(getFunctor<ADReal>("scale")), 46 159 : _sigma(getParam<Real>("stefan_boltzmann_constant")) 47 : { 48 53 : } 49 : 50 : ADReal 51 1920 : ADRadiativeHeatFluxBC::computeQpResidual() 52 : { 53 1920 : const Moose::ElemSideQpArg space_arg = {_current_elem, _current_side, _qp, _qrule, _q_point[_qp]}; 54 1920 : const auto scale = _scale(space_arg, Moose::currentState()); 55 1920 : const auto emissivity = _emissivity(space_arg, Moose::currentState()); 56 1920 : const auto view_factor = _view_factor(space_arg, Moose::currentState()); 57 1920 : const auto T_ambient = _T_ambient(space_arg, Moose::currentState()); 58 : 59 1920 : const auto T4 = MathUtils::pow(_u[_qp], 4); 60 1920 : const auto T4inf = MathUtils::pow(T_ambient, 4); 61 : 62 1920 : return _test[_i][_qp] * _sigma * _scale_pp * scale * emissivity * view_factor * (T4 - T4inf); 63 : }