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 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 
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"
28 namespace geos
29 {
30 
31 class DomainPartition;
32 class MeshLevel;
33 class WellElementSubRegion;
34 
40 {
41 public:
42 
46  enum PerforationStatus : unsigned
47  {
48  CLOSED = 0, // no flow in element
49  OPEN = 1
50  };
51 
56 
62  explicit PerforationData( string const & name, dataRepository::Group * const parent );
63 
67  ~PerforationData() override;
68 
72  PerforationData() = delete;
73 
77  PerforationData( PerforationData const & ) = delete;
78 
83 
88  PerforationData & operator=( PerforationData const & ) = delete;
89 
95 
97 
102 
107  static string catalogName() { return "PerforationData"; }
108 
112  virtual string getCatalogName() const override { return catalogName(); }
113 
115 
120 
125  void setNumPerforationsGlobal( globalIndex nPerfs ) { m_numPerforationsGlobal = nPerfs; }
126 
127 
132  globalIndex getNumPerforationsGlobal() const { return m_numPerforationsGlobal; }
133 
134 
140 
141 
146  ToElementRelation< array1d< localIndex > > const & getMeshElements() const { return m_toMeshElements; }
147 
148 
153  arrayView1d< localIndex > getWellElements() { return m_wellElementIndex; }
154 
155 
160  arrayView1d< localIndex const > getWellElements() const { return m_wellElementIndex; }
161 
166  arrayView1d< globalIndex > getReservoirElementGlobalIndex() { return m_reservoirElementGlobalIndex; }
167 
168 
169 
174  arrayView1d< globalIndex const > getReservoirElementGlobalIndex() const { return m_reservoirElementGlobalIndex; }
175 
176 
181  arrayView2d< real64 > getLocation() { return m_location; }
182 
183 
188  arrayView2d< real64 const > getLocation() const { return m_location; }
189 
190 
195  arrayView1d< real64 const > getWellTransmissibility() const { return m_wellTransmissibility; }
196 
197 
202  arrayView1d< real64 > getWellTransmissibility() { return m_wellTransmissibility; }
203 
204 
209  arrayView1d< real64 const > getWellSkinFactor() const { return m_wellSkinFactor; }
210 
211 
216  arrayView1d< real64 > getWellSkinFactor() { return m_wellSkinFactor; }
217 
218 
223  string_array & getPerfName() { return m_perfName; }
224 
229  string_array const & getPerfName() const { return m_perfName; }
230 
235  string_array & getPerfStatusTableName() { return m_perfStatusTableName; }
236 
241  string_array const & getPerfStatusTableName() const { return m_perfStatusTableName; }
242 
247  arrayView1d< localIndex const > getLocalPerfStatus() const { return m_localPerfStatus; }
248 
249 
254  arrayView1d< localIndex > getLocalPerfStatus() { return m_localPerfStatus; }
255 
257 
262 
270  WellElementSubRegion const & wellElemSubRegion,
271  array1d< array1d< arrayView3d< real64 const > > > const & perm );
272 
274 
279 
286  void connectToWellElements( LineBlockABC const & lineBlock,
287  unordered_map< globalIndex, localIndex > const & globalToLocalWellElementMap,
288  globalIndex elemOffsetGlobal );
289 
291 
297  {
299  static constexpr char const * numPerforationsGlobalString() { return "numPerforationsGlobal"; }
301  static constexpr char const * perforationStatusTableName() { return "perforationStatusTableName"; }
303  static constexpr char const * perforationName() { return "perforationName"; }
304  }
307 
308 private:
309 
314 
326  void getReservoirElementDimensions( MeshLevel const & mesh,
327  localIndex const er, localIndex const esr, localIndex const ei,
328  real64 & dx, real64 & dy, real64 & dz ) const;
329 
331 
332 
334  globalIndex m_numPerforationsGlobal;
335 
337  ToElementRelation< array1d< localIndex > > m_toMeshElements;
338 
340  array1d< localIndex > m_wellElementIndex;
341 
343  array1d< globalIndex > m_reservoirElementGlobalIndex;
344 
346  array2d< real64 > m_location;
347 
349  array1d< real64 > m_wellTransmissibility;
350 
352  array1d< real64 > m_wellSkinFactor;
353 
355  string_array m_perfName;
356 
358  string_array m_perfStatusTableName;
359 
361  array1d< localIndex > m_localPerfStatus;
362 
363 };
364 
365 } //namespace geos
366 
367 #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.
string_array const & getPerfName() const
Get perforation name.
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.
string_array const & getPerfStatusTableName() const
Get perforation status table name.
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.
arrayView1d< localIndex const > getLocalPerfStatus() const
Get perforation's status.
PerforationData(PerforationData &&)=delete
Deleted move constructor.
arrayView1d< real64 > getWellSkinFactor()
Get perforation well skin factors.
arrayView2d< real64 > getLocation()
Get perforation locations.
string_array & getPerfStatusTableName()
Get perforation status table name.
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.
string_array & getPerfName()
Get perforation name.
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.
PerforationStatus
enumeration for values element state
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 > getLocalPerfStatus()
Get perforation's status.
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.
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:179
stdVector< string > string_array
A 1-dimensional array of geos::string types.
Definition: DataTypes.hpp:361
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
Definition: DataTypes.hpp:191
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
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:195
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:175
ArrayView< T, 3, USD > arrayView3d
Alias for 3D array view.
Definition: DataTypes.hpp:211
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 * perforationStatusTableName()
static constexpr char const * numPerforationsGlobalString()
static constexpr char const * perforationName()