https://mooseframework.inl.gov
KokkosCoupledConvectiveHeatFluxBC.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 
20  : public Moose::Kokkos::IntegratedBC<KokkosCoupledConvectiveHeatFluxBC>
21 {
22 public:
24 
26 
27  KOKKOS_FUNCTION Real computeQpResidual(const unsigned int i,
28  const unsigned int qp,
29  ResidualDatum & datum) const;
30  KOKKOS_FUNCTION Real computeQpJacobian(const unsigned int i,
31  const unsigned int j,
32  const unsigned int qp,
33  ResidualDatum & datum) const;
34 
35 private:
37  const unsigned int _n_components;
46 };
47 
48 KOKKOS_FUNCTION inline Real
50  const unsigned int qp,
51  ResidualDatum & datum) const
52 {
53  Real q = 0;
54  Real u = _u(datum, qp);
55  for (unsigned int c = 0; c < _n_components; c++)
56  q += _alpha(datum, qp, c) * _htc(datum, qp, c) * (u - _T_infinity(datum, qp, c));
57  return _test(datum, i, qp) * q * _scale_factor(datum, qp);
58 }
59 
60 KOKKOS_FUNCTION inline Real
62  const unsigned int j,
63  const unsigned int qp,
64  ResidualDatum & datum) const
65 {
66  Real dq = 0;
67  Real phi = _phi(datum, j, qp);
68  for (unsigned int c = 0; c < _n_components; c++)
69  dq += _alpha(datum, qp, c) * _htc(datum, qp, c) * phi;
70  return _test(datum, i, qp) * dq * _scale_factor(datum, qp);
71 }
const Moose::Kokkos::VariableValue _alpha
Volume fraction of individual phase.
Boundary condition for convective heat flux where temperature and heat transfer coefficient are given...
const unsigned int _n_components
The number of components.
const Moose::Kokkos::VariableValue _htc
Convective heat transfer coefficient.
const Moose::Kokkos::VariableValue _T_infinity
Far-field temperature fields for each component.
KOKKOS_FUNCTION Real computeQpResidual(const unsigned int i, const unsigned int qp, ResidualDatum &datum) const
KOKKOS_FUNCTION Real computeQpJacobian(const unsigned int i, const unsigned int j, const unsigned int qp, ResidualDatum &datum) const
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
static InputParameters validParams()
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const Moose::Kokkos::VariableValue _scale_factor
Scale factor.
KokkosCoupledConvectiveHeatFluxBC(const InputParameters &parameters)