GEOSX
LineBlock.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) 2020- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
15 #ifndef GEOSX_WELLBLOCK_HPP
16 #define GEOSX_WELLBLOCK_HPP
17 
18 #include "mesh/generators/LineBlockABC.hpp"
19 
20 
21 namespace geos
22 {
23 
27 class LineBlock : public LineBlockABC
28 {
29 public:
35  LineBlock( string const & name, Group * const parent );
36 
41 
42  // getters for element data
43 
44  globalIndex numElements() const override final { return m_numElems; }
45 
50  void setNumElements( globalIndex numElems ) { m_numElems = numElems; }
51 
52  arrayView2d< real64 const > getElemCoords() const override final { return m_elemCenterCoords; }
53 
58  void setElemCoords( arrayView2d< real64 const > elemCenterCoords ) { m_elemCenterCoords = elemCenterCoords; }
59 
60  arrayView1d< globalIndex const > getNextElemIndex() const override final { return m_nextElemId; }
61 
66  void setNextElemIndex( arrayView1d< globalIndex const > nextElemId ) { m_nextElemId = nextElemId; }
67 
68  arrayView1d< arrayView1d< globalIndex const > const > getPrevElemIndices() const override final { return m_prevElemId.toNestedViewConst(); }
69 
70 
76 
77  arrayView2d< globalIndex const > getElemToNodesMap() const override final { return m_elemToNodesMap; }
78 
79 
84  void setElemToNodesMap( arrayView2d< globalIndex const > elemToNodesMap ) { m_elemToNodesMap = elemToNodesMap; }
85 
86  arrayView1d< real64 const > getElemVolume() const override final { return m_elemVolume; }
87 
88 
93  void setElemVolume( arrayView1d< real64 const > elemVolume ) { m_elemVolume = elemVolume; }
94 
95  real64 getElementRadius() const override final { return m_radius; }
96 
97 
102  void setElementRadius( real64 radius ) { m_radius = radius; }
103 
104  // getters for node data
105 
106  globalIndex numNodes() const override final { return m_numNodes; }
107 
108 
113  void setNumNodes( globalIndex numNodes ) { m_numNodes = numNodes; }
114 
115  arrayView2d< real64 const > getNodeCoords() const override final { return m_nodeCoords; }
116 
121  void setNodeCoords( arrayView2d< real64 const > nodeCoords ) { m_nodeCoords = nodeCoords; }
122 
123 
124 
125  // getters for perforation data
126 
127  globalIndex numPerforations() const override final { return m_numPerforations; }
128 
129 
135 
136  arrayView2d< real64 const > getPerfCoords() const override final { return m_perfCoords; }
137 
138 
143  void setPerfCoords( arrayView2d< real64 const > perfCoords ) { m_perfCoords = perfCoords; }
144 
145  arrayView1d< real64 const > getPerfTransmissibility() const override final { return m_perfTransmissibility; }
146 
147 
152  void setPerfTransmissibility( arrayView1d< real64 const > perfTransmissibility ) { m_perfTransmissibility = perfTransmissibility; }
153 
154  arrayView1d< real64 const > getPerfSkinFactor() const override final { return m_perfSkinFactor; }
155 
156 
161  void setPerfSkinFactor( arrayView1d< real64 const > perfSkinFactor ) { m_perfSkinFactor = perfSkinFactor; }
162 
163  arrayView1d< globalIndex const > getPerfElemIndex() const override final { return m_perfElemId; }
164 
169  void setPerfElemIndex( arrayView1d< globalIndex const > perfElemId ) { m_perfElemId = perfElemId; }
170 
175  void setWellControlsName( string const & wellControlsName ) { m_wellControlsName = wellControlsName; }
176  string const & getWellControlsName( ) const override final { return m_wellControlsName; }
177 
182  void setWellGeneratorName( string const & wellGeneratorName ) { m_wellGeneratorName = wellGeneratorName; }
183  string const & getWellGeneratorName( ) const override final { return m_wellGeneratorName; }
184 
186 
188 
189 
190 
191 private:
192 
193 
194  // XML Input
195 
197  real64 m_radius;
198 
199  // Geometry of the well (later passed to the WellElementSubRegion)
200 
201  // well element data
202 
204  globalIndex m_numElems;
205 
207  array2d< real64 > m_elemCenterCoords;
208 
210  array1d< globalIndex > m_nextElemId;
211 
213  array1d< array1d< globalIndex > > m_prevElemId;
214 
216  array2d< globalIndex > m_elemToNodesMap;
217 
219  array1d< real64 > m_elemVolume;
220 
221 
222  // well node data
223 
225  globalIndex m_numNodes;
226 
228  array2d< real64 > m_nodeCoords;
229 
230  // perforation data
231 
233  globalIndex m_numPerforations;
234 
236  array2d< real64 > m_perfCoords;
237 
239  array1d< real64 > m_perfTransmissibility;
240 
242  array1d< real64 > m_perfSkinFactor;
243 
245  array1d< globalIndex > m_perfElemId;
246 
247 
248 
249  // Perforation data
250 
252  string_array m_perforationList;
253 
255  string m_wellControlsName;
256 
258  string m_wellGeneratorName;
259 
260 };
261 }
262 #endif
void setPerfCoords(arrayView2d< real64 const > perfCoords)
Set the locations of the perforations.
Definition: LineBlock.hpp:143
string const & getWellGeneratorName() const override final
Get the well generator name.
Definition: LineBlock.hpp:183
string const & getWellControlsName() const override final
Get the well controls name.
Definition: LineBlock.hpp:176
arrayView2d< real64 const > getPerfCoords() const override final
Get the locations of the perforations.
Definition: LineBlock.hpp:136
void setElemVolume(arrayView1d< real64 const > elemVolume)
Set the volume of the well elements.
Definition: LineBlock.hpp:93
void setElemToNodesMap(arrayView2d< globalIndex const > elemToNodesMap)
Set the global indices of the well nodes nodes connected to each element.
Definition: LineBlock.hpp:84
arrayView2d< real64 const > getElemCoords() const override final
Get the physical location of the centers of well elements.
Definition: LineBlock.hpp:52
arrayView1d< real64 const > getPerfTransmissibility() const override final
Get the well transmissibility at the perforations.
Definition: LineBlock.hpp:145
arrayView1d< real64 const > getPerfSkinFactor() const override final
Get the well skin factor at the perforations.
Definition: LineBlock.hpp:154
LineBlock(string const &name, Group *const parent)
Constructor for this class.
arrayView1d< real64 const > getElemVolume() const override final
Get the volume of the well elements.
Definition: LineBlock.hpp:86
arrayView1d< globalIndex const > getPerfElemIndex() const override final
Get the global indices of the well elements connected to each perforation.
Definition: LineBlock.hpp:163
void setWellGeneratorName(string const &wellGeneratorName)
Set the well genrator name.
Definition: LineBlock.hpp:182
arrayView1d< globalIndex const > getNextElemIndex() const override final
Get the global indices mapping an element to the next.
Definition: LineBlock.hpp:60
globalIndex numPerforations() const override final
Get the global number of perforations on this well.
Definition: LineBlock.hpp:127
real64 getElementRadius() const override final
Get the radius in the well.
Definition: LineBlock.hpp:95
void setNumElements(globalIndex numElems)
Set the global number of well elements.
Definition: LineBlock.hpp:50
void setElementRadius(real64 radius)
Set the radius in the well.
Definition: LineBlock.hpp:102
void setNumPerforations(globalIndex numPerforations)
Set the global number of perforations on this well.
Definition: LineBlock.hpp:134
arrayView2d< real64 const > getNodeCoords() const override final
Get the physical location of the centers of well elements.
Definition: LineBlock.hpp:115
void setPerfElemIndex(arrayView1d< globalIndex const > perfElemId)
Set the global indices of the well elements connected to each perforation.
Definition: LineBlock.hpp:169
void setPerfSkinFactor(arrayView1d< real64 const > perfSkinFactor)
Set the well skin factor at the perforations.
Definition: LineBlock.hpp:161
void setPerfTransmissibility(arrayView1d< real64 const > perfTransmissibility)
Set the well transmissibility at the perforations.
Definition: LineBlock.hpp:152
void setNextElemIndex(arrayView1d< globalIndex const > nextElemId)
Set the global indices mapping an element to the next.
Definition: LineBlock.hpp:66
globalIndex numElements() const override final
Get the global number of well elements.
Definition: LineBlock.hpp:44
void setPrevElemIndices(arrayView1d< arrayView1d< globalIndex const > const > prevElemIndices)
Set the global indices mapping an element to the previous ones.
arrayView1d< arrayView1d< globalIndex const > const > getPrevElemIndices() const override final
Get the global indices mapping an element to the previous ones.
Definition: LineBlock.hpp:68
void setNodeCoords(arrayView2d< real64 const > nodeCoords)
Set the physical location of the centers of well elements.
Definition: LineBlock.hpp:121
void setElemCoords(arrayView2d< real64 const > elemCenterCoords)
Set the physical location of the centers of well elements.
Definition: LineBlock.hpp:58
globalIndex numNodes() const override final
Get the global number of well nodes.
Definition: LineBlock.hpp:106
arrayView2d< globalIndex const > getElemToNodesMap() const override final
Get the global indices of the well nodes nodes connected to each element.
Definition: LineBlock.hpp:77
void setWellControlsName(string const &wellControlsName)
Set the well controls name.
Definition: LineBlock.hpp:175
void setNumNodes(globalIndex numNodes)
Set the global number of well nodes.
Definition: LineBlock.hpp:113
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
array1d< string > string_array
A 1-dimensional array of geos::string types.
Definition: DataTypes.hpp:432
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
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:216