GEOS
AquiferBCKernel.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_AQUIFERBCKERNEL_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_AQUIFERBCKERNEL_HPP
22 
23 #include "codingUtilities/Utilities.hpp"
24 #include "common/DataLayouts.hpp"
25 #include "common/DataTypes.hpp"
26 #include "common/GEOS_RAJA_Interface.hpp"
27 #include "constitutive/fluid/multifluid/MultiFluidBase.hpp"
28 #include "constitutive/fluid/multifluid/MultiFluidFields.hpp"
35 
36 namespace geos
37 {
38 
39 namespace isothermalCompositionalMultiphaseFVMKernels
40 {
41 
42 /******************************** AquiferBCKernel ********************************/
43 
48 {
49 
56  template< typename VIEWTYPE >
58 
59  using CompFlowAccessors =
61  fields::flow::pressure,
62  fields::flow::pressure_n,
63  fields::flow::gravityCoefficient,
64  fields::flow::phaseVolumeFraction,
65  fields::flow::dPhaseVolumeFraction,
66  fields::flow::dGlobalCompFraction_dGlobalCompDensity >;
67 
68  using MultiFluidAccessors =
69  StencilMaterialAccessors< constitutive::MultiFluidBase,
70  fields::multifluid::phaseDensity,
71  fields::multifluid::dPhaseDensity,
72  fields::multifluid::phaseCompFraction,
73  fields::multifluid::dPhaseCompFraction >;
74 
75  template< integer NC >
77  inline
78  static void
79  compute( integer const numPhases,
80  integer const ipWater,
81  bool const allowAllPhasesIntoAquifer,
82  real64 const aquiferVolFlux,
83  real64 const dAquiferVolFlux_dPres,
84  real64 const aquiferWaterPhaseDens,
85  arrayView1d< real64 const > const & aquiferWaterPhaseCompFrac,
93  real64 const dt,
94  real64 ( &localFlux )[NC],
95  real64 ( &localFluxJacobian )[NC][NC+1] );
96 
97  template< integer NC >
98  static void
99  launch( integer const numPhases,
100  integer const ipWater,
101  bool const allowAllPhasesIntoAquifer,
102  integer const useTotalMassEquation,
103  BoundaryStencil const & stencil,
104  globalIndex const rankOffset,
106  AquiferBoundaryCondition::KernelWrapper const & aquiferBCWrapper,
107  real64 const aquiferWaterPhaseDens,
108  arrayView1d< real64 const > const & aquiferWaterPhaseCompFrac,
109  ElementViewConst< arrayView1d< integer const > > const & ghostRank,
112  ElementViewConst< arrayView1d< real64 const > > const & gravCoef,
120  real64 const timeAtBeginningOfStep,
121  real64 const dt,
122  CRSMatrixView< real64, globalIndex const > const & localMatrix,
123  arrayView1d< real64 > const & localRhs );
124 
125 };
126 
127 } // namespace isothermalCompositionalMultiphaseFVMKernels
128 
129 } // namespace geos
130 
131 #endif //GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_AQUIFERBCKERNEL_HPP
#define GEOS_HOST_DEVICE
Marks a host-device function.
Definition: GeosxMacros.hpp:49
Provides management of the boundary stencil points (stencils used to prescribe boundary conditions on...
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.
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
ArraySlice< T, 2, USD > arraySlice2d
Alias for 2D array slice.
Definition: DataTypes.hpp:200
ArraySlice< T, 3, USD > arraySlice3d
Alias for 3D array slice.
Definition: DataTypes.hpp:216
ArrayView< T, 5, USD > arrayView5d
Alias for 5D array view.
Definition: DataTypes.hpp:244
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
ArraySlice< T, 1, USD > arraySlice1d
Alias for 1D array slice.
Definition: DataTypes.hpp:184
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:82
ArrayView< T, 4, USD > arrayView4d
Alias for 4D array view.
Definition: DataTypes.hpp:228
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:196
ArrayView< T, 3, USD > arrayView3d
Alias for 3D array view.
Definition: DataTypes.hpp:212
Trait struct for ghostRank data.
Definition: MeshFields.hpp:100
Functions to assemble aquifer boundary condition contributions to residual and Jacobian.
ElementRegionManager::ElementViewConst< VIEWTYPE > ElementViewConst
The type for element-based data. Consists entirely of ArrayView's.