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 Total, S.A
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 
162  void setPerfSkinFactor( arrayView1d< real64 const > perfSkinFactor ) { m_perfSkinFactor = perfSkinFactor; }
163 
164  arrayView1d< globalIndex const > getPerfElemIndex() const override final { return m_perfElemId; }
165 
170  void setPerfElemIndex( arrayView1d< globalIndex const > perfElemId ) { m_perfElemId = perfElemId; }
171 
176  void setWellControlsName( string const & wellControlsName ) { m_wellControlsName = wellControlsName; }
177  string const & getWellControlsName( ) const override final { return m_wellControlsName; }
178 
183  void setWellGeneratorName( string const & wellGeneratorName ) { m_wellGeneratorName = wellGeneratorName; }
184  string const & getWellGeneratorName( ) const override final { return m_wellGeneratorName; }
185 
187 
189 
190 
191 
192 private:
193 
194 
195  // XML Input
196 
198  real64 m_radius;
199 
200  // Geometry of the well (later passed to the WellElementSubRegion)
201 
202  // well element data
203 
205  globalIndex m_numElems;
206 
208  array2d< real64 > m_elemCenterCoords;
209 
211  array1d< globalIndex > m_nextElemId;
212 
214  array1d< array1d< globalIndex > > m_prevElemId;
215 
217  array2d< globalIndex > m_elemToNodesMap;
218 
220  array1d< real64 > m_elemVolume;
221 
222 
223  // well node data
224 
226  globalIndex m_numNodes;
227 
229  array2d< real64 > m_nodeCoords;
230 
231  // perforation data
232 
234  globalIndex m_numPerforations;
235 
237  array2d< real64 > m_perfCoords;
238 
240  array1d< real64 > m_perfTransmissibility;
241 
243  array1d< real64 > m_perfSkinFactor;
244 
246  array1d< globalIndex > m_perfElemId;
247 
248 
249 
250  // Perforation data
251 
253  string_array m_perforationList;
254 
256  string m_wellControlsName;
257 
259  string m_wellGeneratorName;
260 
261 };
262 }
263 #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:184
string const & getWellControlsName() const override final
Get the well controls name.
Definition: LineBlock.hpp:177
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:164
void setWellGeneratorName(string const &wellGeneratorName)
Set the well genrator name.
Definition: LineBlock.hpp:183
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
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:170
void setPerfSkinFactor(arrayView1d< real64 const > perfSkinFactor)
Set the well skin factor at the perforations.
Definition: LineBlock.hpp:162
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
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:176
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
array1d< string > string_array
A 1-dimensional array of geos::string types.
Definition: DataTypes.hpp:392
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
Array< T, 1 > array1d
Alias for 1D array.
Definition: DataTypes.hpp:176