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_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 
65  using SingleFluidProp = constitutive::SingleFluidVar< real64, 2, constitutive::singlefluid::LAYOUT_FLUID, constitutive::singlefluid::LAYOUT_FLUID_DER >;
66 
69  fields::flow::pressure,
70  fields::flow::pressure_n,
71  fields::flow::gravityCoefficient,
72  fields::flow::mobility,
73  fields::flow::dMobility >;
74 
76  StencilMaterialAccessors< constitutive::SingleFluidBase,
77  fields::singlefluid::density,
78  fields::singlefluid::dDensity >;
79 
80  using SlurryFluidAccessors =
81  StencilMaterialAccessors< constitutive::SlurryFluidBase,
82  fields::singlefluid::density,
83  fields::singlefluid::dDensity >;
84 
85  using PermeabilityAccessors =
86  StencilMaterialAccessors< constitutive::PermeabilityBase,
87  fields::permeability::permeability,
88  fields::permeability::dPerm_dPressure >;
89 
91  StencilMaterialAccessors< constitutive::PermeabilityBase,
92  fields::permeability::permeability,
93  fields::permeability::dPerm_dPressure,
94  fields::permeability::dPerm_dDispJump,
95  fields::permeability::permeabilityMultiplier >;
96 
109  DofNumberAccessor const & dofNumberAccessor,
110  SinglePhaseFlowAccessors const & singlePhaseFlowAccessors,
111  SinglePhaseFluidAccessors const & singlePhaseFluidAccessors,
112  PermeabilityAccessors const & permeabilityAccessors,
113  real64 const & dt,
114  CRSMatrixView< real64, globalIndex const > const & localMatrix,
115  arrayView1d< real64 > const & localRhs )
116  : m_rankOffset( rankOffset ),
117  m_dt( dt ),
118  m_dofNumber( dofNumberAccessor.toNestedViewConst() ),
119  m_permeability( permeabilityAccessors.get( fields::permeability::permeability {} ) ),
120  m_dPerm_dPres( permeabilityAccessors.get( fields::permeability::dPerm_dPressure {} ) ),
121  m_ghostRank( singlePhaseFlowAccessors.get( fields::ghostRank {} ) ),
122  m_gravCoef( singlePhaseFlowAccessors.get( fields::flow::gravityCoefficient {} ) ),
123  m_pres( singlePhaseFlowAccessors.get( fields::flow::pressure {} ) ),
124  m_mob( singlePhaseFlowAccessors.get( fields::flow::mobility {} ) ),
125  m_dMob( singlePhaseFlowAccessors.get( fields::flow::dMobility {} ) ),
126  m_dens( singlePhaseFluidAccessors.get( fields::singlefluid::density {} ) ),
127  m_dDens( singlePhaseFluidAccessors.get( fields::singlefluid::dDensity {} ) ),
128  m_localMatrix( localMatrix ),
129  m_localRhs( localRhs )
130  {}
131 
132 protected:
133 
136 
138  real64 const m_dt;
139 
142 
146 
150 
151  // Primary and secondary variables
154 
159 
163 
164  // Residual and jacobian
165 
170 };
171 
172 } // namespace singlePhaseFVMKernels
173 
174 } // namespace geos
175 
176 #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, constitutive::singlefluid::USD_FLUID > > 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