PlyshlogTable.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2015 Statoil ASA.
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_PLYSHLOG_TABLE_HPP
20 #define OPM_PARSER_PLYSHLOG_TABLE_HPP
21 
22 #include <opm/parser/eclipse/Parser/ParserKeywords.hpp>
23 
24 #include "SimpleTable.hpp"
25 
26 namespace Opm {
27  // forward declaration
28  class TableManager;
29 
30  class PlyshlogTable : public SimpleTable {
31  public:
32  friend class TableManager;
33  PlyshlogTable() = default;
34 
35 
40  void init(Opm::DeckRecordConstPtr indexRecord, Opm::DeckRecordConstPtr dataRecord) {
41  {
42  const auto item = indexRecord->getItem<ParserKeywords::PLYSHLOG::REF_POLYMER_CONCENTRATION>();
43  setRefPolymerConcentration(item->getRawDouble(0));
44  }
45 
46  {
47  const auto item = indexRecord->getItem<ParserKeywords::PLYSHLOG::REF_SALINITY>();
48  if (item->hasValue(0)) {
49  setHasRefSalinity(true);
50  setRefSalinity(item->getRawDouble(0));
51  } else
52  setHasRefSalinity(false);
53  }
54 
55  {
56  const auto item = indexRecord->getItem<ParserKeywords::PLYSHLOG::REF_TEMPERATURE>();
57  if (item->hasValue(0)) {
59  setRefTemperature(item->getRawDouble(0));
60  } else
61  setHasRefTemperature(false);
62  }
63 
64  SimpleTable::init( dataRecord->getItem<ParserKeywords::PLYSHLOG::DATA>(),
65  std::vector<std::string>{ "WaterVelocity", "ShearMultiplier" } );
66  SimpleTable::checkNonDefaultable("WaterVelocity");
67  SimpleTable::checkMonotonic("WaterVelocity", /*isAscending=*/true);
68  SimpleTable::checkNonDefaultable("ShearMultiplier");
69 
70  }
71 
72  public:
73 
74  double getRefPolymerConcentration() const {
75  return m_refPolymerConcentration;
76  }
77  double getRefSalinity() const {
78  return m_refSalinity;
79  }
80 
81  double getRefTemperature() const{
82  return m_refTemperature;
83  }
84 
85  void setRefPolymerConcentration(const double refPlymerConcentration) {
86  m_refPolymerConcentration = refPlymerConcentration;
87  }
88 
89  void setRefSalinity(const double refSalinity) {
90  m_refSalinity = refSalinity;
91  }
92 
93  void setRefTemperature(const double refTemperature) {
94  m_refTemperature = refTemperature;
95  }
96 
97  bool hasRefSalinity() const {
98  return m_hasRefSalinity;
99  }
100 
101  bool hasRefTemperature() const {
102  return m_hasRefTemperature;
103  }
104 
105  void setHasRefSalinity(const bool has){
106  m_hasRefSalinity = has;
107  }
108 
109  void setHasRefTemperature(const bool has){
110  m_refTemperature = has;
111  }
112 
113  const std::vector<double> &getWaterVelocityColumn() const
114  { return getColumn(0); }
115 
116  const std::vector<double> &getShearMultiplierColumn() const
117  { return getColumn(1); }
118 
119 
120  private:
121  double m_refPolymerConcentration;
122  double m_refSalinity;
123  double m_refTemperature;
124 
125  bool m_hasRefSalinity;
126  bool m_hasRefTemperature;
127  };
128 
129 }
130 
131 #endif
const std::vector< double > & getWaterVelocityColumn() const
Definition: PlyshlogTable.hpp:113
void setHasRefTemperature(const bool has)
Definition: PlyshlogTable.hpp:109
void init(Opm::DeckItemConstPtr deckItem, const std::vector< std::string > &columnNames)
Read simple tables from keywords like SWOF.
Definition: Deck.hpp:29
double getRefPolymerConcentration() const
Definition: PlyshlogTable.hpp:74
const std::vector< double > & getColumn(const std::string &name) const
void checkNonDefaultable(const std::string &columnName)
bool hasRefTemperature() const
Definition: PlyshlogTable.hpp:101
void setRefSalinity(const double refSalinity)
Definition: PlyshlogTable.hpp:89
Definition: TableManager.hpp:66
PlyshlogTable()=default
bool hasRefSalinity() const
Definition: PlyshlogTable.hpp:97
void setHasRefSalinity(const bool has)
Definition: PlyshlogTable.hpp:105
void checkMonotonic(const std::string &columnName, bool isAscending, bool isStrictlyMonotonic=true)
void setRefPolymerConcentration(const double refPlymerConcentration)
Definition: PlyshlogTable.hpp:85
std::shared_ptr< const DeckRecord > DeckRecordConstPtr
Definition: DeckRecord.hpp:54
Definition: SimpleTable.hpp:32
const std::vector< double > & getShearMultiplierColumn() const
Definition: PlyshlogTable.hpp:116
double getRefSalinity() const
Definition: PlyshlogTable.hpp:77
void setRefTemperature(const double refTemperature)
Definition: PlyshlogTable.hpp:93
Definition: PlyshlogTable.hpp:30
double getRefTemperature() const
Definition: PlyshlogTable.hpp:81
void init(Opm::DeckRecordConstPtr indexRecord, Opm::DeckRecordConstPtr dataRecord)
Read the PLYSHLOG keyword and provide some convenience methods for it.
Definition: PlyshlogTable.hpp:40