Nalu
Nalu: a generalized unstructured massively parallel low Mach flow code designed to support a variety of energy applications of interest (most notably Wind ECP) built on the Sierra Toolkit and Trilinos solver Tpetra/Epetra stack. The open source BSD, clause 3 license model has been chosen for the code base. See LICENSE for more information. http://NaluCFD.org
ScalarUpwAdvDiffElemKernel.h
Go to the documentation of this file.
1 /*------------------------------------------------------------------------*/
2 /* Copyright 2014 National Renewable Energy Laboratory. */
3 /* This software is released under the license detailed */
4 /* in the file, LICENSE, which is located in the top-level Nalu */
5 /* directory structure */
6 /*------------------------------------------------------------------------*/
7 
8 #ifndef SCALARUPWADVDIFFELEMKERNEL_H
9 #define SCALARUPWADVDIFFELEMKERNEL_H
10 
11 #include "Kernel.h"
12 #include "FieldTypeDef.h"
13 
14 #include <stk_mesh/base/BulkData.hpp>
15 #include <stk_mesh/base/Entity.hpp>
16 
17 #include <Kokkos_Core.hpp>
18 
19 namespace sierra {
20 namespace nalu {
21 
22 class SolutionOptions;
23 class MasterElement;
24 class ElemDataRequests;
25 class PecletFunction;
26 class EquationSystem;
27 
30 template<typename AlgTraits>
32 {
33 public:
35  const stk::mesh::BulkData&,
36  const SolutionOptions&,
42 
44 
45  virtual void setup(const TimeIntegrator&);
46 
50  virtual void execute(
54 
55  virtual DoubleType van_leer(
56  const DoubleType &dqm,
57  const DoubleType &dqp);
58 
59 private:
60  ScalarUpwAdvDiffElemKernel() = delete;
61 
63 
65  VectorFieldType *Gjq_{nullptr};
71 
73  const int* lrscv_;
74 
76  const std::string dofName_;
77 
78  double alpha_;
79  double alphaUpw_;
80  double hoUpwind_;
82  double om_alpha_;
83  double om_alphaUpw_;
84  const bool shiftedGradOp_;
85  const double small_{1.0e-16};
86 
89 
91  Kokkos::View<DoubleType[AlgTraits::numScsIp_][AlgTraits::nodesPerElement_]> v_shape_function_ { "view_shape_func" };
92 
93 };
94 
95 } // nalu
96 } // sierra
97 
98 #endif /* SCALARUPWADVDIFFELEMKERNEL_H */
virtual DoubleType van_leer(const DoubleType &dqm, const DoubleType &dqp)
Definition: ScalarUpwAdvDiffElemKernel.C:268
Definition: TimeIntegrator.h:26
double om_alpha_
Definition: ScalarUpwAdvDiffElemKernel.h:82
Definition: ABLForcingAlgorithm.C:26
double om_alphaUpw_
Definition: ScalarUpwAdvDiffElemKernel.h:83
ScalarFieldType * diffFluxCoeff_
Definition: ScalarUpwAdvDiffElemKernel.h:66
stk::mesh::Field< double, stk::mesh::SimpleArrayTag > GenericFieldType
Definition: FieldTypeDef.h:27
PecletFunction * pecletFunction_
Peclet function.
Definition: ScalarUpwAdvDiffElemKernel.h:88
virtual void execute(SharedMemView< DoubleType ** > &, SharedMemView< DoubleType * > &, ScratchViews< DoubleType > &)
Execute the kernel within a Kokkos loop and populate the LHS and RHS for the linear solve...
Definition: ScalarUpwAdvDiffElemKernel.C:112
const int * lrscv_
Left right node indicators.
Definition: ScalarUpwAdvDiffElemKernel.h:73
const double small_
Definition: ScalarUpwAdvDiffElemKernel.h:85
ScalarFieldType * scalarQ_
Definition: ScalarUpwAdvDiffElemKernel.h:64
Definition: ElemDataRequests.h:66
virtual ~ScalarUpwAdvDiffElemKernel()
Definition: ScalarUpwAdvDiffElemKernel.C:91
VectorFieldType * Gjq_
Definition: ScalarUpwAdvDiffElemKernel.h:65
VectorFieldType * velocityRTM_
Definition: ScalarUpwAdvDiffElemKernel.h:67
Definition: SolutionOptions.h:38
stk::mesh::Field< double, stk::mesh::Cartesian > VectorFieldType
Definition: FieldTypeDef.h:24
Base class representation of a PDE.
Definition: EquationSystem.h:46
stk::mesh::Field< double > ScalarFieldType
Definition: FieldTypeDef.h:19
bool useLimiter_
Definition: ScalarUpwAdvDiffElemKernel.h:81
const SolutionOptions & solnOpts_
Definition: ScalarUpwAdvDiffElemKernel.h:62
VectorFieldType * coordinates_
Definition: ScalarUpwAdvDiffElemKernel.h:69
const bool shiftedGradOp_
Definition: ScalarUpwAdvDiffElemKernel.h:84
GenericFieldType * massFlowRate_
Definition: ScalarUpwAdvDiffElemKernel.h:70
Definition: UnitTestMasterElements.C:367
SimdDouble DoubleType
Definition: SimdInterface.h:27
Base class for computational kernels in Nalu.
Definition: Kernel.h:63
double hoUpwind_
Definition: ScalarUpwAdvDiffElemKernel.h:80
Kokkos::View< DoubleType[AlgTraits::numScsIp_][AlgTraits::nodesPerElement_]> v_shape_function_
Shape functions.
Definition: ScalarUpwAdvDiffElemKernel.h:91
double alpha_
Definition: ScalarUpwAdvDiffElemKernel.h:78
double alphaUpw_
Definition: ScalarUpwAdvDiffElemKernel.h:79
Kokkos::View< T, Kokkos::LayoutRight, DeviceShmem, Kokkos::MemoryUnmanaged > SharedMemView
Definition: KokkosInterface.h:25
Definition: PecletFunction.h:15
const std::string dofName_
Name of the primitive variable (for upwind options lookup in solution options)
Definition: ScalarUpwAdvDiffElemKernel.h:76
Definition: ScratchViews.h:82
CVFEM scalar upwind advection/diffusion kernel.
Definition: ScalarUpwAdvDiffElemKernel.h:31
virtual void setup(const TimeIntegrator &)
Perform pre-timestep work for the computational kernel.
Definition: ScalarUpwAdvDiffElemKernel.C:98
ScalarFieldType * density_
Definition: ScalarUpwAdvDiffElemKernel.h:68