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 "FVRadiativeHeatFluxBCBase.h" 11 : #include "MathUtils.h" 12 : 13 : InputParameters 14 82 : FVRadiativeHeatFluxBCBase::validParams() 15 : { 16 82 : InputParameters params = FVFluxBC::validParams(); 17 164 : params.addCoupledVar("temperature", "temperature variable"); 18 164 : params.addParam<Real>("stefan_boltzmann_constant", 5.670367e-8, "The Stefan-Boltzmann constant."); 19 164 : params.addRequiredParam<MooseFunctorName>("Tinfinity", 20 : "Temperature of the body in radiative heat transfer."); 21 82 : params.addClassDescription("Boundary condition for radiative heat flux where temperature and the" 22 : "temperature of a body in radiative heat transfer are specified."); 23 82 : return params; 24 0 : } 25 : 26 44 : FVRadiativeHeatFluxBCBase::FVRadiativeHeatFluxBCBase(const InputParameters & parameters) 27 : : FVFluxBC(parameters), 28 66 : _T(isParamValid("temperature") ? adCoupledValue("temperature") : _u), 29 88 : _sigma_stefan_boltzmann(getParam<Real>("stefan_boltzmann_constant")), 30 132 : _tinf(getFunctor<ADReal>("Tinfinity")) 31 : { 32 88 : if (!isParamValid("temperature")) 33 22 : _var.requireQpComputations(); 34 44 : } 35 : 36 : ADReal 37 450 : FVRadiativeHeatFluxBCBase::computeQpResidual() 38 : { 39 450 : const auto T4 = Utility::pow<4>(_T[_qp]); 40 900 : const auto T4inf = Utility::pow<4>(_tinf(singleSidedFaceArg(_face_info), determineState())); 41 900 : return _sigma_stefan_boltzmann * coefficient() * (T4 - T4inf); 42 : }