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_SINGLEPHASE_FLUXCOMPUTEKERNELBASE_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASE_FLUXCOMPUTEKERNELBASE_HPP
22 
23 #include "common/DataLayouts.hpp"
24 #include "common/DataTypes.hpp"
25 #include "common/GEOS_RAJA_Interface.hpp"
26 #include "constitutive/fluid/singlefluid/SingleFluidBase.hpp"
27 #include "constitutive/fluid/singlefluid/SingleFluidFields.hpp"
28 #include "constitutive/fluid/singlefluid/SlurryFluidBase.hpp"
29 #include "constitutive/fluid/singlefluid/SlurryFluidFields.hpp"
30 #include "constitutive/permeability/PermeabilityBase.hpp"
31 #include "constitutive/permeability/PermeabilityFields.hpp"
37 
38 namespace geos
39 {
40 
41 namespace singlePhaseFVMKernels
42 {
43 
44 /******************************** FluxComputeKernelBase ********************************/
45 
51 {
52 public:
53 
60  template< typename VIEWTYPE >
62 
64 
67  fields::flow::pressure,
68  fields::flow::pressure_n,
69  fields::flow::gravityCoefficient,
70  fields::flow::mobility,
71  fields::flow::dMobility_dPressure >;
72 
74  StencilMaterialAccessors< constitutive::SingleFluidBase,
75  fields::singlefluid::density,
76  fields::singlefluid::dDensity_dPressure >;
77 
78  using SlurryFluidAccessors =
79  StencilMaterialAccessors< constitutive::SlurryFluidBase,
80  fields::singlefluid::density,
81  fields::singlefluid::dDensity_dPressure >;
82 
83  using PermeabilityAccessors =
84  StencilMaterialAccessors< constitutive::PermeabilityBase,
85  fields::permeability::permeability,
86  fields::permeability::dPerm_dPressure >;
87 
89  StencilMaterialAccessors< constitutive::PermeabilityBase,
90  fields::permeability::permeability,
91  fields::permeability::dPerm_dPressure,
92  fields::permeability::dPerm_dDispJump,
93  fields::permeability::permeabilityMultiplier >;
94 
107  DofNumberAccessor const & dofNumberAccessor,
108  SinglePhaseFlowAccessors const & singlePhaseFlowAccessors,
109  SinglePhaseFluidAccessors const & singlePhaseFluidAccessors,
110  PermeabilityAccessors const & permeabilityAccessors,
111  real64 const & dt,
112  CRSMatrixView< real64, globalIndex const > const & localMatrix,
113  arrayView1d< real64 > const & localRhs )
114  : m_rankOffset( rankOffset ),
115  m_dt( dt ),
116  m_dofNumber( dofNumberAccessor.toNestedViewConst() ),
117  m_permeability( permeabilityAccessors.get( fields::permeability::permeability {} ) ),
118  m_dPerm_dPres( permeabilityAccessors.get( fields::permeability::dPerm_dPressure {} ) ),
119  m_ghostRank( singlePhaseFlowAccessors.get( fields::ghostRank {} ) ),
120  m_gravCoef( singlePhaseFlowAccessors.get( fields::flow::gravityCoefficient {} ) ),
121  m_pres( singlePhaseFlowAccessors.get( fields::flow::pressure {} ) ),
122  m_mob( singlePhaseFlowAccessors.get( fields::flow::mobility {} ) ),
123  m_dMob_dPres( singlePhaseFlowAccessors.get( fields::flow::dMobility_dPressure {} ) ),
124  m_dens( singlePhaseFluidAccessors.get( fields::singlefluid::density {} ) ),
125  m_dDens_dPres( singlePhaseFluidAccessors.get( fields::singlefluid::dDensity_dPressure {} ) ),
126  m_localMatrix( localMatrix ),
127  m_localRhs( localRhs )
128  {}
129 
130 protected:
131 
134 
136  real64 const m_dt;
137 
140 
144 
148 
149  // Primary and secondary variables
152 
156 
159  ElementViewConst< arrayView2d< real64 const > > const m_dDens_dPres;
160 
161  // Residual and jacobian
162 
167 };
168 
169 } // namespace singlePhaseFVMKernels
170 
171 } // namespace geos
172 
173 #endif //GEOS_PHYSICSSOLVERS_FLUIDFLOW_SINGLEPHASE_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...
FluxComputeKernelBase(globalIndex const rankOffset, DofNumberAccessor const &dofNumberAccessor, SinglePhaseFlowAccessors const &singlePhaseFlowAccessors, SinglePhaseFluidAccessors const &singlePhaseFluidAccessors, PermeabilityAccessors const &permeabilityAccessors, real64 const &dt, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs)
Constructor for the kernel interface.
ElementViewConst< arrayView1d< real64 const > > const m_mob
Views on fluid mobility.
ElementViewConst< arrayView1d< integer const > > const m_ghostRank
Views on ghost rank numbers and gravity coefficients.
ElementRegionManager::ElementViewConst< VIEWTYPE > ElementViewConst
The type for element-based data. Consists entirely of ArrayView's.
ElementViewConst< arrayView1d< globalIndex const > > const m_dofNumber
Views on dof numbers.
ElementViewConst< arrayView1d< real64 const > > const m_pres
Views on pressure.
arrayView1d< real64 > const m_localRhs
View on the local RHS.
ElementViewConst< arrayView3d< real64 const > > m_permeability
Views on permeability.
ElementViewConst< arrayView2d< real64 const > > const m_dens
Views on fluid density.
globalIndex const m_rankOffset
Offset for my MPI rank.
CRSMatrixView< real64, globalIndex const > const m_localMatrix
View on the local CRS matrix.
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
Trait struct for ghostRank data.
Definition: MeshFields.hpp:100