Skip to content

Commit

Permalink
Merge pull request #1529 from akva2/internalize_tlmixpar
Browse files Browse the repository at this point in the history
internalize TLMIXPAR
  • Loading branch information
akva2 authored Mar 4, 2020
2 parents 85ddd2e + 7ac9b6c commit ab6a92a
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 0 deletions.
16 changes: 16 additions & 0 deletions opm/parser/eclipse/EclipseState/Tables/FlatTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ struct PvcdoTable : public FlatTable< PVCDORecord > {
using FlatTable< PVCDORecord >::FlatTable;
};

struct TlmixparRecord {
static constexpr std::size_t size = 2;

double viscosity;
double density;

bool operator==(const TlmixparRecord& data) const {
return viscosity == data.viscosity &&
density == data.density;
}
};

struct TlmixparTable : public FlatTable< TlmixparRecord> {
using FlatTable< TlmixparRecord >::FlatTable;
};

struct VISCREFRecord {
static constexpr std::size_t size = 2;

Expand Down
3 changes: 3 additions & 0 deletions opm/parser/eclipse/EclipseState/Tables/TableManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ namespace Opm {
const PvcdoTable& pvcdoTable,
const DensityTable& densityTable,
const RockTable& rockTable,
const TlmixparTable& tlmixparTable,
const ViscrefTable& viscrefTable,
const WatdentTable& watdentTable,
const std::vector<PvtwsaltTable>& pvtwsaltTables,
Expand Down Expand Up @@ -178,6 +179,7 @@ namespace Opm {
const DensityTable& getDensityTable() const;
const RockTable& getRockTable() const;
const ViscrefTable& getViscrefTable() const;
const TlmixparTable& getTlmixparTable() const;
const WatdentTable& getWatdentTable() const;
const std::map<int, PlymwinjTable>& getPlymwinjTables() const;
const std::map<int, SkprwatTable>& getSkprwatTables() const;
Expand Down Expand Up @@ -424,6 +426,7 @@ namespace Opm {
PvcdoTable m_pvcdoTable;
DensityTable m_densityTable;
RockTable m_rockTable;
TlmixparTable m_tlmixparTable;
ViscrefTable m_viscrefTable;
WatdentTable m_watdentTable;
std::vector<PvtwsaltTable> m_pvtwsaltTables;
Expand Down
12 changes: 12 additions & 0 deletions src/opm/parser/eclipse/EclipseState/Tables/TableManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ namespace Opm {
const PvcdoTable& pvcdoTable,
const DensityTable& densityTable,
const RockTable& rockTable,
const TlmixparTable& tlmixparTable,
const ViscrefTable& viscrefTable,
const WatdentTable& watdentTable,
const std::vector<PvtwsaltTable>& pvtwsaltTables,
Expand Down Expand Up @@ -136,6 +137,7 @@ namespace Opm {
m_pvcdoTable(pvcdoTable),
m_densityTable(densityTable),
m_rockTable(rockTable),
m_tlmixparTable(tlmixparTable),
m_viscrefTable(viscrefTable),
m_watdentTable(watdentTable),
m_pvtwsaltTables(pvtwsaltTables),
Expand Down Expand Up @@ -235,6 +237,10 @@ namespace Opm {
this->stcond.pressure = stcondKeyword.getRecord(0).getItem("PRESSURE").getSIDouble(0);
}

if (deck.hasKeyword<ParserKeywords::TLMIXPAR>()) {
this->m_tlmixparTable = TlmixparTable(deck.getKeyword("TLMIXPAR"));
}

using GC = ParserKeywords::GCOMPIDX;
if (deck.hasKeyword<GC>())
this->m_gas_comp_index = deck.getKeyword<GC>().getRecord(0).getItem<GC::GAS_COMPONENT_INDEX>().get<int>(0);
Expand All @@ -249,6 +255,7 @@ namespace Opm {
m_pvtwTable = data.m_pvtwTable;
m_pvcdoTable = data.m_pvcdoTable;
m_densityTable = data.m_densityTable;
m_tlmixparTable = data.m_tlmixparTable;
m_viscrefTable = data.m_viscrefTable;
m_watdentTable = data.m_watdentTable;
m_pvtwsaltTables = data.m_pvtwsaltTables;
Expand Down Expand Up @@ -1017,6 +1024,10 @@ namespace Opm {
return getTables("TLPMIXPA");
}

const TlmixparTable& TableManager::getTlmixparTable() const {
return m_tlmixparTable;
}

const JFunc& TableManager::getJFunc() const {
if (!jfunc)
throw std::invalid_argument("Cannot get JFUNC table when JFUNC not in deck");
Expand Down Expand Up @@ -1092,6 +1103,7 @@ namespace Opm {
m_pvtwTable == data.m_pvtwTable &&
m_pvcdoTable == data.m_pvcdoTable &&
m_densityTable == data.m_densityTable &&
m_tlmixparTable == data.m_tlmixparTable &&
m_viscrefTable == data.m_viscrefTable &&
m_watdentTable == data.m_watdentTable &&
m_pvtwsaltTables == data.m_pvtwsaltTables &&
Expand Down
1 change: 1 addition & 0 deletions src/opm/parser/eclipse/EclipseState/Tables/Tables.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1338,6 +1338,7 @@ template FlatTable< PVTWRecord >::FlatTable( const DeckKeyword& );
template FlatTable< PVCDORecord >::FlatTable( const DeckKeyword& );
template FlatTable< ROCKRecord >::FlatTable( const DeckKeyword& );
template FlatTable< VISCREFRecord >::FlatTable( const DeckKeyword& );
template FlatTable< TlmixparRecord>::FlatTable( const DeckKeyword& );
template FlatTable< WATDENTRecord >::FlatTable( const DeckKeyword& );

} // namespace Opm

0 comments on commit ab6a92a

Please sign in to comment.