https://mooseframework.inl.gov
KokkosHeatConductionTimeDerivative.h
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 
10 #pragma once
11 
12 #include "KokkosTimeDerivative.h"
13 
23 {
24 public:
27 
29 
31  template <typename Derived>
32  KOKKOS_FUNCTION Real computeQpResidual(const unsigned int qp, AssemblyDatum & datum) const;
33 
35  template <typename Derived>
36  KOKKOS_FUNCTION Real computeQpJacobian(const unsigned int j,
37  const unsigned int qp,
38  AssemblyDatum & datum) const;
39 
40 protected:
45 };
46 
47 template <typename Derived>
48 KOKKOS_FUNCTION Real
50  AssemblyDatum & datum) const
51 {
52  return _specific_heat(datum, qp) * _density(datum, qp) *
53  KokkosTimeDerivative::computeQpResidual<Derived>(qp, datum);
54 }
55 
56 template <typename Derived>
57 KOKKOS_FUNCTION Real
59  const unsigned int qp,
60  AssemblyDatum & datum) const
61 {
62  const Real cp = _specific_heat(datum, qp);
63  const Real rho = _density(datum, qp);
64 
65  auto jac = cp * rho * KokkosTimeDerivative::computeQpJacobian<Derived>(j, qp, datum);
66 
68  jac += _d_specific_heat_dT(datum, qp) * rho * _phi(datum, j, qp) *
69  KokkosTimeDerivative::computeQpResidual<Derived>(qp, datum);
70  if (_d_density_dT)
71  jac += cp * _d_density_dT(datum, qp) * _phi(datum, j, qp) *
72  KokkosTimeDerivative::computeQpResidual<Derived>(qp, datum);
73 
74  return jac;
75 }
const InputParameters & parameters() const
Moose::Kokkos::MaterialProperty< Real > _d_specific_heat_dT
Moose::Kokkos::MaterialProperty< Real > _density
static const std::string cp
Definition: NS.h:125
KOKKOS_FUNCTION Real computeQpJacobian(const unsigned int j, const unsigned int qp, AssemblyDatum &datum) const
Compute the jacobian of the Heat Equation time derivative.
Moose::Kokkos::MaterialProperty< Real > _d_density_dT
static InputParameters validParams()
Contructor for Heat Equation time derivative term.
const double rho
Moose::Kokkos::MaterialProperty< Real > _specific_heat
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
A class for defining the time derivative of the heat equation.
KOKKOS_FUNCTION Real computeQpResidual(const unsigned int qp, AssemblyDatum &datum) const
Compute the residual of the Heat Equation time derivative.
static const std::complex< double > j(0, 1)
Complex number "j" (also known as "i")
const VariablePhiValue _phi
KokkosHeatConductionTimeDerivative(const InputParameters &parameters)