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 
152  arrayView1d< localIndex > getWellElements() { return m_wellElementIndex; }
153 
157  array1d< bool > & isReservoirElementFound() { return m_isReservoirElementFound; }
158 
163  arrayView1d< bool const > isReservoirElementFound() const { return m_isReservoirElementFound; }
164 
169  bool hasLocalPerforationInReservoir( localIndex perfoLocalIndex ) const
170  { return m_isReservoirElementFound[perfoLocalIndex]; }
171 
176  arrayView1d< localIndex const > getWellElements() const { return m_wellElementIndex; }
177 
182  arrayView1d< globalIndex > getReservoirElementGlobalIndex() { return m_reservoirElementGlobalIndex; }
183 
184 
185 
190  arrayView1d< globalIndex const > getReservoirElementGlobalIndex() const { return m_reservoirElementGlobalIndex; }
191 
192 
197  arrayView2d< real64 > getLocation() { return m_location; }
198 
199 
204  arrayView2d< real64 const > getLocation() const { return m_location; }
205 
206 
211  arrayView1d< real64 const > getWellTransmissibility() const { return m_wellTransmissibility; }
212 
213 
218  arrayView1d< real64 > getWellTransmissibility() { return m_wellTransmissibility; }
219 
220 
225  arrayView1d< real64 const > getWellSkinFactor() const { return m_wellSkinFactor; }
226 
227 
232  arrayView1d< real64 > getWellSkinFactor() { return m_wellSkinFactor; }
233 
234 
239  string_array & getPerfName() { return m_perfName; }
240 
245  string_array const & getPerfName() const { return m_perfName; }
246 
251  string_array & getPerfStatusTableName() { return m_perfStatusTableName; }
252 
257  string_array const & getPerfStatusTableName() const { return m_perfStatusTableName; }
258 
263  arrayView1d< localIndex const > getLocalPerfStatus() const { return m_localPerfStatus; }
264 
265 
270  arrayView1d< localIndex > getLocalPerfStatus() { return m_localPerfStatus; }
271 
273 
278 
286  WellElementSubRegion const & wellElemSubRegion,
287  array1d< array1d< arrayView3d< real64 const > > > const & perm );
288 
290 
295 
302  void connectToWellElements( LineBlockABC const & lineBlock,
303  unordered_map< globalIndex, localIndex > const & globalToLocalWellElementMap,
304  globalIndex elemOffsetGlobal );
305 
307 
313  {
315  static constexpr char const * numPerforationsGlobalString() { return "numPerforationsGlobal"; }
317  static constexpr char const * perforationStatusTableName() { return "perforationStatusTableName"; }
319  static constexpr char const * perforationName() { return "perforationName"; }
320  }
323 
324 private:
325 
330 
342  void getReservoirElementDimensions( MeshLevel const & mesh,
343  localIndex const er, localIndex const esr, localIndex const ei,
344  real64 & dx, real64 & dy, real64 & dz ) const;
345 
347 
348 
350  globalIndex m_numPerforationsGlobal;
351 
353  ToElementRelation< array1d< localIndex > > m_toMeshElements;
354 
356  array1d< localIndex > m_wellElementIndex;
357 
359  array1d< globalIndex > m_reservoirElementGlobalIndex;
360 
362  array1d< bool > m_isReservoirElementFound;
363 
365  array2d< real64 > m_location;
366 
368  array1d< real64 > m_wellTransmissibility;
369 
371  array1d< real64 > m_wellSkinFactor;
372 
374  string_array m_perfName;
375 
377  string_array m_perfStatusTableName;
378 
380  array1d< localIndex > m_localPerfStatus;
381 
382 };
383 
384 } //namespace geos
385 
386 #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.
array1d< bool > & isReservoirElementFound()
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.
arrayView1d< bool const > isReservoirElementFound() const
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.
bool hasLocalPerforationInReservoir(localIndex perfoLocalIndex) const
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()