PvtxTable.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_PVTX_TABLE_HPP
20#define OPM_PARSER_PVTX_TABLE_HPP
21
22#include <vector>
23
28
29/*
30 This class is a common base class for the PVTG and PVTO tables. The
31 PVTO and PVTG keywords have a quite complex structure. The structure
32 consists of alternating records of saturated data and corresponding
33 undersaturated tables, this structure is again repeated for the
34 different satnum regions.
35
36
37 PVTO
38
39-- RSO PRESSURE B-OIL VISCOSITY
40-- (BAR) (CP)
41
42 [ 20.59 { 50.00 1.10615 1.180 } ] \
43 { 75.00 1.10164 1.247 } |
44 { 100.00 1.09744 1.315 } |
45 { 125.00 1.09351 1.384 } |
46 { 150.00 1.08984 1.453 }/ |
47 |
48 [ 28.19 { 70.00 1.12522 1.066 } ] |
49 { 95.00 1.12047 1.124 } |
50 { 120.00 1.11604 1.182 } |-- Satnum region 1
51 { 145.00 1.11191 1.241 } |
52 { 170.00 1.10804 1.300 }/ |
53 |
54 [ 36.01 { 90.00 1.14458 0.964 } ] |
55 { 115.00 1.13959 1.014 } |
56 { 140.00 1.13494 1.064 } |
57 { 165.00 1.13060 1.115 } |
58 { 190.00 1.12653 1.166 }/ |
59/ /
60 404.60 594.29 1.97527 0.21564 \
61 619.29 1.96301 0.21981 |
62 644.29 1.95143 0.22393 |-- Satnum region 2
63 669.29 1.94046 0.22801 |
64 694.29 1.93005 0.23204 / |
65/ /
66 404.60 594.29 1.97527 0.21564 \
67 619.29 1.96301 0.21981 |
68 644.29 1.95143 0.22393 |
69 669.29 1.94046 0.22801 |
70 694.29 1.93005 0.23204 / |-- Satnum region 3
71 404.60 594.29 1.97527 0.21564 |
72 619.29 1.96301 0.21981 |
73 644.29 1.95143 0.22393 |
74 669.29 1.94046 0.22801 |
75 694.29 1.93005 0.23204 / /
76/
77
78
79In satnum region1 the saturated records are marked with [ ... ], and
80the corresponding undersaturated tables are marked with { ... }. So
81for satnum region1 the table of saturated properties looks like:
82
83 RSO PRESSURE B-OIL VISCOSITY
84 20.59 50.00 1.10615 1.180
85 28.19 70.00 1.12522 1.066
86 36.01 90.00 1.14458 0.964
87
88In the PvtxTable class this table is available as the method
89getSaturatedTable( ). For each RS value there is a table of
90undersaturated properties; since the saturated table for region1 has
91three rows there are three such tables, these tables are available as
92getUnderSaturatedTable( index ). In this particular example the first
93undersaturated table looks like:
94
95 PRESSURE B-OIL VISCOSITY
96 50.00 1.10615 1.180
97 75.00 1.10164 1.247
98 100.00 1.09744 1.315
99 125.00 1.09351 1.384
100 150.00 1.08984 1.453
101
102The first row actually corresponds to saturated values.
103*/
104
105
106 namespace Opm {
107
108 class DeckKeyword;
109
110 class PvtxTable {
111 public:
112 static size_t numTables( const DeckKeyword& keyword);
113 static std::vector<std::pair<size_t , size_t> > recordRanges( const DeckKeyword& keyword);
114
115 PvtxTable() = default;
116 explicit PvtxTable(const std::string& columnName);
117
119
120 const SimpleTable& getUnderSaturatedTable(size_t tableNumber) const;
121 void init(const DeckKeyword& keyword, size_t tableIdx);
122 size_t size() const;
123 double evaluate(const std::string& column, double outerArg, double innerArg) const;
124 double getArgValue(size_t index) const;
126
127 /*
128 Will iterate over the internal undersaturated tables; same
129 as getUnderSaturatedTable( ).
130 */
131 std::vector< SimpleTable >::const_iterator begin() const;
132 std::vector< SimpleTable >::const_iterator end() const;
133
134 bool operator==(const PvtxTable& data) const;
135
136 template<class Serializer>
137 void serializeOp(Serializer& serializer)
138 {
140 m_outerColumn.serializeOp(serializer);
142 m_saturatedSchema.serializeOp(serializer);
143 serializer.vector(m_underSaturatedTables);
144 m_saturatedTable.serializeOp(serializer);
145 }
146
147 protected:
150
153 std::vector< SimpleTable > m_underSaturatedTables;
155 };
156
157}
158
159#endif
int index
Definition: cJSON.h:168
const char *const string
Definition: cJSON.h:170
Definition: ColumnSchema.hpp:31
void serializeOp(Serializer &serializer)
Definition: ColumnSchema.hpp:51
Definition: DeckKeyword.hpp:38
Definition: PvtxTable.hpp:110
static std::vector< std::pair< size_t, size_t > > recordRanges(const DeckKeyword &keyword)
std::vector< SimpleTable >::const_iterator begin() const
TableSchema m_underSaturatedSchema
Definition: PvtxTable.hpp:151
double getArgValue(size_t index) const
size_t size() const
bool operator==(const PvtxTable &data) const
std::vector< SimpleTable > m_underSaturatedTables
Definition: PvtxTable.hpp:153
TableColumn m_outerColumn
Definition: PvtxTable.hpp:149
std::vector< SimpleTable >::const_iterator end() const
ColumnSchema m_outerColumnSchema
Definition: PvtxTable.hpp:148
PvtxTable()=default
double evaluate(const std::string &column, double outerArg, double innerArg) const
PvtxTable(const std::string &columnName)
void serializeOp(Serializer &serializer)
Definition: PvtxTable.hpp:137
TableSchema m_saturatedSchema
Definition: PvtxTable.hpp:152
static PvtxTable serializeObject()
const SimpleTable & getSaturatedTable() const
SimpleTable m_saturatedTable
Definition: PvtxTable.hpp:154
void init(const DeckKeyword &keyword, size_t tableIdx)
static size_t numTables(const DeckKeyword &keyword)
const SimpleTable & getUnderSaturatedTable(size_t tableNumber) const
Definition: Serializer.hpp:38
Definition: SimpleTable.hpp:35
void serializeOp(Serializer &serializer)
Definition: SimpleTable.hpp:73
Definition: TableColumn.hpp:32
void serializeOp(Serializer &serializer)
Definition: TableColumn.hpp:71
Definition: TableSchema.hpp:31
void serializeOp(Serializer &serializer)
Definition: TableSchema.hpp:46
UDAKeyword keyword(UDAControl control)
Definition: A.hpp:4
static std::string data()
Definition: exprtk.hpp:40022