GEOSX
PerforationData.hpp
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 TotalEnergies
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
15 /*
16  * @file PerforationData.hpp
17  */
18 
19 #ifndef GEOS_MESH_PERFORATIONDATA_HPP
20 #define GEOS_MESH_PERFORATIONDATA_HPP
21 
22 #include "dataRepository/Group.hpp"
25 #include "mesh/generators/LineBlockABC.hpp"
26 
27 namespace geos
28 {
29 
30 class DomainPartition;
31 class MeshLevel;
32 class WellElementSubRegion;
33 
39 {
40 public:
41 
46 
52  explicit PerforationData( string const & name, dataRepository::Group * const parent );
53 
57  ~PerforationData() override;
58 
62  PerforationData() = delete;
63 
67  PerforationData( PerforationData const & ) = delete;
68 
73 
78  PerforationData & operator=( PerforationData const & ) = delete;
79 
85 
87 
92 
97  static string catalogName() { return "PerforationData"; }
98 
102  virtual string getCatalogName() const override { return catalogName(); }
103 
105 
110 
115  void setNumPerforationsGlobal( globalIndex nPerfs ) { m_numPerforationsGlobal = nPerfs; }
116 
117 
122  globalIndex getNumPerforationsGlobal() const { return m_numPerforationsGlobal; }
123 
124 
130 
131 
136  ToElementRelation< array1d< localIndex > > const & getMeshElements() const { return m_toMeshElements; }
137 
138 
143  arrayView1d< localIndex > getWellElements() { return m_wellElementIndex; }
144 
145 
150  arrayView1d< localIndex const > getWellElements() const { return m_wellElementIndex; }
151 
152 
157  arrayView2d< real64 > getLocation() { return m_location; }
158 
159 
164  arrayView2d< real64 const > getLocation() const { return m_location; }
165 
166 
171  arrayView1d< real64 const > getWellTransmissibility() const { return m_wellTransmissibility; }
172 
173 
178  arrayView1d< real64 > getWellTransmissibility() { return m_wellTransmissibility; }
179 
180 
185  arrayView1d< real64 const > getWellSkinFactor() const { return m_wellSkinFactor; }
186 
187 
192  arrayView1d< real64 > getWellSkinFactor() { return m_wellSkinFactor; }
193 
194 
196 
201 
209  WellElementSubRegion const & wellElemSubRegion,
210  array1d< array1d< arrayView3d< real64 const > > > const & perm );
211 
213 
218 
225  void connectToWellElements( LineBlockABC const & lineBlock,
226  unordered_map< globalIndex, localIndex > const & globalToLocalWellElementMap,
227  globalIndex elemOffsetGlobal );
228 
230 
236  {
238  static constexpr char const * numPerforationsGlobalString() { return "numPerforationsGlobal"; }
239  }
242 
243 private:
244 
249 
261  void getReservoirElementDimensions( MeshLevel const & mesh,
262  localIndex const er, localIndex const esr, localIndex const ei,
263  real64 & dx, real64 & dy, real64 & dz ) const;
264 
266 
267 
269  globalIndex m_numPerforationsGlobal;
270 
272  ToElementRelation< array1d< localIndex > > m_toMeshElements;
273 
275  array1d< localIndex > m_wellElementIndex;
276 
278  array2d< real64 > m_location;
279 
281  array1d< real64 > m_wellTransmissibility;
282 
284  array1d< real64 > m_wellSkinFactor;
285 
286 };
287 
288 } //namespace geos
289 
290 #endif //GEOS_MESH_PERFORATIONDATA_HPP
Class facilitating the representation of a multi-level discretization of a MeshBody.
Definition: MeshLevel.hpp:41
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< 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< 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:369
ArrayView< T, 1 > arrayView1d
Alias for 1D array view.
Definition: DataTypes.hpp:220
Array< T, 2, PERMUTATION > array2d
Alias for 2D array.
Definition: DataTypes.hpp:232
double real64
64-bit floating point type.
Definition: DataTypes.hpp:139
GEOSX_GLOBALINDEX_TYPE globalIndex
Global index type (for indexing objects across MPI partitions).
Definition: DataTypes.hpp:128
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:236
GEOSX_LOCALINDEX_TYPE localIndex
Local index type (for indexing objects within an MPI partition).
Definition: DataTypes.hpp:125
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:216
ArrayView< T, 3, USD > arrayView3d
Alias for 3D array view.
Definition: DataTypes.hpp:252
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()