GEOS
PerforationData.hpp
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 
16 /*
17  * @file PerforationData.hpp
18  */
19 
20 #ifndef GEOS_MESH_PERFORATIONDATA_HPP
21 #define GEOS_MESH_PERFORATIONDATA_HPP
22 
23 #include "dataRepository/Group.hpp"
26 #include "mesh/generators/LineBlockABC.hpp"
27 
28 namespace geos
29 {
30 
31 class DomainPartition;
32 class MeshLevel;
33 class WellElementSubRegion;
34 
40 {
41 public:
42 
47 
53  explicit PerforationData( string const & name, dataRepository::Group * const parent );
54 
58  ~PerforationData() override;
59 
63  PerforationData() = delete;
64 
68  PerforationData( PerforationData const & ) = delete;
69 
74 
79  PerforationData & operator=( PerforationData const & ) = delete;
80 
86 
88 
93 
98  static string catalogName() { return "PerforationData"; }
99 
103  virtual string getCatalogName() const override { return catalogName(); }
104 
106 
111 
116  void setNumPerforationsGlobal( globalIndex nPerfs ) { m_numPerforationsGlobal = nPerfs; }
117 
118 
123  globalIndex getNumPerforationsGlobal() const { return m_numPerforationsGlobal; }
124 
125 
131 
132 
137  ToElementRelation< array1d< localIndex > > const & getMeshElements() const { return m_toMeshElements; }
138 
139 
144  arrayView1d< localIndex > getWellElements() { return m_wellElementIndex; }
145 
146 
151  arrayView1d< localIndex const > getWellElements() const { return m_wellElementIndex; }
152 
157  arrayView1d< globalIndex > getReservoirElementGlobalIndex() { return m_reservoirElementGlobalIndex; }
158 
159 
160 
165  arrayView1d< globalIndex const > getReservoirElementGlobalIndex() const { return m_reservoirElementGlobalIndex; }
166 
167 
172  arrayView2d< real64 > getLocation() { return m_location; }
173 
174 
179  arrayView2d< real64 const > getLocation() const { return m_location; }
180 
181 
186  arrayView1d< real64 const > getWellTransmissibility() const { return m_wellTransmissibility; }
187 
188 
193  arrayView1d< real64 > getWellTransmissibility() { return m_wellTransmissibility; }
194 
195 
200  arrayView1d< real64 const > getWellSkinFactor() const { return m_wellSkinFactor; }
201 
202 
207  arrayView1d< real64 > getWellSkinFactor() { return m_wellSkinFactor; }
208 
209 
211 
216 
224  WellElementSubRegion const & wellElemSubRegion,
225  array1d< array1d< arrayView3d< real64 const > > > const & perm );
226 
228 
233 
240  void connectToWellElements( LineBlockABC const & lineBlock,
241  unordered_map< globalIndex, localIndex > const & globalToLocalWellElementMap,
242  globalIndex elemOffsetGlobal );
243 
245 
251  {
253  static constexpr char const * numPerforationsGlobalString() { return "numPerforationsGlobal"; }
254  }
257 
258 private:
259 
264 
276  void getReservoirElementDimensions( MeshLevel const & mesh,
277  localIndex const er, localIndex const esr, localIndex const ei,
278  real64 & dx, real64 & dy, real64 & dz ) const;
279 
281 
282 
284  globalIndex m_numPerforationsGlobal;
285 
287  ToElementRelation< array1d< localIndex > > m_toMeshElements;
288 
290  array1d< localIndex > m_wellElementIndex;
291 
293  array1d< globalIndex > m_reservoirElementGlobalIndex;
294 
296  array2d< real64 > m_location;
297 
299  array1d< real64 > m_wellTransmissibility;
300 
302  array1d< real64 > m_wellSkinFactor;
303 
304 };
305 
306 } //namespace geos
307 
308 #endif //GEOS_MESH_PERFORATIONDATA_HPP
Class facilitating the representation of a multi-level discretization of a MeshBody.
Definition: MeshLevel.hpp:42
The ObjectManagerBase is the base object of all object managers in the mesh data hierachy.
~PerforationData() override
Default destructor.
PerforationData & operator=(PerforationData const &)=delete
Deleted assignment operator.
arrayView1d< real64 const > getWellSkinFactor() const
Provide an immutable accessor to a const perforation skin factor array.
void connectToWellElements(LineBlockABC const &lineBlock, unordered_map< globalIndex, localIndex > const &globalToLocalWellElementMap, globalIndex elemOffsetGlobal)
Connect each perforation to a local wellbore element.
arrayView1d< real64 const > getWellTransmissibility() const
Provide an immutable accessor to a const perforation well indices array.
PerforationData(PerforationData const &)=delete
Deleted copy constructor.
void setNumPerforationsGlobal(globalIndex nPerfs)
Set the global number of perforations used for well initialization.
globalIndex getNumPerforationsGlobal() const
Get the global number of perforations (used for well initialization).
PerforationData()=delete
Deleted default constructor.
void computeWellTransmissibility(MeshLevel const &mesh, WellElementSubRegion const &wellElemSubRegion, array1d< array1d< arrayView3d< real64 const > > > const &perm)
Compute the well transmissibility for each local perforation on this well.
PerforationData(PerforationData &&)=delete
Deleted move constructor.
arrayView1d< real64 > getWellSkinFactor()
Get perforation well skin factors.
arrayView2d< real64 > getLocation()
Get perforation locations.
ToElementRelation< array1d< localIndex > > & getMeshElements()
Get perforation-to-mesh-element connectivity.
ToElementRelation< array1d< localIndex > > const & getMeshElements() const
Provide an immutable accessor to a const perforation-to-mesh-element connectivity.
geos::PerforationData::viewKeyStruct viewKeysPerforationData
ViewKey struct for the PerforationData class.
PerforationData(string const &name, dataRepository::Group *const parent)
Constructor for PerforationData Objects.
arrayView1d< globalIndex > getReservoirElementGlobalIndex()
Get perforation-to-reservoir-element connectivity.
arrayView1d< localIndex > getWellElements()
Get perforation-to-well-element connectivity.
arrayView2d< real64 const > getLocation() const
Provide an immutable accessor to a const perforation location arrayView.
virtual string getCatalogName() const override
Get the catalog name.
PerforationData & operator=(PerforationData &&)=delete
Deleted move operator.
static string catalogName()
Get the catalog name.
arrayView1d< globalIndex const > getReservoirElementGlobalIndex() const
Provide an immutable accessor to a const perforation-to-reservoir-element connectivity.
arrayView1d< real64 > getWellTransmissibility()
Get perforation well indices.
arrayView1d< localIndex const > getWellElements() const
Provide an immutable accessor to a const perforation-to-well-element connectivity.
A relationship to an element.
This class describes a collection of local well elements and perforations.
Base template for ordered and unordered maps.
Definition: DataTypes.hpp:329
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:180
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
Definition: DataTypes.hpp:192
GEOS_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
Definition: DataTypes.hpp:88
double real64
64-bit floating point type.
Definition: DataTypes.hpp:99
GEOS_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:85
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:196
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:176
ArrayView< T, 3, USD > arrayView3d
Alias for 3D array view.
Definition: DataTypes.hpp:212
struct to serve as a container for variable strings and keys
Struct to serve as a container for variable strings and keys.
static constexpr char const * numPerforationsGlobalString()