https://mooseframework.inl.gov
Loading...
Searching...
No Matches
KokkosLinearFVDiffusion.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
14
20{
21public:
23
25
26 virtual bool needsBoundaryNormalGradientData() const override { return true; }
27 virtual bool hasInternalRightHandSideContribution() const override { return false; }
28
29 template <typename Derived>
30 KOKKOS_FUNCTION Real computeInternalMatrixContribution(const FVDatum & datum) const;
31 template <typename Derived>
32 KOKKOS_FUNCTION Real computeInternalNeighborMatrixContribution(const FVDatum & datum) const;
33 template <typename Derived>
34 KOKKOS_FUNCTION Real computeBoundaryMatrixContribution(
35 const FVDatum & datum, const int bc_index, const MOOSE_KOKKOS_INDEX_TYPE bc_face_index) const;
36 template <typename Derived>
38 const FVDatum & datum, const int bc_index, const MOOSE_KOKKOS_INDEX_TYPE bc_face_index) const;
39
40private:
49 KOKKOS_FUNCTION Real faceConductance(const FVDatum & datum) const;
50
52 KOKKOS_FUNCTION Real faceDiffusionCoefficient(const FVDatum & datum) const;
53
56};
57
58template <typename Derived>
59KOKKOS_FUNCTION Real
64
65template <typename Derived>
66KOKKOS_FUNCTION Real
71
72template <typename Derived>
73KOKKOS_FUNCTION Real
75 const FVDatum & datum, const int bc_index, const MOOSE_KOKKOS_INDEX_TYPE bc_face_index) const
76{
77 return -faceDiffusionCoefficient(datum) * datum.faceArea() *
78 boundaryNormalGradientCoefficient(bc_index, bc_face_index);
79}
80
81template <typename Derived>
82KOKKOS_FUNCTION Real
84 const FVDatum & datum, const int bc_index, const MOOSE_KOKKOS_INDEX_TYPE bc_face_index) const
85{
86 return faceDiffusionCoefficient(datum) * datum.faceArea() *
87 boundaryNormalGradientSource(bc_index, bc_face_index);
88}
89
90KOKKOS_FUNCTION inline Real
92{
93 return faceDiffusionCoefficient(datum) * datum.faceArea() / datum.faceDCNMag();
94}
95
96KOKKOS_FUNCTION inline Real
The main MOOSE class responsible for handling user-defined parameters in almost every MOOSE system.
Kokkos linear finite volume flux kernel implementing the diffusion term.
virtual bool hasInternalRightHandSideContribution() const override
Whether this kernel has nonzero internal-face RHS contributions.
KOKKOS_FUNCTION Real faceDiffusionCoefficient(const FVDatum &datum) const
Method for evaluating the face diffusion coefficient.
virtual bool needsBoundaryNormalGradientData() const override
Whether this kernel needs boundary normal gradient data from its boundary conditions.
KOKKOS_FUNCTION Real computeBoundaryMatrixContribution(const FVDatum &datum, const int bc_index, const MOOSE_KOKKOS_INDEX_TYPE bc_face_index) const
static InputParameters validParams()
KOKKOS_FUNCTION Real computeBoundaryRightHandSideContribution(const FVDatum &datum, const int bc_index, const MOOSE_KOKKOS_INDEX_TYPE bc_face_index) const
KokkosLinearFVDiffusion(const InputParameters &parameters)
Moose::Kokkos::ReferenceWrapper< const KokkosParsedFunction > _diffusion_coeff
Diffusion coefficient.
KOKKOS_FUNCTION Real faceConductance(const FVDatum &datum) const
Method for evaluating the face diffusion coefficient times the face area divided by the distance betw...
KOKKOS_FUNCTION Real computeInternalNeighborMatrixContribution(const FVDatum &datum) const
KOKKOS_FUNCTION Real computeInternalMatrixContribution(const FVDatum &datum) const
KOKKOS_FUNCTION Real value(Real t, Real3 p) const
const InputParameters & parameters() const
Get the parameters of the object.
Definition MooseBase.h:131
Device-side geometric context for finite volume kernels and boundary conditions.
KOKKOS_FUNCTION Real3 faceCentroid() const
Get the centroid of the current element side.
KOKKOS_FUNCTION Real faceArea() const
Get the coordinate-weighted area of the current element side.
KOKKOS_FUNCTION Real faceDCNMag() const
Get the distance from the current element centroid to its neighbor centroid.
Base class for Kokkos linear finite volume kernels that contribute on faces (flux terms).
KOKKOS_FUNCTION Real boundaryNormalGradientCoefficient(const int bc_index, const MOOSE_KOKKOS_INDEX_TYPE bc_face_index) const
Boundary normal gradient coefficient for this boundary face.
KOKKOS_FUNCTION Real boundaryNormalGradientSource(const int bc_index, const MOOSE_KOKKOS_INDEX_TYPE bc_face_index) const
Boundary normal gradient source for this boundary face.
Scalar< Real > _t
TODO: Move to TransientInterface.
The Kokkos object that can hold the reference of a variable.