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
ScalarNSOElemKernel.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 SCALARNSOELEMKERNEL_H
9 #define SCALARNSOELEMKERNEL_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 
29 template<typename AlgTraits>
31 {
32 public:
34  const stk::mesh::BulkData&,
35  const SolutionOptions&,
39  const double,
40  const double,
42 
43  virtual ~ScalarNSOElemKernel() {}
44 
45  virtual void setup(const TimeIntegrator&);
46 
47  virtual void execute(
51 
52 private:
53  ScalarNSOElemKernel() = delete;
54 
63  VectorFieldType *Gjq_{nullptr};
65 
66  const int *lrscv_;
67 
68  double dt_{0.0};
69  double gamma1_{0.0};
70  double gamma2_{0.0};
71  double gamma3_{0.0};
72  const double Cupw_{0.1};
73  const double fourthFac_;
74  const double altResFac_;
75  const double om_altResFac_;
76  const bool shiftedGradOp_;
77  const double nonConservedForm_{0.0};
78  const double small_{1.0e-16};
79 
80  // fixed scratch space
81  Kokkos::View<DoubleType[AlgTraits::numScsIp_][AlgTraits::nodesPerElement_]> v_shape_function_{"v_shape_function"};
82 };
83 
84 } // nalu
85 } // sierra
86 
87 #endif /* SCALARNSOELEMKERNEL_H */
Definition: TimeIntegrator.h:26
Definition: ABLForcingAlgorithm.C:26
const double om_altResFac_
Definition: ScalarNSOElemKernel.h:75
virtual ~ScalarNSOElemKernel()
Definition: ScalarNSOElemKernel.h:43
ScalarFieldType * densityNm1_
Definition: ScalarNSOElemKernel.h:58
Kokkos::View< DoubleType[AlgTraits::numScsIp_][AlgTraits::nodesPerElement_]> v_shape_function_
Definition: ScalarNSOElemKernel.h:81
ScalarFieldType * scalarQNm1_
Definition: ScalarNSOElemKernel.h:55
Definition: ElemDataRequests.h:66
const double Cupw_
Definition: ScalarNSOElemKernel.h:72
Definition: SolutionOptions.h:38
const double altResFac_
Definition: ScalarNSOElemKernel.h:74
stk::mesh::Field< double, stk::mesh::Cartesian > VectorFieldType
Definition: FieldTypeDef.h:24
virtual void setup(const TimeIntegrator &)
Perform pre-timestep work for the computational kernel.
Definition: ScalarNSOElemKernel.C:104
VectorFieldType * coordinates_
Definition: ScalarNSOElemKernel.h:64
double gamma1_
Definition: ScalarNSOElemKernel.h:69
const double small_
Definition: ScalarNSOElemKernel.h:78
double dt_
Definition: ScalarNSOElemKernel.h:68
stk::mesh::Field< double > ScalarFieldType
Definition: FieldTypeDef.h:19
const int * lrscv_
Definition: ScalarNSOElemKernel.h:66
ScalarFieldType * densityN_
Definition: ScalarNSOElemKernel.h:59
double gamma3_
Definition: ScalarNSOElemKernel.h:71
const double fourthFac_
Definition: ScalarNSOElemKernel.h:73
double gamma2_
Definition: ScalarNSOElemKernel.h:70
Definition: UnitTestMasterElements.C:367
Base class for computational kernels in Nalu.
Definition: Kernel.h:63
VectorFieldType * Gjq_
Definition: ScalarNSOElemKernel.h:63
Kokkos::View< T, Kokkos::LayoutRight, DeviceShmem, Kokkos::MemoryUnmanaged > SharedMemView
Definition: KokkosInterface.h:25
ScalarFieldType * scalarQN_
Definition: ScalarNSOElemKernel.h:56
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: ScalarNSOElemKernel.C:114
ScalarFieldType * scalarQNp1_
Definition: ScalarNSOElemKernel.h:57
Definition: ScratchViews.h:82
VectorFieldType * velocityRTM_
Definition: ScalarNSOElemKernel.h:62
const bool shiftedGradOp_
Definition: ScalarNSOElemKernel.h:76
ScalarFieldType * densityNp1_
Definition: ScalarNSOElemKernel.h:60
NSO for momentum equation.
Definition: ScalarNSOElemKernel.h:30
const double nonConservedForm_
Definition: ScalarNSOElemKernel.h:77
ScalarFieldType * diffFluxCoeff_
Definition: ScalarNSOElemKernel.h:61