https://mooseframework.inl.gov
Loading...
Searching...
No Matches
ADPipeOuterWallRadiationScalarKernel.C
Go to the documentation of this file.
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
11
13#include "PhysicalConstants.h"
14
16
19{
22 "Adds a radiative heat transfer term, exchanged with an ambient/surrounding "
23 "environment, to the outer-surface radial node of a pipe wall.");
24 params.addParam<bool>(
25 "is_implicit",
26 false,
27 "Whether an explicit (previous value calculation) or implicit (current value) is used");
28 params.addRequiredParam<UserObjectName>("solid_properties",
29 "The name of the user object for solid properties");
30 params.addRequiredParam<MooseFunctorName>("area",
31 "Cross-sectional area of this wall layer [m^2]");
32 params.addRequiredParam<MooseFunctorName>(
33 "perimeter", "Perimeter of this wall node exposed to the radiative environment [m]");
34 params.addRequiredParam<MooseFunctorName>("T_ambient", "Ambient temperature functor [K]");
35 params.addRequiredParam<MooseFunctorName>("emissivity", "Emissivity functor");
36 params.addParam<MooseFunctorName>("view_factor", 1.0, "View factor functor");
37 params.addParam<MooseFunctorName>(
38 "scale", 1.0, "Functor by which to scale the radiative heat transfer term");
39 params.addParam<Real>("stefan_boltzmann_constant",
41 "Stefan-Boltzmann constant");
42
43 return params;
44}
45
47 const InputParameters & parameters)
48 : Base(parameters),
49 _sp(this->template getUserObject<ThermalSolidProperties>("solid_properties")),
50 _is_implicit(this->template getParam<bool>("is_implicit")),
51 _area(this->template getFunctor<ADReal>("area")),
52 _perimeter(this->template getFunctor<ADReal>("perimeter")),
53 _T_ambient(this->template getFunctor<ADReal>("T_ambient")),
54 _emissivity(this->template getFunctor<ADReal>("emissivity")),
55 _view_factor(this->template getFunctor<ADReal>("view_factor")),
56 _scale(this->template getFunctor<ADReal>("scale")),
57 _sigma(this->template getParam<Real>("stefan_boltzmann_constant"))
58{
59}
60
63{
64 const Moose::PointArg arg = {Point(1, 2, 3)};
65 const int i = 0;
66 const auto state = _is_implicit ? Moose::currentState() : Moose::oldState();
67
68 const auto A = _area(arg, state);
69 const auto cp = _sp.cp_from_T(Base::_u[i]);
70 const auto rho = _sp.rho_from_T(Base::_u[i]);
71
72 const auto scale = _scale(arg, state);
73 const auto emissivity = _emissivity(arg, state);
74 const auto view_factor = _view_factor(arg, state);
75 const auto T4 = pow(Base::_u[i], 4);
76 const auto T4inf = pow(_T_ambient(arg, state), 4);
77
78 // Radiative heat transfer with the ambient/surrounding environment
79 const auto q_radiation =
80 _sigma * scale * emissivity * view_factor * _perimeter(arg, state) * (T4inf - T4);
81
82 return -q_radiation / A / rho / cp;
83}
84
85Real
87{
88 mooseError("computeQpJacobian() should not be called in AD mode");
89 return 0;
90}
registerMooseObject("ThermalHydraulicsApp", ADPipeOuterWallRadiationScalarKernel)
DualNumber< Real, DNDerivativeType, true > ADReal
ExpressionBuilder::EBTerm pow(const ExpressionBuilder::EBTerm &left, T exponent)
const double rho
Real scale
Outer wall radiative heat transfer kernel for the path-integrated incompressible conjugate heat trans...
const Moose::Functor< ADReal > & _scale
Functor by which to scale the radiative heat transfer term.
const ThermalSolidProperties & _sp
Solid properties object for the pipe wall.
ADPipeOuterWallRadiationScalarKernel(const InputParameters &parameters)
const Moose::Functor< ADReal > & _emissivity
Emissivity functor.
const Moose::Functor< ADReal > & _view_factor
View factor functor.
const Moose::Functor< ADReal > & _area
Cross-sectional area of this wall layer.
const Moose::Functor< ADReal > & _perimeter
Perimeter of this wall node exposed to the radiative environment.
const bool _is_implicit
Property state integration flag.
const Moose::Functor< ADReal > & _T_ambient
Ambient temperature functor.
const ADVariableValue & _u
static InputParameters validParams()
void addRequiredParam(const std::string &name, const std::string &doc_string)
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
void addClassDescription(const std::string &doc_string)
void mooseError(Args &&... args) const
Common class for solid properties that are a function of temperature.
StateArg oldState()
StateArg currentState()
const auto stefan_boltzmann_constant