GEOS
CompositionalMultiphaseReservoirAndWells.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 
21 #ifndef GEOS_PHYSICSSOLVERS_MULTIPHYSICS_COMPOSITIONALMULTIPHASERESERVOIRANDWELLS_HPP_
22 #define GEOS_PHYSICSSOLVERS_MULTIPHYSICS_COMPOSITIONALMULTIPHASERESERVOIRANDWELLS_HPP_
23 
27 
28 namespace geos
29 {
30 
32 template< typename RESERVOIR_SOLVER = CompositionalMultiphaseBase >
34  CompositionalMultiphaseWell >
35 {
36 public:
37 
38  using Base = CoupledReservoirAndWellsBase< RESERVOIR_SOLVER,
40  using Base::getLogLevel;
41  using Base::m_solvers;
43 
50  dataRepository::Group * const parent );
51 
56 
61  static string catalogName()
62  {
63  if constexpr (std::is_same_v< RESERVOIR_SOLVER, CompositionalMultiphaseBase > ) // special case
64  {
65  return "CompositionalMultiphaseReservoir";
66  }
67  else // default
68  {
69  return RESERVOIR_SOLVER::catalogName() + "Reservoir";
70  }
71  }
72 
76  string getCatalogName() const override { return catalogName(); }
77 
78  virtual void addCouplingSparsityPattern( DomainPartition const & domain,
79  DofManager const & dofManager,
80  SparsityPatternView< globalIndex > const & pattern ) const override;
81 
82  virtual void assembleCouplingTerms( real64 const time_n,
83  real64 const dt,
84  DomainPartition const & domain,
85  DofManager const & dofManager,
87  arrayView1d< real64 > const & localRhs ) override;
88  integer isThermal() { return flowSolver()->isThermal(); }
89  integer useSimpleAccumulation() const { return flowSolver()->useSimpleAccumulation(); }
90  integer useTotalMassEquation() const { return flowSolver()->useTotalMassEquation(); }
91  integer numFluidPhases() { return flowSolver()->numFluidPhases(); }
92  integer numFluidComponents() { return flowSolver()->numFluidComponents(); }
93 
94  void
95  assembleHydrofracFluxTerms( real64 const time_n,
96  real64 const dt,
97  DomainPartition const & domain,
98  DofManager const & dofManager,
99  CRSMatrixView< real64, globalIndex const > const & localMatrix,
100  arrayView1d< real64 > const & localRhs,
101  CRSMatrixView< real64, localIndex const > const & dR_dAper );
102 
103  template< typename SUBREGION_TYPE >
104  void accumulationAssemblyLaunch( DofManager const & dofManager,
105  SUBREGION_TYPE const & subRegion,
106  CRSMatrixView< real64, globalIndex const > const & localMatrix,
107  arrayView1d< real64 > const & localRhs )
108  {
109  flowSolver()->accumulationAssemblyLaunch( dofManager, subRegion, localMatrix, localRhs );
110  }
111 
112  void prepareStencilWeights( DomainPartition & domain ) const;
113  void updateStencilWeights( DomainPartition & domain ) const;
114 
115 protected:
116 
117  virtual void initializePreSubGroups() override;
118 
119  virtual void setMGRStrategy() override;
120 
121 private:
122 
123  CompositionalMultiphaseBase * flowSolver() const;
124 };
125 
126 } /* namespace geos */
127 
128 #endif /* GEOS_PHYSICSSOLVERS_MULTIPHYSICS_COMPOSITIONALMULTIPHASERESERVOIRANDWELLS_HPP_ */
virtual void assembleCouplingTerms(real64 const time_n, real64 const dt, DomainPartition const &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) override
Utility function to compute coupling terms.
virtual void initializePreSubGroups() override
Called by Initialize() prior to initializing sub-Groups.
static string catalogName()
name of the node manager in the object catalog
CompositionalMultiphaseReservoirAndWells(const string &name, dataRepository::Group *const parent)
main constructor for ManagedGroup Objects
virtual void addCouplingSparsityPattern(DomainPartition const &domain, DofManager const &dofManager, SparsityPatternView< globalIndex > const &pattern) const override
virtual ~CompositionalMultiphaseReservoirAndWells() override
default destructor
std::tuple< SOLVERS *... > m_solvers
Pointers of the single-physics solvers.
The DoFManager is responsible for allocating global dofs, constructing sparsity patterns,...
Definition: DofManager.hpp:45
Partition of the decomposed physical domain. It also manages the connexion information to its neighbo...
LinearSolverParametersInput m_linearSolverParameters
Linear solver parameters.
integer getLogLevel() const
Definition: Group.hpp:1506
integer numFluidComponents() const
Getter for the number of fluid components (species)
void accumulationAssemblyLaunch(DofManager const &dofManager, SUBREGION_TYPE const &subRegion, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs) const
assembles the accumulation terms for all cells of a spcefici subRegion.
integer numFluidPhases() const
Getter for the number of fluid phases.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:179
LvArray::SparsityPatternView< COL_INDEX, INDEX_TYPE const, LvArray::ChaiBuffer > SparsityPatternView
Alias for Sparsity pattern View.
Definition: DataTypes.hpp:301
double real64
64-bit floating point type.
Definition: DataTypes.hpp:98
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