GEOS
ThermalDirichletFluxComputeKernel.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_THERMALDIRICHLETFLUXCOMPUTEKERNEL_HPP
21 #define GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_THERMALDIRICHLETFLUXCOMPUTEKERNEL_HPP
22 
24 #include "constitutive/thermalConductivity/MultiPhaseThermalConductivityBase.hpp"
25 #include "constitutive/thermalConductivity/ThermalConductivityFields.hpp"
26 
27 namespace geos
28 {
29 
30 namespace thermalCompositionalMultiphaseFVMKernels
31 {
32 
33 /******************************** DirichletFluxComputeKernel ********************************/
34 
43 template< typename FLUIDWRAPPER, typename POLICY, integer NUM_COMP, integer NUM_DOF = NUM_COMP + 2 >
45  POLICY,
46  NUM_COMP,
47  NUM_DOF >
48 {
49 public:
50 
57  template< typename VIEWTYPE >
59 
61  using DofNumberAccessor = AbstractBase::DofNumberAccessor;
66 
67  using AbstractBase::m_dt;
71  using AbstractBase::m_gravCoef;
73  using AbstractBase::m_dPhaseCompFrac;
75 
77  using Base::numComp;
78  using Base::numDof;
79  using Base::numEqn;
80  using Base::m_phaseMob;
81  using Base::m_dPhaseMob;
82  using Base::m_dPhaseMassDens;
84  using Base::m_seri;
85  using Base::m_sesri;
86  using Base::m_sei;
87  using Base::m_faceTemp;
89 
92 
94  StencilMaterialAccessors< constitutive::MultiFluidBase,
95  fields::multifluid::phaseEnthalpy,
96  fields::multifluid::dPhaseEnthalpy >;
97 
99  StencilMaterialAccessors< constitutive::MultiPhaseThermalConductivityBase,
100  fields::thermalconductivity::effectiveConductivity >;
101  // for now, we treat thermal conductivity explicitly
102 
123  DirichletFluxComputeKernel( integer const numPhases,
124  globalIndex const rankOffset,
125  FaceManager const & faceManager,
126  BoundaryStencilWrapper const & stencilWrapper,
127  FLUIDWRAPPER const & fluidWrapper,
128  DofNumberAccessor const & dofNumberAccessor,
129  CompFlowAccessors const & compFlowAccessors,
130  ThermalCompFlowAccessors const & thermalCompFlowAccessors,
131  MultiFluidAccessors const & multiFluidAccessors,
132  ThermalMultiFluidAccessors const & thermalMultiFluidAccessors,
133  CapPressureAccessors const & capPressureAccessors,
134  PermeabilityAccessors const & permeabilityAccessors,
135  ThermalConductivityAccessors const & thermalConductivityAccessors,
136  real64 const dt,
137  CRSMatrixView< real64, globalIndex const > const & localMatrix,
138  arrayView1d< real64 > const & localRhs,
139  BitFlags< isothermalCompositionalMultiphaseFVMKernels::KernelFlags > kernelFlags );
140 
142  {
143 public:
144 
151  StackVariables( localIndex const size, localIndex numElems )
152  : Base::StackVariables( size, numElems )
153  {}
154 
155  using Base::StackVariables::transmissibility;
159 
160  // Component fluxes and derivatives
161 
164 
165 
166  // Energy fluxes and derivatives
167 
176 
177  };
178 
183  void launchKernel( localIndex const numConnections );
184 
191  void computeFlux( localIndex const iconn,
192  StackVariables & stack ) const;
193 
200  void complete( localIndex const iconn,
201  StackVariables & stack ) const;
202 
203 protected:
204 
207 
211 
214  // for now, we treat thermal conductivity explicitly
215 };
216 
220 template< typename POLICY, typename STENCILWRAPPER >
222 {
223 public:
224 
242  static void
243  createAndLaunch( integer const numComps,
244  integer const numPhases,
245  globalIndex const rankOffset,
246  BitFlags< isothermalCompositionalMultiphaseFVMKernels::KernelFlags > kernelFlags,
247  string const & dofKey,
248  string const & solverName,
249  FaceManager const & faceManager,
250  ElementRegionManager const & elemManager,
251  STENCILWRAPPER const & stencilWrapper,
252  constitutive::MultiFluidBase & fluidBase,
253  real64 const dt,
254  CRSMatrixView< real64, globalIndex const > const & localMatrix,
255  arrayView1d< real64 > const & localRhs );
256 };
257 
258 } // namespace thermalCompositionalMultiphaseFVMKernels
259 
260 } // namespace geos
261 
262 
263 #endif //GEOS_PHYSICSSOLVERS_FLUIDFLOW_COMPOSITIONAL_THERMALDIRICHLETFLUXCOMPUTEKERNEL_HPP
#define GEOS_HOST_DEVICE
Marks a host-device function.
Definition: GeosxMacros.hpp:49
The ElementRegionManager class provides an interface to ObjectManagerBase in order to manage ElementR...
typename ElementViewAccessor< VIEWTYPE >::NestedViewTypeConst ElementViewConst
The ElementViewAccessor at the ElementRegionManager level is the type resulting from ElementViewAcces...
The FaceManager class provides an interface to ObjectManagerBase in order to manage face data.
Definition: FaceManager.hpp:44
A struct to automatically construct and store element view accessors.
A struct to automatically construct and store element view accessors.
Define the interface for the assembly kernel in charge of Dirichlet face flux terms.
arrayView1d< real64 const > const m_faceGravCoef
View on the face gravity coefficient.
Base class for FluxComputeKernel that holds all data not dependent on template parameters (like stenc...
ElementViewConst< arrayView1d< globalIndex const > > const m_dofNumber
Views on dof numbers.
ElementViewConst< arrayView4d< real64 const, constitutive::multifluid::USD_PHASE_COMP > > const m_phaseCompFrac
Views on phase component fractions.
ElementViewConst< arrayView3d< real64 const, compflow::USD_COMP_DC > > const m_dCompFrac_dCompDens
Views on derivatives of comp fractions.
static constexpr integer numEqn
Compute time value for the number of equations (all of them, except the volume balance equation)
ElementViewConst< arrayView2d< real64 const, compflow::USD_PHASE > > const m_phaseMob
Views on phase mobilities.
static constexpr integer numDof
Compute time value for the number of degrees of freedom.
static void createAndLaunch(integer const numComps, integer const numPhases, globalIndex const rankOffset, BitFlags< isothermalCompositionalMultiphaseFVMKernels::KernelFlags > kernelFlags, string const &dofKey, string const &solverName, FaceManager const &faceManager, ElementRegionManager const &elemManager, STENCILWRAPPER const &stencilWrapper, constitutive::MultiFluidBase &fluidBase, real64 const dt, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs)
Create a new kernel and launch.
Define the interface for the assembly kernel in charge of Dirichlet face flux terms.
void launchKernel(localIndex const numConnections)
Launch the kernel for a given number of connections.
ElementViewConst< arrayView3d< real64 const, constitutive::multifluid::USD_PHASE > > const m_phaseEnthalpy
Views on phase enthalpies.
GEOS_HOST_DEVICE void complete(localIndex const iconn, StackVariables &stack) const
Performs the complete phase for the kernel.
ElementViewConst< arrayView1d< real64 const > > const m_temp
Views on temperature.
ElementRegionManager::ElementViewConst< VIEWTYPE > ElementViewConst
The type for element-based data. Consists entirely of ArrayView's.
ElementViewConst< arrayView3d< real64 const > > const m_thermalConductivity
View on thermal conductivity.
DirichletFluxComputeKernel(integer const numPhases, globalIndex const rankOffset, FaceManager const &faceManager, BoundaryStencilWrapper const &stencilWrapper, FLUIDWRAPPER const &fluidWrapper, DofNumberAccessor const &dofNumberAccessor, CompFlowAccessors const &compFlowAccessors, ThermalCompFlowAccessors const &thermalCompFlowAccessors, MultiFluidAccessors const &multiFluidAccessors, ThermalMultiFluidAccessors const &thermalMultiFluidAccessors, CapPressureAccessors const &capPressureAccessors, PermeabilityAccessors const &permeabilityAccessors, ThermalConductivityAccessors const &thermalConductivityAccessors, real64 const dt, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs, BitFlags< isothermalCompositionalMultiphaseFVMKernels::KernelFlags > kernelFlags)
Constructor for the kernel interface.
GEOS_HOST_DEVICE void computeFlux(localIndex const iconn, StackVariables &stack) const
Compute the local flux contributions to the residual and Jacobian.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:179
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
Definition: DataTypes.hpp:87
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:84
LvArray::CRSMatrixView< T, COL_INDEX, INDEX_TYPE const, LvArray::ChaiBuffer > CRSMatrixView
Alias for CRS Matrix View.
Definition: DataTypes.hpp:309
int integer
Signed integer type.
Definition: DataTypes.hpp:81
Kernel variables (dof numbers, jacobian and residual) located on the stack.
Kernel variables (dof numbers, jacobian and residual) located on the stack.
globalIndex dofColIndices[numDof]
Indices of the matrix rows/columns corresponding to the dofs in this face.
GEOS_HOST_DEVICE StackVariables(localIndex const size, localIndex numElems)
Constructor for the stack variables.