20 #ifndef OPM_GAS_PLANT_TABLE_HPP 21 #define OPM_GAS_PLANT_TABLE_HPP 23 #include <opm/common/OpmLog/KeywordLocation.hpp> 27 #include <unordered_set> 50 std::size_t numComponents,
63 std::size_t maxTables,
68 int name()
const {
return this->m_table_num; }
74 int lowerComponent()
const {
return this->m_lower_component; }
75 int upperComponent()
const {
return this->m_upper_component; }
76 std::size_t numComponents()
const {
return this->m_num_components; }
80 std::size_t
rowWidth()
const {
return this->m_num_components + 1; }
82 std::size_t numRows()
const 88 if (this->m_num_components == 0) {
91 return this->m_data.size() / this->
rowWidth();
97 assert(row < this->numRows());
98 return this->m_data[row * this->
rowWidth()];
105 double recovery(std::size_t row, std::size_t comp)
const 107 assert(row < this->numRows());
108 assert(comp < this->m_num_components);
109 return this->m_data[row * this->
rowWidth() + 1 + comp];
117 template <
class Serializer>
120 serializer(this->m_table_num);
121 serializer(this->m_lower_component);
122 serializer(this->m_upper_component);
123 serializer(this->m_num_components);
124 serializer(this->m_data);
129 int m_lower_component{};
130 int m_upper_component{};
131 std::size_t m_num_components{};
132 std::vector<double> m_data{};
137 #endif // OPM_GAS_PLANT_TABLE_HPP Definition: KeywordLocation.hpp:27
static void warnOnTableNumber(std::unordered_set< int > &seenTableNumbers, int tableNumber, std::size_t maxTables, const KeywordLocation &location)
Emit the GPTABLE table-number diagnostics shared by the SCHEDULE handler and the SOLUTION-section see...
Definition: GasPlantTable.cpp:150
double recovery(std::size_t row, std::size_t comp) const
Recovery fraction of component comp for row.
Definition: GasPlantTable.hpp:105
int name() const
Gas plant table number.
Definition: GasPlantTable.hpp:68
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
std::size_t rowWidth() const
Number of values stored per table row: the heavy-component mole fraction plus one recovery fraction p...
Definition: GasPlantTable.hpp:80
double heavyMoleFraction(std::size_t row) const
Heavy-component mole fraction for row (the first column of the row).
Definition: GasPlantTable.hpp:95
A single GPTABLE gas-plant recovery table.
Definition: GasPlantTable.hpp:41
Definition: DeckRecord.hpp:33
Class for (de-)serializing.
Definition: Serializer.hpp:95