WelspecsWrapper.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 by Andreas Lauser
3 
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18  */
19 #ifndef OPM_PARSER_WELSPECS_WRAPPER_HPP
20 #define OPM_PARSER_WELSPECS_WRAPPER_HPP
21 
23 
24 #include <vector>
25 #include <algorithm>
26 
27 namespace Opm {
29  public:
36  : m_keyword(keyword)
37  {
38  }
39 
43  int numWells() const
44  { return m_keyword->size(); }
45 
49  const std::string wellName(int wellIdx) const
50  { return m_keyword->getRecord(wellIdx)->getItem(0)->getString(0); }
51 
55  const std::string groupName(int wellIdx) const
56  { return m_keyword->getRecord(wellIdx)->getItem(1)->getString(0); }
57 
61  int coordinateI(int wellIdx) const
62  { return m_keyword->getRecord(wellIdx)->getItem(2)->getInt(0); }
63 
67  int coordinateJ(int wellIdx) const
68  { return m_keyword->getRecord(wellIdx)->getItem(3)->getInt(0); }
69 
73  double referenceDepth(int wellIdx) const
74  { return m_keyword->getRecord(wellIdx)->getItem(4)->getSIDouble(0); }
75 
82  const std::string preferredPhase(int wellIdx) const
83  { return m_keyword->getRecord(wellIdx)->getItem(5)->getString(0); }
84 
88  double drainageRadius(int wellIdx) const
89  { return m_keyword->getRecord(wellIdx)->getItem(6)->getSIDouble(0); }
90 
96  const std::string inflowEquation(int wellIdx) const
97  { return m_keyword->getRecord(wellIdx)->getItem(7)->getString(0); }
98 
102  bool isShut(int wellIdx) const
103  { return m_keyword->getRecord(wellIdx)->getItem(8)->getString(0) == "SHUT"; }
104 
108  bool allowCrossflow(int wellIdx) const
109  { return m_keyword->getRecord(wellIdx)->getItem(9)->getString(0) == "YES"; }
110 
114  int pressureTableNumber(int wellIdx) const
115  { return m_keyword->getRecord(wellIdx)->getItem(10)->getInt(0); }
116 
124  const std::string hydrostaticCalculation(int wellIdx) const
125  { return m_keyword->getRecord(wellIdx)->getItem(11)->getString(0); }
126 
132  int inPlaceRegionNumber(int wellIdx) const
133  { return m_keyword->getRecord(wellIdx)->getItem(12)->getInt(0); }
134 
135  // items 14 and 15 are "reserved for FrontSim"
136 
144  const std::string wellModel(int wellIdx) const
145  { return m_keyword->getRecord(wellIdx)->getItem(15)->getString(0); }
146 
147  private:
148  Opm::DeckKeywordConstPtr m_keyword;
149  };
150 }
151 
152 #endif // OPM_PARSER_WELSPECS_WRAPPER_HPP
153 
WelspecsWrapper(Opm::DeckKeywordConstPtr keyword)
A wrapper class to provide convenient access to the data of an individual well as exposed by the 'WEL...
Definition: WelspecsWrapper.hpp:35
Definition: Deck.hpp:29
int coordinateJ(int wellIdx) const
Return north-south grid coordinate of the well.
Definition: WelspecsWrapper.hpp:67
std::shared_ptr< const DeckKeyword > DeckKeywordConstPtr
Definition: DeckKeyword.hpp:71
Definition: WelspecsWrapper.hpp:28
const std::string preferredPhase(int wellIdx) const
Return the preferred fluid phase of this well.
Definition: WelspecsWrapper.hpp:82
int numWells() const
Return the number if wells covered by the WELSPECS keyword.
Definition: WelspecsWrapper.hpp:43
bool allowCrossflow(int wellIdx) const
Returns true if crossflow should be allowed.
Definition: WelspecsWrapper.hpp:108
const std::string groupName(int wellIdx) const
Return the name of the group this well belongs to.
Definition: WelspecsWrapper.hpp:55
int coordinateI(int wellIdx) const
Return east-west grid coordinate of the well.
Definition: WelspecsWrapper.hpp:61
double drainageRadius(int wellIdx) const
Return effective drainage radius of the well.
Definition: WelspecsWrapper.hpp:88
double referenceDepth(int wellIdx) const
Return reference depth to which the bottom hole pressure of the well applies.
Definition: WelspecsWrapper.hpp:73
bool isShut(int wellIdx) const
Returns true if the well is closed for fluids.
Definition: WelspecsWrapper.hpp:102
const std::string wellModel(int wellIdx) const
Indicates well model to be used.
Definition: WelspecsWrapper.hpp:144
const std::string wellName(int wellIdx) const
Return the name of the well.
Definition: WelspecsWrapper.hpp:49
const std::string hydrostaticCalculation(int wellIdx) const
Indicates the type of the calculation to be used for hydrostatic pressure.
Definition: WelspecsWrapper.hpp:124
int pressureTableNumber(int wellIdx) const
Returns the pressure number to be used for the wellbore fluids.
Definition: WelspecsWrapper.hpp:114
const std::string inflowEquation(int wellIdx) const
Return the inflow equation to be used for the well.
Definition: WelspecsWrapper.hpp:96
int inPlaceRegionNumber(int wellIdx) const
Indicates the "fluid in place" region table number used to calculate volumetric rates at reservoir co...
Definition: WelspecsWrapper.hpp:132