opm-common
CompvdTable.hpp
1 /*
2  Copyright (C) 2026 SINTEF Digital
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_COMPVD_TABLE_HPP
20 #define OPM_PARSER_COMPVD_TABLE_HPP
21 
22 #include "SimpleTable.hpp"
23 
24 #include <cstddef>
25 #include <vector>
26 
27 namespace Opm {
28 
29  class DeckItem;
30  class KeywordLocation;
31  class UnitSystem;
32 
50  class CompvdTable : public SimpleTable {
51  public:
52  enum class Phase {
53  Vapor,
54  Liquid,
55  };
56 
57  CompvdTable(const DeckItem& item,
58  const int tableID,
59  const int numComponents,
60  const UnitSystem& unitSystem,
61  const KeywordLocation& location);
62 
63  const TableColumn& getDepthColumn() const;
64  const TableColumn& getMoleFractionColumn(int componentIdx) const;
67 
69  Phase phaseFlag(std::size_t rowIdx) const;
70  const std::vector<Phase>& phaseFlags() const { return phaseFlags_; }
71 
72  int numComponents() const { return static_cast<int>(SimpleTable::numColumns()) - 2; }
73 
74  private:
75  std::vector<Phase> phaseFlags_;
76  };
77 
78 }
79 
80 #endif
const TableColumn & getSaturationPressureColumn() const
Observed saturation pressure, in SI units (Pa).
Definition: Tables.cpp:3041
Definition: KeywordLocation.hpp:27
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: DeckItem.hpp:38
Definition: SimpleTable.hpp:36
Definition: TableColumn.hpp:32
Phase phaseFlag(std::size_t rowIdx) const
Vapor or liquid for the given row.
Definition: Tables.cpp:3046
Definition: UnitSystem.hpp:34
Table representation of the E300 COMPVD keyword.
Definition: CompvdTable.hpp:50