GEOS
SinglePhaseReservoirAndWells.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_SINGLEPHASERESERVOIRANDWELLS_HPP_
22 #define GEOS_PHYSICSSOLVERS_MULTIPHYSICS_SINGLEPHASERESERVOIRANDWELLS_HPP_
23 
27 
28 namespace geos
29 {
30 
32 template< typename RESERVOIR_SOLVER = SinglePhaseBase >
34  SinglePhaseWell >
35 {
36 public:
37 
38  using Base = CoupledReservoirAndWellsBase< RESERVOIR_SOLVER,
40  using Base::m_solvers;
42 
48  SinglePhaseReservoirAndWells( const string & name,
49  dataRepository::Group * const parent );
50 
54  virtual ~SinglePhaseReservoirAndWells() override;
55 
60  static string catalogName()
61  {
62  if constexpr (std::is_same_v< RESERVOIR_SOLVER, SinglePhaseBase > ) // special case
63  {
64  return "SinglePhaseReservoir";
65  }
66  else // default
67  {
68  return RESERVOIR_SOLVER::catalogName() + "Reservoir";
69  }
70  }
71 
75  string getCatalogName() const override { return catalogName(); }
76 
77  virtual void addCouplingSparsityPattern( DomainPartition const & domain,
78  DofManager const & dofManager,
79  SparsityPatternView< globalIndex > const & pattern ) const override;
80 
81  virtual void assembleCouplingTerms( real64 const time_n,
82  real64 const dt,
83  DomainPartition const & domain,
84  DofManager const & dofManager,
86  arrayView1d< real64 > const & localRhs ) override;
87 
88  void
89  assembleHydrofracFluxTerms( real64 const time_n,
90  real64 const dt,
91  DomainPartition const & domain,
92  DofManager const & dofManager,
94  arrayView1d< real64 > const & localRhs,
96  { flowSolver()->assembleHydrofracFluxTerms( time_n, dt, domain, dofManager, localMatrix, localRhs, dR_dAper ); }
97 
98  template< typename SUBREGION_TYPE >
99  void accumulationAssemblyLaunch( DofManager const & dofManager,
100  SUBREGION_TYPE const & subRegion,
101  CRSMatrixView< real64, globalIndex const > const & localMatrix,
102  arrayView1d< real64 > const & localRhs )
103  { flowSolver()->accumulationAssemblyLaunch( dofManager, subRegion, localMatrix, localRhs ); }
104 
105  void prepareStencilWeights( DomainPartition & domain ) const
106  { flowSolver()->prepareStencilWeights( domain ); }
107  void updateStencilWeights( DomainPartition & domain ) const
108  { flowSolver()->updateStencilWeights( domain ); }
109 
110 protected:
111 
112  virtual void initializePreSubGroups() override;
113 
114  virtual void setMGRStrategy() override
115  {
117  GEOS_ERROR( GEOS_FMT( "{}: MGR strategy is not implemented for {}", this->getName(), this->getCatalogName()));
118  }
119 
120 private:
121 
122  SinglePhaseBase * flowSolver() const;
123 
124 };
125 
126 } /* namespace geos */
127 
128 #endif /* GEOS_PHYSICSSOLVERS_MULTIPHYSICS_SINGLEPHASERESERVOIRANDWELLS_HPP_ */
#define GEOS_ERROR(msg)
Raise a hard error and terminate the program.
Definition: Logger.hpp:157
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...
void updateStencilWeights(DomainPartition &domain) const
Update the stencil weights by adding the contribution of the hydraulic aperture after the aperture is...
void prepareStencilWeights(DomainPartition &domain) const
Prepare the stencil weights by removing the contribution of the hydraulic aperture before the apertur...
LinearSolverParametersInput m_linearSolverParameters
Linear solver parameters.
virtual void assembleHydrofracFluxTerms(real64 const time_n, real64 const dt, DomainPartition const &domain, DofManager const &dofManager, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs, CRSMatrixView< real64, localIndex const > const &dR_dAper)=0
assembles the flux terms for all cells for the hydrofracture case
void accumulationAssemblyLaunch(DofManager const &dofManager, SUBREGION_TYPE const &subRegion, CRSMatrixView< real64, globalIndex const > const &localMatrix, arrayView1d< real64 > const &localRhs)
assembles the accumulation terms for all cells of a spcefici subRegion.
virtual void addCouplingSparsityPattern(DomainPartition const &domain, DofManager const &dofManager, SparsityPatternView< globalIndex > const &pattern) const override
virtual ~SinglePhaseReservoirAndWells() override
default destructor
SinglePhaseReservoirAndWells(const string &name, dataRepository::Group *const parent)
main constructor for ManagedGroup Objects
static string catalogName()
name of the node manager in the object catalog
virtual void initializePreSubGroups() override
Called by Initialize() prior to initializing sub-Groups.
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.
string const & getName() const
Get group name.
Definition: Group.hpp:1329
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
@ mgr
Multigrid reduction (Hypre only)
PreconditionerType preconditionerType
Preconditioner type.