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 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 
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 protected:
95 
96  virtual void initializePreSubGroups() override;
97 
99 
100 private:
101 
102  CompositionalMultiphaseBase * flowSolver() const;
103 
104  void setMGRStrategy();
105 
106 };
107 
108 } /* namespace geos */
109 
110 #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.
virtual void initializePostInitialConditionsPreSubGroups() override
Called by InitializePostInitialConditions() 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:44
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:1505
integer numFluidComponents() const
Getter for the number of fluid components (species)
integer numFluidPhases() const
Getter for the number of fluid phases.
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
LvArray::SparsityPatternView< COL_INDEX, INDEX_TYPE const, LvArray::ChaiBuffer > SparsityPatternView
Alias for Sparsity pattern View.
Definition: DataTypes.hpp:302
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
std::int32_t integer
Signed integer type.
Definition: DataTypes.hpp:82