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 TotalEnergies
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  Diffusion = 1 << 1, // 2
51  Dispersion = 1 << 2, // 4
53  TotalMassEquation = 1 << 3, // 8
55  CheckPhasePresenceInGravity = 1 << 4, // 16
57  C1PPU = 1 << 5, // 32
59  IHU = 1 << 6 // 64
61  // Flag8 = 1 << 7 //128
62 };
63 
64 /******************************** FluxComputeKernelBase ********************************/
65 
71 {
72 public:
73 
80  template< typename VIEWTYPE >
82 
84 
85  using CompFlowAccessors =
87  fields::flow::gravityCoefficient,
88  fields::flow::pressure,
89  fields::flow::dGlobalCompFraction_dGlobalCompDensity,
90  fields::flow::phaseVolumeFraction,
91  fields::flow::dPhaseVolumeFraction,
92  fields::flow::phaseMobility,
93  fields::flow::dPhaseMobility >;
94  using MultiFluidAccessors =
95  StencilMaterialAccessors< constitutive::MultiFluidBase,
96  fields::multifluid::phaseDensity,
97  fields::multifluid::dPhaseDensity,
98  fields::multifluid::phaseMassDensity,
99  fields::multifluid::dPhaseMassDensity,
100  fields::multifluid::phaseCompFraction,
101  fields::multifluid::dPhaseCompFraction >;
102 
103  using CapPressureAccessors =
104  StencilMaterialAccessors< constitutive::CapillaryPressureBase,
105  fields::cappres::phaseCapPressure,
106  fields::cappres::dPhaseCapPressure_dPhaseVolFraction >;
107 
108  using PermeabilityAccessors =
109  StencilMaterialAccessors< constitutive::PermeabilityBase,
110  fields::permeability::permeability,
111  fields::permeability::dPerm_dPressure >;
112 
125  FluxComputeKernelBase( integer const numPhases,
126  globalIndex const rankOffset,
127  DofNumberAccessor const & dofNumberAccessor,
128  CompFlowAccessors const & compFlowAccessors,
129  MultiFluidAccessors const & multiFluidAccessors,
130  real64 const dt,
131  CRSMatrixView< real64, globalIndex const > const & localMatrix,
132  arrayView1d< real64 > const & localRhs,
133  BitFlags< KernelFlags > kernelFlags );
134 
135 protected:
136 
139 
142 
144  real64 const m_dt;
145 
148 
152 
153  // Primary and secondary variables
154 
157 
161 
164 
168 
169  // Residual and jacobian
170 
175 
176  BitFlags< KernelFlags > const m_kernelFlags;
177 };
178 
179 } // namespace isothermalCompositionalMultiphaseFVMKernels
180 
181 } // namespace geos
182 
183 
184 #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.
@ Dispersion
Flag to specify whether dispersion is used or not.
@ C1PPU
Flag indicating whether C1-PPU is used or not.
@ CheckPhasePresenceInGravity
Flag indicating whether gravity treatment is checking phase presence or not.
@ CapPressure
Flag to specify whether capillary pressure is used or not.
@ Diffusion
Flag to specify whether diffusion 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