Moved SGOF EclipseState -> Tables
This commit is contained in:
parent
bc852bc974
commit
265219d322
@ -260,10 +260,6 @@ namespace Opm {
|
||||
return m_vfpinjTables;
|
||||
}
|
||||
|
||||
const std::vector<SgofTable>& EclipseState::getSgofTables() const {
|
||||
return m_sgofTables;
|
||||
}
|
||||
|
||||
const std::vector<SlgofTable>& EclipseState::getSlgofTables() const {
|
||||
return m_slgofTables;
|
||||
}
|
||||
@ -346,7 +342,6 @@ namespace Opm {
|
||||
initSimpleTables(deck, "PVDO", m_pvdoTables);
|
||||
initSimpleTables(deck, "RSVD", m_rsvdTables);
|
||||
initSimpleTables(deck, "RVVD", m_rvvdTables);
|
||||
initSimpleTables(deck, "SGOF", m_sgofTables);
|
||||
initSimpleTables(deck, "SLGOF", m_slgofTables);
|
||||
initSimpleTables(deck, "SOF2", m_sof2Tables);
|
||||
initSimpleTables(deck, "SOF3", m_sof3Tables);
|
||||
|
@ -56,7 +56,6 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/RvvdTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/RtempvdTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/WatvisctTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/SgofTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/SlgofTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/Sof2Table.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/Sof3Table.hpp>
|
||||
@ -141,7 +140,6 @@ namespace Opm {
|
||||
const std::vector<RsvdTable>& getRsvdTables() const;
|
||||
const std::vector<RvvdTable>& getRvvdTables() const;
|
||||
const std::vector<RtempvdTable>& getRtempvdTables() const;
|
||||
const std::vector<SgofTable>& getSgofTables() const;
|
||||
const std::vector<SlgofTable>& getSlgofTables() const;
|
||||
const std::vector<Sof2Table>& getSof2Tables() const;
|
||||
const std::vector<Sof3Table>& getSof3Tables() const;
|
||||
@ -297,7 +295,6 @@ namespace Opm {
|
||||
std::vector<RsvdTable> m_rsvdTables;
|
||||
std::vector<RvvdTable> m_rvvdTables;
|
||||
std::vector<RtempvdTable> m_rtempvdTables;
|
||||
std::vector<SgofTable> m_sgofTables;
|
||||
std::vector<SlgofTable> m_slgofTables;
|
||||
std::vector<Sof2Table> m_sof2Tables;
|
||||
std::vector<Sof3Table> m_sof3Tables;
|
||||
|
@ -99,22 +99,24 @@ protected:
|
||||
m_maxWaterSat[tableIdx] = swofTables[tableIdx].getSwColumn().back();
|
||||
}
|
||||
|
||||
if (!m_eclipseState.getSgofTables().empty()) {
|
||||
const std::vector<SgofTable>& sgofTables = m_eclipseState.getSgofTables();
|
||||
assert(sgofTables.size() == numSatTables);
|
||||
for (size_t tableIdx = 0; tableIdx < numSatTables; ++tableIdx) {
|
||||
m_minGasSat[tableIdx] = sgofTables[tableIdx].getSgColumn().front();
|
||||
m_maxGasSat[tableIdx] = sgofTables[tableIdx].getSgColumn().back();
|
||||
}
|
||||
}
|
||||
else {
|
||||
assert(!m_eclipseState.getSlgofTables().empty());
|
||||
|
||||
{
|
||||
const std::vector<SgofTable>& sgofTables = tables->getSgofTables();
|
||||
const std::vector<SlgofTable>& slgofTables = m_eclipseState.getSlgofTables();
|
||||
assert(slgofTables.size() == numSatTables);
|
||||
for (size_t tableIdx = 0; tableIdx < numSatTables; ++tableIdx) {
|
||||
m_minGasSat[tableIdx] = 1.0 - slgofTables[tableIdx].getSlColumn().back();
|
||||
m_maxGasSat[tableIdx] = 1.0 - slgofTables[tableIdx].getSlColumn().front();
|
||||
|
||||
if (!sgofTables.empty()) {
|
||||
assert(sgofTables.size() == numSatTables);
|
||||
for (size_t tableIdx = 0; tableIdx < numSatTables; ++tableIdx) {
|
||||
m_minGasSat[tableIdx] = sgofTables[tableIdx].getSgColumn().front();
|
||||
m_maxGasSat[tableIdx] = sgofTables[tableIdx].getSgColumn().back();
|
||||
}
|
||||
}
|
||||
else {
|
||||
assert(!slgofTables.empty());
|
||||
assert(slgofTables.size() == numSatTables);
|
||||
for (size_t tableIdx = 0; tableIdx < numSatTables; ++tableIdx) {
|
||||
m_minGasSat[tableIdx] = 1.0 - slgofTables[tableIdx].getSlColumn().back();
|
||||
m_maxGasSat[tableIdx] = 1.0 - slgofTables[tableIdx].getSlColumn().front();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -181,68 +183,68 @@ protected:
|
||||
}
|
||||
}
|
||||
|
||||
if (!m_eclipseState.getSgofTables().empty()) {
|
||||
const std::vector<SgofTable>& sgofTables = m_eclipseState.getSgofTables();
|
||||
|
||||
for (size_t tableIdx = 0; tableIdx < numSatTables; ++tableIdx) {
|
||||
// find the critical gas saturation
|
||||
int numRows = sgofTables[tableIdx].numRows();
|
||||
const auto &krgCol = sgofTables[tableIdx].getKrgColumn();
|
||||
for (int rowIdx = 0; rowIdx < numRows; ++rowIdx) {
|
||||
if (krgCol[rowIdx] > 0.0) {
|
||||
double Sg = 0.0;
|
||||
if (rowIdx > 0)
|
||||
Sg = sgofTables[tableIdx].getSgColumn()[rowIdx - 1];
|
||||
m_criticalGasSat[tableIdx] = Sg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// find the critical oil saturation of the oil-gas system
|
||||
const auto &kroOGCol = sgofTables[tableIdx].getKrogColumn();
|
||||
for (int rowIdx = numRows - 1; rowIdx >= 0; --rowIdx) {
|
||||
if (kroOGCol[rowIdx] > 0.0) {
|
||||
double Sg = sgofTables[tableIdx].getSgColumn()[rowIdx + 1];
|
||||
m_criticalOilOGSat[tableIdx] = 1 - Sg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
assert(!m_eclipseState.getSlgofTables().empty());
|
||||
|
||||
{
|
||||
const std::vector<SgofTable>& sgofTables = tables->getSgofTables();
|
||||
const std::vector<SlgofTable>& slgofTables = m_eclipseState.getSlgofTables();
|
||||
assert(slgofTables.size() == numSatTables);
|
||||
for (size_t tableIdx = 0; tableIdx < numSatTables; ++tableIdx) {
|
||||
// find the critical gas saturation
|
||||
int numRows = slgofTables[tableIdx].numRows();
|
||||
const auto &krgCol = slgofTables[tableIdx].getKrgColumn();
|
||||
for (int rowIdx = numRows - 1; rowIdx >= 0; -- rowIdx) {
|
||||
if (krgCol[rowIdx] > 0.0) {
|
||||
assert(rowIdx < numRows - 1);
|
||||
|
||||
m_criticalGasSat[tableIdx] =
|
||||
1.0 - slgofTables[tableIdx].getSlColumn()[rowIdx + 1];
|
||||
break;
|
||||
if (!sgofTables.empty()) {
|
||||
for (size_t tableIdx = 0; tableIdx < numSatTables; ++tableIdx) {
|
||||
// find the critical gas saturation
|
||||
int numRows = sgofTables[tableIdx].numRows();
|
||||
const auto &krgCol = sgofTables[tableIdx].getKrgColumn();
|
||||
for (int rowIdx = 0; rowIdx < numRows; ++rowIdx) {
|
||||
if (krgCol[rowIdx] > 0.0) {
|
||||
double Sg = 0.0;
|
||||
if (rowIdx > 0)
|
||||
Sg = sgofTables[tableIdx].getSgColumn()[rowIdx - 1];
|
||||
m_criticalGasSat[tableIdx] = Sg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// find the critical oil saturation of the oil-gas system
|
||||
const auto &kroOGCol = slgofTables[tableIdx].getKrogColumn();
|
||||
for (int rowIdx = 0; rowIdx < numRows; ++rowIdx) {
|
||||
if (kroOGCol[rowIdx] > 0.0) {
|
||||
m_criticalOilOGSat[tableIdx] =
|
||||
slgofTables[tableIdx].getSlColumn()[rowIdx + 1];
|
||||
break;
|
||||
// find the critical oil saturation of the oil-gas system
|
||||
const auto &kroOGCol = sgofTables[tableIdx].getKrogColumn();
|
||||
for (int rowIdx = numRows - 1; rowIdx >= 0; --rowIdx) {
|
||||
if (kroOGCol[rowIdx] > 0.0) {
|
||||
double Sg = sgofTables[tableIdx].getSgColumn()[rowIdx + 1];
|
||||
m_criticalOilOGSat[tableIdx] = 1 - Sg;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
assert(!slgofTables.empty());
|
||||
assert(slgofTables.size() == numSatTables);
|
||||
for (size_t tableIdx = 0; tableIdx < numSatTables; ++tableIdx) {
|
||||
// find the critical gas saturation
|
||||
int numRows = slgofTables[tableIdx].numRows();
|
||||
const auto &krgCol = slgofTables[tableIdx].getKrgColumn();
|
||||
for (int rowIdx = numRows - 1; rowIdx >= 0; -- rowIdx) {
|
||||
if (krgCol[rowIdx] > 0.0) {
|
||||
assert(rowIdx < numRows - 1);
|
||||
m_criticalGasSat[tableIdx] =
|
||||
1.0 - slgofTables[tableIdx].getSlColumn()[rowIdx + 1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// find the critical oil saturation of the oil-gas system
|
||||
const auto &kroOGCol = slgofTables[tableIdx].getKrogColumn();
|
||||
for (int rowIdx = 0; rowIdx < numRows; ++rowIdx) {
|
||||
if (kroOGCol[rowIdx] > 0.0) {
|
||||
m_criticalOilOGSat[tableIdx] =
|
||||
slgofTables[tableIdx].getSlColumn()[rowIdx + 1];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
case SaturationFunctionFamily::FamilyII: {
|
||||
const std::vector<SwfnTable>& swfnTables = m_eclipseState.getSwfnTables();
|
||||
const std::vector<SgfnTable>& sgfnTables = m_eclipseState.getSgfnTables();
|
||||
@ -326,7 +328,7 @@ protected:
|
||||
case SaturationFunctionFamily::FamilyI:
|
||||
{
|
||||
const std::vector<SwofTable>& swofTables = tables->getSwofTables();
|
||||
const std::vector<SgofTable>& sgofTables = m_eclipseState.getSgofTables();
|
||||
const std::vector<SgofTable>& sgofTables = tables->getSgofTables();
|
||||
|
||||
for (size_t tableIdx = 0; tableIdx < numSatTables; ++tableIdx) {
|
||||
// find the maximum output values of the oil-gas system
|
||||
@ -419,7 +421,7 @@ protected:
|
||||
const SaturationFunctionFamily getSaturationFunctionFamily() const{
|
||||
auto tables = m_eclipseState.getTables( );
|
||||
const std::vector<SwofTable>& swofTables = tables->getSwofTables();
|
||||
const std::vector<SgofTable>& sgofTables = m_eclipseState.getSgofTables();
|
||||
const std::vector<SgofTable>& sgofTables = tables->getSgofTables();
|
||||
const std::vector<SlgofTable>& slgofTables = m_eclipseState.getSlgofTables();
|
||||
const std::vector<SwfnTable>& swfnTables = m_eclipseState.getSwfnTables();
|
||||
const std::vector<SgfnTable>& sgfnTables = m_eclipseState.getSgfnTables();
|
||||
|
@ -23,12 +23,12 @@
|
||||
|
||||
namespace Opm {
|
||||
// forward declaration
|
||||
class EclipseState;
|
||||
class Tables;
|
||||
|
||||
class SgofTable : protected SingleRecordTable {
|
||||
typedef SingleRecordTable ParentType;
|
||||
|
||||
friend class EclipseState;
|
||||
friend class Tables;
|
||||
|
||||
/*!
|
||||
* \brief Read the SGOF keyword and provide some convenience
|
||||
|
@ -27,10 +27,10 @@ namespace Opm {
|
||||
Tables::Tables( const Deck& deck ) {
|
||||
initTabdims( deck );
|
||||
initSimpleTables(deck, "SWOF", m_swofTables);
|
||||
initSimpleTables(deck, "SGOF", m_sgofTables);
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Tables::initTabdims(const Deck& deck) {
|
||||
/*
|
||||
The default values for the various number of tables is
|
||||
@ -71,6 +71,11 @@ namespace Opm {
|
||||
}
|
||||
|
||||
|
||||
const std::vector<SgofTable>& Tables::getSgofTables() const {
|
||||
return m_sgofTables;
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/Tabdims.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/SwofTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/SgofTable.hpp>
|
||||
|
||||
|
||||
namespace Opm {
|
||||
@ -35,6 +36,7 @@ namespace Opm {
|
||||
|
||||
std::shared_ptr<const Tabdims> getTabdims() const;
|
||||
const std::vector<SwofTable>& getSwofTables() const;
|
||||
const std::vector<SgofTable>& getSgofTables() const;
|
||||
private:
|
||||
void complainAboutAmbiguousKeyword(const Deck& deck, const std::string& keywordName) const;
|
||||
|
||||
@ -72,7 +74,7 @@ namespace Opm {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::vector<SgofTable> m_sgofTables;
|
||||
std::vector<SwofTable> m_swofTables;
|
||||
std::shared_ptr<Tabdims> m_tabdims;
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user