GEOS
LineBlock.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 #ifndef GEOS_WELLBLOCK_HPP
17 #define GEOS_WELLBLOCK_HPP
18 
19 #include "mesh/generators/LineBlockABC.hpp"
20 
21 
22 namespace geos
23 {
24 
28 class LineBlock : public LineBlockABC
29 {
30 public:
36  LineBlock( string const & name, Group * const parent );
37 
42 
43  // getters for element data
44 
45  globalIndex numElements() const override final { return m_numElems; }
46 
51  void setNumElements( globalIndex numElems ) { m_numElems = numElems; }
52 
53  arrayView2d< real64 const > getElemCoords() const override final { return m_elemCenterCoords; }
54 
59  void setElemCoords( arrayView2d< real64 const > elemCenterCoords ) { m_elemCenterCoords = elemCenterCoords; }
60 
61  arrayView1d< globalIndex const > getNextElemIndex() const override final { return m_nextElemId; }
62 
67  void setNextElemIndex( arrayView1d< globalIndex const > nextElemId ) { m_nextElemId = nextElemId; }
68 
69  arrayView1d< arrayView1d< globalIndex const > const > getPrevElemIndices() const override final { return m_prevElemId.toNestedViewConst(); }
70 
71 
77 
78  arrayView2d< globalIndex const > getElemToNodesMap() const override final { return m_elemToNodesMap; }
79 
80 
85  void setElemToNodesMap( arrayView2d< globalIndex const > elemToNodesMap ) { m_elemToNodesMap = elemToNodesMap; }
86 
87  arrayView1d< real64 const > getElemVolume() const override final { return m_elemVolume; }
88 
89 
94  void setElemVolume( arrayView1d< real64 const > elemVolume ) { m_elemVolume = elemVolume; }
95 
96  real64 getElementRadius() const override final { return m_radius; }
97 
98 
103  void setElementRadius( real64 radius ) { m_radius = radius; }
104 
105  // getters for node data
106 
107  globalIndex numNodes() const override final { return m_numNodes; }
108 
109 
114  void setNumNodes( globalIndex numNodes ) { m_numNodes = numNodes; }
115 
116  arrayView2d< real64 const > getNodeCoords() const override final { return m_nodeCoords; }
117 
122  void setNodeCoords( arrayView2d< real64 const > nodeCoords ) { m_nodeCoords = nodeCoords; }
123 
124 
125 
126  // getters for perforation data
127 
128  globalIndex numPerforations() const override final { return m_numPerforations; }
129 
130 
136 
137  arrayView2d< real64 const > getPerfCoords() const override final { return m_perfCoords; }
138 
139 
144  void setPerfCoords( arrayView2d< real64 const > perfCoords ) { m_perfCoords = perfCoords; }
145 
146  arrayView1d< real64 const > getPerfTransmissibility() const override final { return m_perfTransmissibility; }
147 
148 
153  void setPerfTransmissibility( arrayView1d< real64 const > perfTransmissibility ) { m_perfTransmissibility = perfTransmissibility; }
154 
155  arrayView1d< real64 const > getPerfSkinFactor() const override final { return m_perfSkinFactor; }
156 
157  string_array const & getPerfTargetRegion() const override final { return m_perfTargetRegion; }
158 
163  void setPerfSkinFactor( arrayView1d< real64 const > perfSkinFactor ) { m_perfSkinFactor = perfSkinFactor; }
164 
169  void setPerfTargetRegion( string_array const & perfTargetRegion ) { m_perfTargetRegion = perfTargetRegion; }
170 
171  arrayView1d< globalIndex const > getPerfElemIndex() const override final { return m_perfElemId; }
172 
177  void setPerfElemIndex( arrayView1d< globalIndex const > perfElemId ) { m_perfElemId = perfElemId; }
178 
183  void setWellControlsName( string const & wellControlsName ) { m_wellControlsName = wellControlsName; }
184  string const & getWellControlsName( ) const override final { return m_wellControlsName; }
185 
190  void setWellGeneratorName( string const & wellGeneratorName ) { m_wellGeneratorName = wellGeneratorName; }
191  string const & getWellGeneratorName( ) const override final { return m_wellGeneratorName; }
192 
194 
196 
197 
198 
199 private:
200 
201 
202  // XML Input
203 
205  real64 m_radius;
206 
207  // Geometry of the well (later passed to the WellElementSubRegion)
208 
209  // well element data
210 
212  globalIndex m_numElems;
213 
215  array2d< real64 > m_elemCenterCoords;
216 
218  array1d< globalIndex > m_nextElemId;
219 
221  array1d< array1d< globalIndex > > m_prevElemId;
222 
224  array2d< globalIndex > m_elemToNodesMap;
225 
227  array1d< real64 > m_elemVolume;
228 
229 
230  // well node data
231 
233  globalIndex m_numNodes;
234 
236  array2d< real64 > m_nodeCoords;
237 
238  // perforation data
239 
241  globalIndex m_numPerforations;
242 
244  array2d< real64 > m_perfCoords;
245 
247  array1d< real64 > m_perfTransmissibility;
248 
250  array1d< real64 > m_perfSkinFactor;
251 
253  string_array m_perfTargetRegion;
254 
256  array1d< globalIndex > m_perfElemId;
257 
258 
259 
260  // Perforation data
261 
263  string_array m_perforationList;
264 
266  string m_wellControlsName;
267 
269  string m_wellGeneratorName;
270 
271 };
272 }
273 #endif
void setPerfCoords(arrayView2d< real64 const > perfCoords)
Set the locations of the perforations.
Definition: LineBlock.hpp:144
string const & getWellGeneratorName() const override final
Get the well generator name.
Definition: LineBlock.hpp:191
string const & getWellControlsName() const override final
Get the well controls name.
Definition: LineBlock.hpp:184
arrayView2d< real64 const > getPerfCoords() const override final
Get the locations of the perforations.
Definition: LineBlock.hpp:137
void setElemVolume(arrayView1d< real64 const > elemVolume)
Set the volume of the well elements.
Definition: LineBlock.hpp:94
void setElemToNodesMap(arrayView2d< globalIndex const > elemToNodesMap)
Set the global indices of the well nodes nodes connected to each element.
Definition: LineBlock.hpp:85
arrayView2d< real64 const > getElemCoords() const override final
Get the physical location of the centers of well elements.
Definition: LineBlock.hpp:53
arrayView1d< real64 const > getPerfTransmissibility() const override final
Get the well transmissibility at the perforations.
Definition: LineBlock.hpp:146
arrayView1d< real64 const > getPerfSkinFactor() const override final
Get the well skin factor at the perforations.
Definition: LineBlock.hpp:155
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:87
arrayView1d< globalIndex const > getPerfElemIndex() const override final
Get the global indices of the well elements connected to each perforation.
Definition: LineBlock.hpp:171
void setWellGeneratorName(string const &wellGeneratorName)
Set the well genrator name.
Definition: LineBlock.hpp:190
arrayView1d< globalIndex const > getNextElemIndex() const override final
Get the global indices mapping an element to the next.
Definition: LineBlock.hpp:61
globalIndex numPerforations() const override final
Get the global number of perforations on this well.
Definition: LineBlock.hpp:128
string_array const & getPerfTargetRegion() const override final
Get the target region for the perforations.
Definition: LineBlock.hpp:157
real64 getElementRadius() const override final
Get the radius in the well.
Definition: LineBlock.hpp:96
void setNumElements(globalIndex numElems)
Set the global number of well elements.
Definition: LineBlock.hpp:51
void setElementRadius(real64 radius)
Set the radius in the well.
Definition: LineBlock.hpp:103
void setNumPerforations(globalIndex numPerforations)
Set the global number of perforations on this well.
Definition: LineBlock.hpp:135
arrayView2d< real64 const > getNodeCoords() const override final
Get the physical location of the centers of well elements.
Definition: LineBlock.hpp:116
void setPerfElemIndex(arrayView1d< globalIndex const > perfElemId)
Set the global indices of the well elements connected to each perforation.
Definition: LineBlock.hpp:177
void setPerfSkinFactor(arrayView1d< real64 const > perfSkinFactor)
Set the well skin factor at the perforations.
Definition: LineBlock.hpp:163
void setPerfTransmissibility(arrayView1d< real64 const > perfTransmissibility)
Set the well transmissibility at the perforations.
Definition: LineBlock.hpp:153
void setNextElemIndex(arrayView1d< globalIndex const > nextElemId)
Set the global indices mapping an element to the next.
Definition: LineBlock.hpp:67
globalIndex numElements() const override final
Get the global number of well elements.
Definition: LineBlock.hpp:45
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:69
void setNodeCoords(arrayView2d< real64 const > nodeCoords)
Set the physical location of the centers of well elements.
Definition: LineBlock.hpp:122
void setElemCoords(arrayView2d< real64 const > elemCenterCoords)
Set the physical location of the centers of well elements.
Definition: LineBlock.hpp:59
void setPerfTargetRegion(string_array const &perfTargetRegion)
Set the target region for the perforations.
Definition: LineBlock.hpp:169
globalIndex numNodes() const override final
Get the global number of well nodes.
Definition: LineBlock.hpp:107
arrayView2d< globalIndex const > getElemToNodesMap() const override final
Get the global indices of the well nodes nodes connected to each element.
Definition: LineBlock.hpp:78
void setWellControlsName(string const &wellControlsName)
Set the well controls name.
Definition: LineBlock.hpp:183
void setNumNodes(globalIndex numNodes)
Set the global number of well nodes.
Definition: LineBlock.hpp:114
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
ArrayView< T, 2, USD > arrayView2d
Alias for 2D array view.
Definition: DataTypes.hpp:196
std::vector< string > string_array
A 1-dimensional array of geos::string types.
Definition: DataTypes.hpp:393
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:176