https://mooseframework.inl.gov
Loading...
Searching...
No Matches
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
13
23{
24public:
27
29
31 template <typename Derived>
32 KOKKOS_FUNCTION Real precomputeQpResidual(const unsigned int qp, AssemblyDatum & datum) const;
33
35 template <typename Derived>
36 KOKKOS_FUNCTION Real precomputeQpJacobian(const unsigned int j,
37 const unsigned int qp,
38 AssemblyDatum & datum) const;
39
40protected:
45};
46
47template <typename Derived>
48KOKKOS_FUNCTION Real
50 AssemblyDatum & datum) const
51{
52 return _specific_heat(datum, qp) * _density(datum, qp) *
53 KokkosTimeDerivative::precomputeQpResidual<Derived>(qp, datum);
54}
55
56template <typename Derived>
57KOKKOS_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::precomputeQpJacobian<Derived>(j, qp, datum);
66
68 jac += _d_specific_heat_dT(datum, qp) * rho * _phi(datum, j, qp) *
69 KokkosTimeDerivative::precomputeQpResidual<Derived>(qp, datum);
70 if (_d_density_dT)
71 jac += cp * _d_density_dT(datum, qp) * _phi(datum, j, qp) *
72 KokkosTimeDerivative::precomputeQpResidual<Derived>(qp, datum);
73
74 return jac;
75}
const double rho
A class for defining the time derivative of the heat equation.
KokkosHeatConductionTimeDerivative(const InputParameters &parameters)
Moose::Kokkos::MaterialProperty< Real > _d_density_dT
Moose::Kokkos::MaterialProperty< Real > _density
Moose::Kokkos::MaterialProperty< Real > _specific_heat
Moose::Kokkos::MaterialProperty< Real > _d_specific_heat_dT
KOKKOS_FUNCTION Real precomputeQpJacobian(const unsigned int j, const unsigned int qp, AssemblyDatum &datum) const
Compute the jacobian of the Heat Equation time derivative.
static InputParameters validParams()
Contructor for Heat Equation time derivative term.
KOKKOS_FUNCTION Real precomputeQpResidual(const unsigned int qp, AssemblyDatum &datum) const
Compute the residual of the Heat Equation time derivative.
const InputParameters & parameters() const
const VariablePhiValue _phi