https://mooseframework.inl.gov
KokkosRadiativeHeatFluxBCBase.h
Go to the documentation of this file.
1 //* This file is part of the MOOSE framework
2 //* https://www.mooseframework.org
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 #pragma once
11 
12 #include "KokkosIntegratedBC.h"
13 
18 template <typename RadiativeHeatFluxBC>
20 {
21 public:
23 
25 
26  KOKKOS_FUNCTION Real computeQpResidual(const unsigned int i,
27  const unsigned int qp,
28  ResidualDatum & datum) const;
29  KOKKOS_FUNCTION Real computeQpJacobian(const unsigned int i,
30  const unsigned int j,
31  const unsigned int qp,
32  ResidualDatum & datum) const;
33 
34 protected:
37 
39  const Real _tinf;
40 };
41 
42 template <typename RadiativeHeatFluxBC>
45 {
47  params.addParam<Real>("stefan_boltzmann_constant", 5.670367e-8, "The Stefan-Boltzmann constant.");
48  params.addParam<Real>("Tinfinity", 0, "Temperature of the body in radiative heat transfer.");
49  params.addClassDescription("Boundary condition for radiative heat flux where temperature and the"
50  "temperature of a body in radiative heat transfer are specified.");
51  return params;
52 }
53 
54 template <typename RadiativeHeatFluxBC>
56  const InputParameters & parameters)
57  : IntegratedBC(parameters),
58  _sigma_stefan_boltzmann(getParam<Real>("stefan_boltzmann_constant")),
59  _tinf(getParam<Real>("Tinfinity"))
60 {
61 }
62 
63 template <typename RadiativeHeatFluxBC>
64 KOKKOS_FUNCTION Real
66  const unsigned int qp,
67  ResidualDatum & datum) const
68 {
69  auto bc = static_cast<const RadiativeHeatFluxBC *>(this);
70 
71  Real T = _u(datum, qp);
72  Real T4 = T * T * T * T;
73  Real T4inf = _tinf * _tinf * _tinf * _tinf;
74  return _test(datum, i, qp) * _sigma_stefan_boltzmann * bc->coefficient() * (T4 - T4inf);
75 }
76 
77 template <typename RadiativeHeatFluxBC>
78 KOKKOS_FUNCTION Real
80  const unsigned int j,
81  const unsigned int qp,
82  ResidualDatum & datum) const
83 {
84  auto bc = static_cast<const RadiativeHeatFluxBC *>(this);
85 
86  Real T = _u(datum, qp);
87  Real T3 = T * T * T;
88  return 4 * _sigma_stefan_boltzmann * _test(datum, i, qp) * bc->coefficient() * T3 *
89  _phi(datum, j, qp);
90 }
void addParam(const std::string &name, const std::initializer_list< typename T::value_type > &value, const std::string &doc_string)
KokkosRadiativeHeatFluxBCBase(const InputParameters &parameters)
const InputParameters & parameters() const
Boundary condition for radiative heat flux where temperature and the temperature of a body in radiati...
static InputParameters validParams()
const Real _tinf
The temperature of the body irhs.
KOKKOS_FUNCTION Real computeQpResidual(const unsigned int i, const unsigned int qp, ResidualDatum &datum) const
Radiative heat transfer boundary condition for a plate heat structure.
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
const Real _sigma_stefan_boltzmann
Stefan-Boltzmann constant.
void addClassDescription(const std::string &doc_string)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
KOKKOS_FUNCTION Real computeQpJacobian(const unsigned int i, const unsigned int j, const unsigned int qp, ResidualDatum &datum) const