Add support for SORWMIS
This commit is contained in:
@@ -276,6 +276,7 @@ EclipseState/Tables/VFPProdTable.hpp
|
||||
EclipseState/Tables/VFPInjTable.hpp
|
||||
EclipseState/Tables/TableManager.hpp
|
||||
EclipseState/Tables/TableContainer.hpp
|
||||
EclipseState/Tables/SorwmisTable.hpp
|
||||
#
|
||||
Utility/WconinjeWrapper.hpp
|
||||
Utility/CompdatWrapper.hpp
|
||||
|
||||
@@ -144,6 +144,16 @@ namespace Opm {
|
||||
addTables( "RSVD", m_eqldims->getNumEquilRegions());
|
||||
addTables( "RVVD", m_eqldims->getNumEquilRegions());
|
||||
|
||||
{
|
||||
size_t numMiscibleTables = ParserKeywords::MISCIBLE::NTMISC::defaultValue;
|
||||
if (deck.hasKeyword<ParserKeywords::MISCIBLE>()) {
|
||||
auto keyword = deck.getKeyword<ParserKeywords::MISCIBLE>();
|
||||
auto record = keyword->getRecord(0);
|
||||
numMiscibleTables = static_cast<size_t>(record->getItem<ParserKeywords::MISCIBLE::NTMISC>()->getInt(0));
|
||||
}
|
||||
addTables( "SORWMIS", numMiscibleTables);
|
||||
}
|
||||
|
||||
{
|
||||
size_t numEndScaleTables = ParserKeywords::ENDSCALE::NUM_TABLES::defaultValue;
|
||||
|
||||
@@ -195,6 +205,18 @@ namespace Opm {
|
||||
initSimpleTableContainer<ImkrvdTable>( deck , "IMKRVD", numEndScaleTables);
|
||||
initSimpleTableContainer<ImptvdTable>( deck , "IMPTVD", numEndScaleTables);
|
||||
}
|
||||
|
||||
{
|
||||
size_t numMiscibleTables = ParserKeywords::MISCIBLE::NTMISC::defaultValue;
|
||||
if (deck.hasKeyword<ParserKeywords::MISCIBLE>()) {
|
||||
auto keyword = deck.getKeyword<ParserKeywords::MISCIBLE>();
|
||||
auto record = keyword->getRecord(0);
|
||||
numMiscibleTables = static_cast<size_t>(record->getItem<ParserKeywords::MISCIBLE::NTMISC>()->getInt(0));
|
||||
}
|
||||
initSimpleTableContainer<SorwmisTable>(deck, "SORWMIS", numMiscibleTables);
|
||||
addTables( "SORWMIS", numMiscibleTables);
|
||||
}
|
||||
|
||||
initSimpleTableContainer<PvdgTable>(deck, "PVDG", m_tabdims->getNumPVTTables());
|
||||
initSimpleTableContainer<PvdoTable>(deck, "PVDO", m_tabdims->getNumPVTTables());
|
||||
initSimpleTableContainer<PvdsTable>(deck, "PVDS", m_tabdims->getNumPVTTables());
|
||||
|
||||
@@ -60,6 +60,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/VFPProdTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/VFPInjTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/TableContainer.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/SorwmisTable.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@@ -104,6 +105,8 @@ namespace Opm {
|
||||
const TableContainer& getPlyrockTables() const;
|
||||
const TableContainer& getPlyshlogTables() const;
|
||||
|
||||
const TableContainer& getSorwmisTables() const;
|
||||
|
||||
const std::vector<PvtgTable>& getPvtgTables() const;
|
||||
const std::vector<PvtoTable>& getPvtoTables() const;
|
||||
const std::map<int, VFPProdTable>& getVFPProdTables() const;
|
||||
|
||||
@@ -8,7 +8,7 @@ foreach(tapp TransMultIntegrationTests CheckDeckValidity IntegrationTests ParseW
|
||||
ParseRSVD ParsePVTG ParsePVTO ParseSWOF BoxTest
|
||||
ParseMULTREGT ParseSGOF ParseSLGOF EclipseGridCreateFromDeck NNCTests
|
||||
ResinsightTest IOConfigIntegrationTest
|
||||
Polymer ParsePLYADSS ParseMULTSEGWELL)
|
||||
Polymer ParsePLYADSS ParseMULTSEGWELL ParseMiscible)
|
||||
opm_add_test(run${tapp} SOURCES ${tapp}.cpp LIBRARIES opmparser ${Boost_LIBRARIES})
|
||||
endforeach()
|
||||
|
||||
|
||||
99
opm/parser/eclipse/IntegrationTests/ParseMiscible.cpp
Normal file
99
opm/parser/eclipse/IntegrationTests/ParseMiscible.cpp
Normal file
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
Copyright 2013 Statoil ASA.
|
||||
2015 IRIS AS
|
||||
This file is part of the Open Porous Media project (OPM).
|
||||
|
||||
OPM is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
OPM is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#define BOOST_TEST_MODULE ParseMiscible
|
||||
#include <math.h>
|
||||
|
||||
#include <boost/test/unit_test.hpp>
|
||||
#include <boost/test/test_tools.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParseMode.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/SorwmisTable.hpp>
|
||||
|
||||
using namespace Opm;
|
||||
|
||||
const char *miscibleData = "\n\
|
||||
MISCIBLE\n\
|
||||
2 3 /\n\
|
||||
\n";
|
||||
|
||||
const char *miscibleTightData = "\n\
|
||||
MISCIBLE\n\
|
||||
1 2 /\n\
|
||||
\n";
|
||||
|
||||
const char *sorwmisData = "\n\
|
||||
SORWMIS\n\
|
||||
.00 .00 \n\
|
||||
.50 .00 \n\
|
||||
1.0 .00 /\n\
|
||||
.00 .00 \n\
|
||||
.30 .20 \n\
|
||||
1.0 .80 /\n\
|
||||
\n";
|
||||
|
||||
BOOST_AUTO_TEST_CASE( PARSE_SORWMIS) {
|
||||
ParserPtr parser(new Parser());
|
||||
char tooFewTables[10000];
|
||||
std::strcpy(tooFewTables,miscibleTightData);
|
||||
std::strcat(tooFewTables,sorwmisData);
|
||||
|
||||
// missing miscible keyword
|
||||
BOOST_CHECK_THROW (parser->parseString(sorwmisData, ParseMode()), std::invalid_argument );
|
||||
|
||||
//too many tables
|
||||
BOOST_CHECK_THROW( parser->parseString(tooFewTables, ParseMode()), std::invalid_argument)
|
||||
|
||||
char data[10000];
|
||||
std::strcpy(data,miscibleData);
|
||||
std::strcat(data,sorwmisData);
|
||||
DeckPtr deck1 = parser->parseString(data, ParseMode());
|
||||
|
||||
DeckKeywordConstPtr sorwmis = deck1->getKeyword("SORWMIS");
|
||||
DeckKeywordConstPtr miscible = deck1->getKeyword("MISCIBLE");
|
||||
|
||||
DeckRecordConstPtr miscible0 = miscible->getRecord(0);
|
||||
DeckRecordConstPtr sorwmis0 = sorwmis->getRecord(0);
|
||||
DeckRecordConstPtr sorwmis1 = sorwmis->getRecord(1);
|
||||
|
||||
|
||||
// test number of columns
|
||||
int ntmisc = miscible0->getItem(0)->getInt(0);
|
||||
Opm::SorwmisTable sorwmisTable0;
|
||||
sorwmisTable0.initFORUNITTESTONLY(sorwmis0->getItem(0));
|
||||
BOOST_CHECK_EQUAL(sorwmisTable0.numColumns(),ntmisc);
|
||||
|
||||
// test table input 1
|
||||
BOOST_CHECK_EQUAL(3U, sorwmisTable0.getWaterSaturationColumn().size());
|
||||
BOOST_CHECK_EQUAL(1.0, sorwmisTable0.getWaterSaturationColumn()[2]);
|
||||
BOOST_CHECK_EQUAL(0.0, sorwmisTable0.getMiscibleResidualOilColumn()[2]);
|
||||
|
||||
// test table input 2
|
||||
Opm::SorwmisTable sorwmisTable1;
|
||||
sorwmisTable1.initFORUNITTESTONLY(sorwmis1->getItem(0));
|
||||
BOOST_CHECK_EQUAL(sorwmisTable1.numColumns(),ntmisc);
|
||||
|
||||
BOOST_CHECK_EQUAL(3U, sorwmisTable1.getWaterSaturationColumn().size());
|
||||
BOOST_CHECK_EQUAL(0.3, sorwmisTable1.getWaterSaturationColumn()[1]);
|
||||
BOOST_CHECK_EQUAL(0.8, sorwmisTable1.getMiscibleResidualOilColumn()[2]);
|
||||
}
|
||||
Reference in New Issue
Block a user