Moved RockTables EclipseState -> Tables
This commit is contained in:
parent
91d5facc4b
commit
a032ea925d
@ -199,10 +199,6 @@ namespace Opm {
|
||||
return m_pvtoTables;
|
||||
}
|
||||
|
||||
const std::vector<RocktabTable>& EclipseState::getRocktabTables() const {
|
||||
return m_rocktabTables;
|
||||
}
|
||||
|
||||
const std::vector<RsvdTable>& EclipseState::getRsvdTables() const {
|
||||
return m_rsvdTables;
|
||||
}
|
||||
@ -286,10 +282,6 @@ namespace Opm {
|
||||
initVFPProdTables(deck, m_vfpprodTables);
|
||||
initVFPInjTables(deck, m_vfpinjTables);
|
||||
|
||||
// the ROCKTAB table comes with additional fun because the number of columns
|
||||
//depends on the presence of the RKTRMDIR keyword...
|
||||
initRocktabTables(deck);
|
||||
|
||||
// the temperature vs depth table. the problem here is that
|
||||
// the TEMPVD (E300) and RTEMPVD (E300 + E100) keywords are
|
||||
// synonymous, but we want to provide only a single cannonical
|
||||
@ -493,42 +485,6 @@ namespace Opm {
|
||||
}
|
||||
}
|
||||
|
||||
void EclipseState::initRocktabTables(DeckConstPtr deck) {
|
||||
if (!deck->hasKeyword("ROCKTAB"))
|
||||
return; // ROCKTAB is not featured by the deck...
|
||||
|
||||
if (deck->numKeywords("ROCKTAB") > 1) {
|
||||
complainAboutAmbiguousKeyword(deck, "ROCKTAB");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto rocktabKeyword = deck->getKeyword("ROCKTAB");
|
||||
|
||||
bool isDirectional = deck->hasKeyword("RKTRMDIR");
|
||||
bool useStressOption = false;
|
||||
if (deck->hasKeyword("ROCKOPTS")) {
|
||||
const auto rockoptsKeyword = deck->getKeyword("ROCKOPTS");
|
||||
useStressOption = (rockoptsKeyword->getRecord(0)->getItem("METHOD")->getTrimmedString(0) == "STRESS");
|
||||
}
|
||||
|
||||
for (size_t tableIdx = 0; tableIdx < rocktabKeyword->size(); ++tableIdx) {
|
||||
if (rocktabKeyword->getRecord(tableIdx)->getItem(0)->size() == 0) {
|
||||
// for ROCKTAB tables, an empty record indicates that the previous table
|
||||
// should be copied...
|
||||
if (tableIdx == 0)
|
||||
throw std::invalid_argument("The first table for keyword ROCKTAB"
|
||||
" must be explicitly defined!");
|
||||
m_rocktabTables[tableIdx] = m_rocktabTables[tableIdx - 1];
|
||||
continue;
|
||||
}
|
||||
|
||||
m_rocktabTables.push_back(RocktabTable());
|
||||
m_rocktabTables[tableIdx].init(rocktabKeyword,
|
||||
isDirectional,
|
||||
useStressOption,
|
||||
tableIdx);
|
||||
}
|
||||
}
|
||||
|
||||
void EclipseState::initGasvisctTables(DeckConstPtr deck,
|
||||
const std::string& keywordName,
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/ImptvdTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PvtgTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PvtoTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/RocktabTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/RsvdTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/RvvdTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/RtempvdTable.hpp>
|
||||
@ -111,7 +110,6 @@ namespace Opm {
|
||||
const std::vector<PlyshlogTable>& getPlyshlogTables() const;
|
||||
const std::vector<PvtgTable>& getPvtgTables() const;
|
||||
const std::vector<PvtoTable>& getPvtoTables() const;
|
||||
const std::vector<RocktabTable>& getRocktabTables() const;
|
||||
const std::vector<RsvdTable>& getRsvdTables() const;
|
||||
const std::vector<RvvdTable>& getRvvdTables() const;
|
||||
const std::vector<RtempvdTable>& getRtempvdTables() const;
|
||||
@ -194,7 +192,6 @@ namespace Opm {
|
||||
}
|
||||
}
|
||||
|
||||
void initRocktabTables(DeckConstPtr deck);
|
||||
void initGasvisctTables(DeckConstPtr deck,
|
||||
const std::string& keywordName,
|
||||
std::vector<GasvisctTable>& tableVector);
|
||||
@ -250,7 +247,6 @@ namespace Opm {
|
||||
std::vector<PlyshlogTable> m_plyshlogTables;
|
||||
std::vector<PvtgTable> m_pvtgTables;
|
||||
std::vector<PvtoTable> m_pvtoTables;
|
||||
std::vector<RocktabTable> m_rocktabTables;
|
||||
std::vector<RsvdTable> m_rsvdTables;
|
||||
std::vector<RvvdTable> m_rvvdTables;
|
||||
std::vector<RtempvdTable> m_rtempvdTables;
|
||||
|
@ -23,12 +23,12 @@
|
||||
|
||||
namespace Opm {
|
||||
// forward declaration
|
||||
class EclipseState;
|
||||
class Tables;
|
||||
|
||||
class RocktabTable : protected SingleRecordTable {
|
||||
typedef SingleRecordTable ParentType;
|
||||
|
||||
friend class EclipseState;
|
||||
friend class Tables;
|
||||
RocktabTable() = default;
|
||||
|
||||
/*!
|
||||
|
@ -44,6 +44,8 @@ namespace Opm {
|
||||
initSimpleTables(deck, "PLYDHFLF", m_plydhflfTables);
|
||||
initSimpleTables(deck, "OILVISCT", m_oilvisctTables);
|
||||
initSimpleTables(deck, "WATVISCT", m_watvisctTables);
|
||||
|
||||
initRocktabTables(deck);
|
||||
}
|
||||
|
||||
|
||||
@ -77,6 +79,44 @@ namespace Opm {
|
||||
}
|
||||
|
||||
|
||||
void Tables::initRocktabTables(const Deck& deck) {
|
||||
if (!deck.hasKeyword("ROCKTAB"))
|
||||
return; // ROCKTAB is not featured by the deck...
|
||||
|
||||
if (deck.numKeywords("ROCKTAB") > 1) {
|
||||
complainAboutAmbiguousKeyword(deck, "ROCKTAB");
|
||||
return;
|
||||
}
|
||||
|
||||
const auto rocktabKeyword = deck.getKeyword("ROCKTAB");
|
||||
|
||||
bool isDirectional = deck.hasKeyword("RKTRMDIR");
|
||||
bool useStressOption = false;
|
||||
if (deck.hasKeyword("ROCKOPTS")) {
|
||||
const auto rockoptsKeyword = deck.getKeyword("ROCKOPTS");
|
||||
useStressOption = (rockoptsKeyword->getRecord(0)->getItem("METHOD")->getTrimmedString(0) == "STRESS");
|
||||
}
|
||||
|
||||
for (size_t tableIdx = 0; tableIdx < rocktabKeyword->size(); ++tableIdx) {
|
||||
if (rocktabKeyword->getRecord(tableIdx)->getItem(0)->size() == 0) {
|
||||
// for ROCKTAB tables, an empty record indicates that the previous table
|
||||
// should be copied...
|
||||
if (tableIdx == 0)
|
||||
throw std::invalid_argument("The first table for keyword ROCKTAB"
|
||||
" must be explicitly defined!");
|
||||
m_rocktabTables[tableIdx] = m_rocktabTables[tableIdx - 1];
|
||||
continue;
|
||||
}
|
||||
|
||||
m_rocktabTables.push_back(RocktabTable());
|
||||
m_rocktabTables[tableIdx].init(rocktabKeyword,
|
||||
isDirectional,
|
||||
useStressOption,
|
||||
tableIdx);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::shared_ptr<const Tabdims> Tables::getTabdims() const {
|
||||
return m_tabdims;
|
||||
}
|
||||
@ -156,6 +196,11 @@ namespace Opm {
|
||||
return m_plydhflfTables;
|
||||
}
|
||||
|
||||
const std::vector<RocktabTable>& Tables::getRocktabTables() const {
|
||||
return m_rocktabTables;
|
||||
}
|
||||
|
||||
|
||||
void Tables::complainAboutAmbiguousKeyword(const Deck& deck, const std::string& keywordName) const {
|
||||
OpmLog::addMessage(Log::MessageType::Error, "The " + keywordName + " keyword must be unique in the deck. Ignoring all!");
|
||||
auto keywords = deck.getKeywordList(keywordName);
|
||||
|
@ -41,6 +41,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/PlydhflfTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/OilvisctTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/WatvisctTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/RocktabTable.hpp>
|
||||
|
||||
|
||||
namespace Opm {
|
||||
@ -67,6 +68,7 @@ namespace Opm {
|
||||
const std::vector<PlyrockTable>& getPlyrockTables() const;
|
||||
const std::vector<PlyviscTable>& getPlyviscTables() const;
|
||||
const std::vector<PlydhflfTable>& getPlydhflfTables() const;
|
||||
const std::vector<RocktabTable>& getRocktabTables() const;
|
||||
const std::vector<WatvisctTable>& getWatvisctTables() const;
|
||||
const std::vector<OilvisctTable>& getOilvisctTables() const;
|
||||
|
||||
@ -74,6 +76,7 @@ namespace Opm {
|
||||
void complainAboutAmbiguousKeyword(const Deck& deck, const std::string& keywordName) const;
|
||||
|
||||
void initTabdims(const Deck& deck);
|
||||
void initRocktabTables(const Deck& deck);
|
||||
|
||||
|
||||
template <class TableType>
|
||||
@ -123,7 +126,7 @@ namespace Opm {
|
||||
std::vector<PlyrockTable> m_plyrockTables;
|
||||
std::vector<PlyviscTable> m_plyviscTables;
|
||||
std::vector<PlydhflfTable> m_plydhflfTables;
|
||||
|
||||
std::vector<RocktabTable> m_rocktabTables;
|
||||
std::vector<WatvisctTable> m_watvisctTables;
|
||||
std::vector<OilvisctTable> m_oilvisctTables;
|
||||
std::shared_ptr<Tabdims> m_tabdims;
|
||||
|
Loading…
Reference in New Issue
Block a user