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 {
22 
23 public:
25 
27 
28  KOKKOS_FUNCTION Real computeQpResidual(const unsigned int i,
29  const unsigned int qp,
30  ResidualDatum & datum) const;
31  KOKKOS_FUNCTION Real computeQpJacobian(const unsigned int i,
32  const unsigned int j,
33  const unsigned int qp,
34  ResidualDatum & datum) const;
35 
36 protected:
39 
41  const Real _tinf;
42 };
43 
44 template <typename RadiativeHeatFluxBC>
47 {
49  params.addParam<Real>("stefan_boltzmann_constant", 5.670367e-8, "The Stefan-Boltzmann constant.");
50  params.addParam<Real>("Tinfinity", 0, "Temperature of the body in radiative heat transfer.");
51  params.addClassDescription("Boundary condition for radiative heat flux where temperature and the"
52  "temperature of a body in radiative heat transfer are specified.");
53  return params;
54 }
55 
56 template <typename RadiativeHeatFluxBC>
58  const InputParameters & parameters)
59  : Moose::Kokkos::IntegratedBC<RadiativeHeatFluxBC>(parameters),
60  _sigma_stefan_boltzmann(this->template getParam<Real>("stefan_boltzmann_constant")),
61  _tinf(this->template getParam<Real>("Tinfinity"))
62 {
63 }
64 
65 template <typename RadiativeHeatFluxBC>
66 KOKKOS_FUNCTION Real
68  const unsigned int qp,
69  ResidualDatum & datum) const
70 {
71  auto BC = static_cast<const RadiativeHeatFluxBC *>(this);
72 
73  Real T = _u(datum, qp);
74  Real T4 = T * T * T * T;
75  Real T4inf = _tinf * _tinf * _tinf * _tinf;
76  return _test(datum, i, qp) * _sigma_stefan_boltzmann * BC->coefficient() * (T4 - T4inf);
77 }
78 
79 template <typename RadiativeHeatFluxBC>
80 KOKKOS_FUNCTION Real
82  const unsigned int j,
83  const unsigned int qp,
84  ResidualDatum & datum) const
85 {
86  auto BC = static_cast<const RadiativeHeatFluxBC *>(this);
87 
88  Real T = _u(datum, qp);
89  Real T3 = T * T * T;
90  return 4 * _sigma_stefan_boltzmann * _test(datum, i, qp) * BC->coefficient() * T3 *
91  _phi(datum, j, qp);
92 }
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...
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.
usingKokkosIntegratedBCMembers(RadiativeHeatFluxBC)
void addClassDescription(const std::string &doc_string)
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
static InputParameters validParams()
KOKKOS_FUNCTION Real computeQpJacobian(const unsigned int i, const unsigned int j, const unsigned int qp, ResidualDatum &datum) const