GEOS
FluxComputeKernelBase.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2016-2024 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2024 Total, S.A
7  * Copyright (c) 2018-2024 The Board of Trustees of the Leland Stanford Junior University
8  * Copyright (c) 2023-2024 Chevron
9  * Copyright (c) 2019- GEOS/GEOSX Contributors
10  * All rights reserved
11  *
12  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
13  * ------------------------------------------------------------------------------------------------------------
14  */
15 
20 #ifndef GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_FLUXCOMPUTEKERNELBASE_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_FLUXCOMPUTEKERNELBASE_HPP
22 
23 #include "common/DataLayouts.hpp"
24 #include "common/DataTypes.hpp"
25 #include "common/GEOS_RAJA_Interface.hpp"
26 #include "constitutive/capillaryPressure/CapillaryPressureFields.hpp"
27 #include "constitutive/capillaryPressure/CapillaryPressureBase.hpp"
28 #include "constitutive/fluid/multifluid/MultiFluidBase.hpp"
29 #include "constitutive/fluid/multifluid/MultiFluidFields.hpp"
30 #include "constitutive/permeability/PermeabilityBase.hpp"
31 #include "constitutive/permeability/PermeabilityFields.hpp"
36 
37 
38 namespace geos
39 {
40 
41 namespace isothermalCompositionalMultiphaseFVMKernels
42 {
43 
44 enum class KernelFlags
45 {
47  CapPressure = 1 << 0, // 1
49  TotalMassEquation = 1 << 1, // 2
51  C1PPU = 1 << 2, // 4
53  IHU = 1 << 3 // 8
55  // Flag5 = 1 << 4, // 16
56  // Flag6 = 1 << 5, // 32
57  // Flag7 = 1 << 6, // 64
58  // Flag8 = 1 << 7 //128
59 };
60 
61 /******************************** FluxComputeKernelBase ********************************/
62 
68 {
69 public:
70 
77  template< typename VIEWTYPE >
79 
81 
82  using CompFlowAccessors =
84  fields::flow::gravityCoefficient,
85  fields::flow::pressure,
86  fields::flow::dGlobalCompFraction_dGlobalCompDensity,
87  fields::flow::phaseVolumeFraction,
88  fields::flow::dPhaseVolumeFraction,
89  fields::flow::phaseMobility,
90  fields::flow::dPhaseMobility >;
91  using MultiFluidAccessors =
92  StencilMaterialAccessors< constitutive::MultiFluidBase,
93  fields::multifluid::phaseDensity,
94  fields::multifluid::dPhaseDensity,
95  fields::multifluid::phaseMassDensity,
96  fields::multifluid::dPhaseMassDensity,
97  fields::multifluid::phaseCompFraction,
98  fields::multifluid::dPhaseCompFraction >;
99 
100  using CapPressureAccessors =
101  StencilMaterialAccessors< constitutive::CapillaryPressureBase,
102  fields::cappres::phaseCapPressure,
103  fields::cappres::dPhaseCapPressure_dPhaseVolFraction >;
104 
105  using PermeabilityAccessors =
106  StencilMaterialAccessors< constitutive::PermeabilityBase,
107  fields::permeability::permeability,
108  fields::permeability::dPerm_dPressure >;
109 
122  FluxComputeKernelBase( integer const numPhases,
123  globalIndex const rankOffset,
124  DofNumberAccessor const & dofNumberAccessor,
125  CompFlowAccessors const & compFlowAccessors,
126  MultiFluidAccessors const & multiFluidAccessors,
127  real64 const dt,
128  CRSMatrixView< real64, globalIndex const > const & localMatrix,
129  arrayView1d< real64 > const & localRhs,
130  BitFlags< KernelFlags > kernelFlags );
131 
132 protected:
133 
136 
139 
141  real64 const m_dt;
142 
145 
149 
150  // Primary and secondary variables
151 
154 
158 
161 
165 
166  // Residual and jacobian
167 
172 
173  BitFlags< KernelFlags > const m_kernelFlags;
174 };
175 
176 } // namespace isothermalCompositionalMultiphaseFVMKernels
177 
178 } // namespace geos
179 
180 
181 #endif //GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_FLUXCOMPUTEKERNELBASE_HPP
array1d< array1d< VIEWTYPE > > ElementViewAccessor
The ElementViewAccessor at the ElementRegionManager level is an array of array of VIEWTYPE.
typename ElementViewAccessor< VIEWTYPE >::NestedViewTypeConst ElementViewConst
The ElementViewAccessor at the ElementRegionManager level is the type resulting from ElementViewAcces...
A struct to automatically construct and store element view accessors.
A struct to automatically construct and store element view accessors.
Base class for FluxComputeKernel that holds all data not dependent on template parameters (like stenc...
ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const m_phaseVolFrac
Views on phase volume fractions.
ElementViewConst< arrayView1d< globalIndex const > > const m_dofNumber
Views on dof numbers.
ElementViewConst< arrayView1d< real64 const > > const m_pres
Views on pressure.
ElementViewConst< arrayView1d< integer const > > const m_ghostRank
Views on ghost rank numbers and gravity coefficients.
ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_COMP > > const m_phaseCompFrac
Views on phase component fractions.
CRSMatrixView< real64, globalIndex const > const m_localMatrix
View on the local CRS matrix.
ElementRegionManager::ElementViewConst< VIEWTYPE > ElementViewConst
The type for element-based data. Consists entirely of ArrayView's.
ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const m_dCompFrac_dCompDens
Views on derivatives of comp fractions.
FluxComputeKernelBase(integer const numPhases, globalIndex const rankOffset, DofNumberAccessor const &dofNumberAccessor, CompFlowAccessors const &compFlowAccessors, MultiFluidAccessors const &multiFluidAccessors, real64 const dt, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs, BitFlags< KernelFlags > kernelFlags)
Constructor for the kernel interface.
@ C1PPU
Flag indicating whether C1-PPU is used or not.
@ CapPressure
Flag to specify whether capillary pressure is used or not.
@ IHU
Flag indicating whether IHU is used or not.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:180
LvArray::CRSMatrixView< T, COL_INDEX, localIndex const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix View.
Definition: DataTypes.hpp:310
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
Definition: DataTypes.hpp:88
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:82
Trait struct for ghostRank data.
Definition: MeshFields.hpp:100