Merged upstream/master

This commit is contained in:
Kristian Flikka
2014-01-21 10:14:16 +01:00
66 changed files with 3520 additions and 69 deletions

4
.dir-locals.el Normal file
View File

@@ -0,0 +1,4 @@
;; <http://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html>
((c-mode . ((c-basic-offset . 4)
(tab-width . 8)
(indent-tabs-mode . nil))))

View File

@@ -4,6 +4,7 @@ add_subdirectory(Deck/tests)
add_subdirectory(IntegrationTests)
add_subdirectory(EclipseState/tests)
add_subdirectory(EclipseState/Schedule/tests)
add_subdirectory(Utility/tests)
add_subdirectory(Units/tests)
add_subdirectory( Applications )
@@ -66,6 +67,10 @@ EclipseState/Schedule/ScheduleEnums.cpp
EclipseState/Schedule/GroupTreeNode.cpp
EclipseState/Schedule/GroupTree.cpp)
set (utility_source
Utility/SimpleTable.cpp
Utility/SimpleMultiRecordTable.cpp)
set( HEADER_FILES
RawDeck/RawConsts.hpp
RawDeck/RawKeyword.hpp
@@ -109,6 +114,36 @@ EclipseState/Schedule/CompletionSet.hpp
EclipseState/Schedule/ScheduleEnums.hpp
EclipseState/Schedule/GroupTreeNode.hpp
EclipseState/Schedule/GroupTree.hpp
#
Utility/WconinjeWrapper.hpp
Utility/CompdatWrapper.hpp
Utility/PvtoOuterTable.hpp
Utility/WconinjWrapper.hpp
Utility/PvtgInnerTable.hpp
Utility/PvdoTable.hpp
Utility/WgrupconWrapper.hpp
Utility/PvdcoTable.hpp
Utility/GconprodWrapper.hpp
Utility/PvdgTable.hpp
Utility/SimpleMultiRecordTable.hpp
Utility/TstepWrapper.hpp
Utility/PvtgTable.hpp
Utility/StartWrapper.hpp
Utility/SpecgridWrapper.hpp
Utility/SwofTable.hpp
Utility/PvtwTable.hpp
Utility/FullTable.hpp
Utility/WconprodWrapper.hpp
Utility/GconinjeWrapper.hpp
Utility/WelopenWrapper.hpp
Utility/SimpleTable.hpp
Utility/SgofTable.hpp
Utility/PvtoTable.hpp
Utility/PvtoInnerTable.hpp
Utility/GruptreeWrapper.hpp
Utility/WelspecsWrapper.hpp
Utility/PvtgOuterTable.hpp
Utility/EquilWrapper.hpp
)
add_library(buildParser ${rawdeck_source} ${build_parser_source} ${deck_source} ${unit_source})
@@ -126,7 +161,7 @@ add_custom_command( OUTPUT ${PROJECT_BINARY_DIR}/generated-source/DefaultKeyword
#-----------------------------------------------------------------
add_library(Parser ${rawdeck_source} ${parser_source} ${deck_source} ${state_source} ${unit_source})
add_library(Parser ${rawdeck_source} ${parser_source} ${deck_source} ${state_source} ${utility_source} ${unit_source})
target_link_libraries(Parser opm-json ${Boost_LIBRARIES})
include( ${PROJECT_SOURCE_DIR}/cmake/Modules/install_headers.cmake )

View File

@@ -40,6 +40,10 @@ namespace Opm {
void DeckDoubleItem::assertSIData() const {
if (m_dimensions.size() > 0) {
if (m_SIdata.size() > 0) {
// we already converted this item to SI!
return;
}
m_SIdata.resize( m_data.size() );
if (m_dimensions.size() == 1) {
double SIfactor = m_dimensions[0]->getSIScaling();

View File

@@ -94,7 +94,7 @@ namespace Opm {
return item->getRawDoubleData();
}
const std::vector<double>& DeckKeyword::getSIDoubleData() {
const std::vector<double>& DeckKeyword::getSIDoubleData() const {
DeckRecordConstPtr record = getDataRecord();
DeckItemPtr item = record->getDataItem();
return item->getSIDoubleData();

View File

@@ -33,7 +33,7 @@ namespace Opm {
const std::vector<int>& getIntData() const;
const std::vector<double>& getRawDoubleData() const;
const std::vector<double>& getSIDoubleData();
const std::vector<double>& getSIDoubleData() const;
const std::vector<std::string>& getStringData() const;
private:

View File

@@ -63,6 +63,24 @@ add_test(NAME runParsePVTG
WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
COMMAND ${EXECUTABLE_OUTPUT_PATH}/runParsePVTG)
add_executable(runParsePVTO ParsePVTO.cpp)
target_link_libraries(runParsePVTO Parser ${Boost_LIBRARIES})
add_test(NAME runParsePVTO
WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
COMMAND ${EXECUTABLE_OUTPUT_PATH}/runParsePVTO)
add_executable(runParseSWOF ParseSWOF.cpp)
target_link_libraries(runParseSWOF Parser ${Boost_LIBRARIES})
add_test(NAME runParseSWOF
WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
COMMAND ${EXECUTABLE_OUTPUT_PATH}/runParseSWOF)
add_executable(runParseSGOF ParseSGOF.cpp)
target_link_libraries(runParseSGOF Parser ${Boost_LIBRARIES})
add_test(NAME runParseSGOF
WORKING_DIRECTORY ${EXECUTABLE_OUTPUT_PATH}
COMMAND ${EXECUTABLE_OUTPUT_PATH}/runParseSGOF)
if (INCLUDE_STATOIL_TESTS)
add_executable(runIntegrationTestsInternalData IntegrationTestsInternalData.cpp)
target_link_libraries(runIntegrationTestsInternalData Parser ${Boost_LIBRARIES})

View File

@@ -1,9 +1,30 @@
/*
Copyright (C) 2013 by Andreas Lauser
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 ParserIntegrationTests
#include <math.h>
#include <boost/test/unit_test.hpp>
#include <boost/test/test_tools.hpp>
#include <opm/parser/eclipse/Utility/PvtgTable.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Deck/DeckDoubleItem.hpp>
@@ -13,16 +34,35 @@
#include <opm/parser/eclipse/Parser/ParserIntItem.hpp>
#include <opm/parser/eclipse/Parser/ParserDoubleItem.hpp>
#include <opm/parser/eclipse/Parser/ParserStringItem.hpp>
#include <opm/parser/eclipse/Parser/ParserEnums.hpp>
using namespace Opm;
const char *pvtgData = "\n\
TABDIMS\n\
-- NTSFUN NTPVT NSSFUN NPPVT NTFIP NRPVT\n\
1 2 30 24 10 20 /\n\
\n\
PVTG\n\
--\n\
20.00 0.00002448 0.061895 0.01299\n\
0.00001224 0.061810 0.01300\n\
0.00000000 0.061725 0.01300 /\n\
40.00 0.00000628 0.030252 0.01383\n\
0.00000314 0.030249 0.01383\n\
0.00000000 0.030245 0.01383 /\n\
/\n\
197.66 0.00006327 0.005820 0.02160\n\
0.00003164 0.005840 0.02122\n\
0.00000000 0.005860 0.02086 /\n\
231.13 0.00010861 0.005042 0.02477\n\
0.00005431 0.005061 0.02389\n\
0.00000000 0.005082 0.02306 /\n\
/\n";
void check_parser(ParserPtr parser) {
boost::filesystem::path pvtgFile("testdata/integration_tests/PVTG/PVTG.txt");
DeckPtr deck = parser->parseFile(pvtgFile.string());
DeckPtr deck = parser->parseString(pvtgData);
DeckKeywordConstPtr kw1 = deck->getKeyword("PVTG" , 0);
BOOST_CHECK_EQUAL(5U , kw1->size());
@@ -64,9 +104,22 @@ void check_parser(ParserPtr parser) {
BOOST_CHECK_EQUAL(9U , item4_1->size());
BOOST_CHECK_EQUAL(2U , record4->size());
Opm::PvtgTable pvtgTable(kw1, /*tableIdx=*/0);
const auto &outerTable = *pvtgTable.getOuterTable();
const auto &innerTable0 = *pvtgTable.getInnerTable(0);
BOOST_CHECK_EQUAL(2, outerTable.numRows());
BOOST_CHECK_EQUAL(4, outerTable.numColumns());
BOOST_CHECK_EQUAL(3, innerTable0.numRows());
BOOST_CHECK_EQUAL(3, innerTable0.numColumns());
BOOST_CHECK_EQUAL(20.0e5, outerTable.getPressureColumn()[0]);
BOOST_CHECK_EQUAL(0.00002448, outerTable.getOilSolubilityColumn()[0]);
BOOST_CHECK_EQUAL(outerTable.getOilSolubilityColumn()[0], innerTable0.getOilSolubilityColumn()[0]);
BOOST_CHECK_EQUAL(0.061895, outerTable.getGasFormationFactorColumn()[0]);
BOOST_CHECK_EQUAL(outerTable.getGasFormationFactorColumn()[0], innerTable0.getGasFormationFactorColumn()[0]);
BOOST_CHECK_EQUAL(1.299e-5, outerTable.getGasViscosityColumn()[0]);
BOOST_CHECK_EQUAL(outerTable.getGasViscosityColumn()[0], innerTable0.getGasViscosityColumn()[0]);
}

View File

@@ -0,0 +1,127 @@
/*
Copyright (C) 2013 by Andreas Lauser
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 ParserIntegrationTests
#include <math.h>
#include <boost/test/unit_test.hpp>
#include <boost/test/test_tools.hpp>
#include <opm/parser/eclipse/Utility/PvtoTable.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Deck/DeckDoubleItem.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParserKeyword.hpp>
#include <opm/parser/eclipse/Parser/ParserRecord.hpp>
#include <opm/parser/eclipse/Parser/ParserIntItem.hpp>
#include <opm/parser/eclipse/Parser/ParserDoubleItem.hpp>
#include <opm/parser/eclipse/Parser/ParserStringItem.hpp>
#include <opm/parser/eclipse/Parser/ParserEnums.hpp>
using namespace Opm;
const char *pvtoData = "\n\
TABDIMS\n\
-- NTSFUN NTPVT NSSFUN NPPVT NTFIP NRPVT\n\
1 2 30 24 10 20 /\n\
\n\
PVTO\n\
-- Rs PO BO MUO\n\
1e-3 1 1.01 1.02\n\
250 1.15 0.95\n\
500 1.20 0.93 /\n\
1e-2 14.8 1.05 1.03\n\
251 1.25 0.98\n\
502 1.30 0.95 /\n\
/\n\
1e-1 1.1 1.02 1.03\n\
253 1.16 0.96\n\
504 1.21 0.97 /\n\
1e00 15 1.06 1.04\n\
255 1.26 0.99\n\
506 1.31 0.96 /\n\
/\n";
void check_parser(ParserPtr parser) {
DeckPtr deck = parser->parseString(pvtoData);
DeckKeywordConstPtr kw1 = deck->getKeyword("PVTO" , 0);
BOOST_CHECK_EQUAL(5U , kw1->size());
DeckRecordConstPtr record0 = kw1->getRecord(0);
DeckRecordConstPtr record1 = kw1->getRecord(1);
DeckRecordConstPtr record2 = kw1->getRecord(2);
DeckRecordConstPtr record3 = kw1->getRecord(3);
DeckRecordConstPtr record4 = kw1->getRecord(4);
DeckItemConstPtr item0_0 = record0->getItem("RS");
DeckItemConstPtr item0_1 = record0->getItem("DATA");
BOOST_CHECK_EQUAL(1U , item0_0->size());
BOOST_CHECK_EQUAL(9U , item0_1->size());
BOOST_CHECK_EQUAL(2U , record0->size());
DeckItemConstPtr item1_0 = record1->getItem("RS");
DeckItemConstPtr item1_1 = record1->getItem("DATA");
BOOST_CHECK_EQUAL(1U , item1_0->size());
BOOST_CHECK_EQUAL(9U , item1_1->size());
BOOST_CHECK_EQUAL(2U , record1->size());
DeckItemConstPtr item2_0 = record2->getItem("RS");
DeckItemConstPtr item2_1 = record2->getItem("DATA");
BOOST_CHECK_EQUAL(1U , item2_0->size());
BOOST_CHECK_EQUAL(0U , item2_1->size());
BOOST_CHECK_EQUAL(2U , record2->size());
DeckItemConstPtr item3_0 = record3->getItem("RS");
DeckItemConstPtr item3_1 = record3->getItem("DATA");
BOOST_CHECK_EQUAL(1U , item3_0->size());
BOOST_CHECK_EQUAL(9U , item3_1->size());
BOOST_CHECK_EQUAL(2U , record3->size());
DeckItemConstPtr item4_0 = record4->getItem("RS");
DeckItemConstPtr item4_1 = record4->getItem("DATA");
BOOST_CHECK_EQUAL(1U , item4_0->size());
BOOST_CHECK_EQUAL(9U , item4_1->size());
BOOST_CHECK_EQUAL(2U , record4->size());
Opm::PvtoTable pvtoTable(kw1, /*tableIdx=*/0);
const auto &outerTable = *pvtoTable.getOuterTable();
const auto &innerTable0 = *pvtoTable.getInnerTable(0);
BOOST_CHECK_EQUAL(2, outerTable.numRows());
BOOST_CHECK_EQUAL(4, outerTable.numColumns());
BOOST_CHECK_EQUAL(3, innerTable0.numRows());
BOOST_CHECK_EQUAL(3, innerTable0.numColumns());
BOOST_CHECK_EQUAL(1e-3, outerTable.getGasSolubilityColumn()[0]);
BOOST_CHECK_EQUAL(1.0e5, outerTable.getPressureColumn()[0]);
BOOST_CHECK_EQUAL(outerTable.getPressureColumn()[0], innerTable0.getPressureColumn()[0]);
BOOST_CHECK_EQUAL(1.01, outerTable.getOilFormationFactorColumn()[0]);
BOOST_CHECK_EQUAL(outerTable.getOilFormationFactorColumn()[0], innerTable0.getOilFormationFactorColumn()[0]);
BOOST_CHECK_EQUAL(1.02e-3, outerTable.getOilViscosityColumn()[0]);
BOOST_CHECK_EQUAL(outerTable.getOilViscosityColumn()[0], innerTable0.getOilViscosityColumn()[0]);
}
BOOST_AUTO_TEST_CASE( parse_PVTO_OK ) {
ParserPtr parser(new Parser());
check_parser( parser );
}

View File

@@ -0,0 +1,65 @@
#define BOOST_TEST_MODULE ParserIntegrationTests
#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/Deck/DeckDoubleItem.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParserIntItem.hpp>
#include <opm/parser/eclipse/Parser/ParserDoubleItem.hpp>
#include <opm/parser/eclipse/Utility/SgofTable.hpp>
using namespace Opm;
// the data which ought to be parsed
const char *parserData =
"TABDIMS\n"
"-- NTSFUN NTPVT NSSFUN NPPVT NTFIP NRPVT\n"
" 1 1 30 1 1 1 /\n"
"\n"
"-- S_g k_rg k_rog p_cog\n"
"SGOF\n"
" 0.1 0.0 1.0 0.0\n"
" 0.2 0.1 1.0 1.0\n"
" 0.3 0.2 0.9 2.0\n"
" 0.4 0.3 0.8 3.0\n"
" 0.5 0.5 0.5 4.0\n"
" 0.6 0.6 0.4 5.0\n"
" 0.7 0.8 0.3 6.0\n"
" 0.8 0.9 0.2 7.0\n"
" 0.9 0.5 0.1 8.0\n"
" 1.0 1.0 0.1 9.0 /\n";
void check_parser(ParserPtr parser) {
DeckPtr deck = parser->parseString(parserData);
DeckKeywordConstPtr kw1 = deck->getKeyword("SGOF");
BOOST_CHECK_EQUAL(1U , kw1->size());
DeckRecordConstPtr record0 = kw1->getRecord(0);
BOOST_CHECK_EQUAL(1U , record0->size());
DeckItemConstPtr item0 = record0->getItem(0);
BOOST_CHECK_EQUAL(10U * 4, item0->size());
}
void check_SgofTable(ParserPtr parser) {
DeckPtr deck = parser->parseString(parserData);
Opm::SgofTable sgofTable(deck->getKeyword("SGOF"));
BOOST_CHECK_EQUAL(10U, sgofTable.getSgColumn().size());
BOOST_CHECK_EQUAL(0.1, sgofTable.getSgColumn()[0]);
BOOST_CHECK_EQUAL(0.0, sgofTable.getKrgColumn()[0]);
BOOST_CHECK_EQUAL(1.0, sgofTable.getKrogColumn()[0]);
BOOST_CHECK_EQUAL(0.0, sgofTable.getPcogColumn()[0]);
}
BOOST_AUTO_TEST_CASE( parse_SGOF_OK ) {
ParserPtr parser(new Parser(/*addDefault=*/true));
check_parser( parser );
check_SgofTable(parser);
}

View File

@@ -0,0 +1,85 @@
/*
Copyright (C) 2013 by Andreas Lauser
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 ParserIntegrationTests
#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/Deck/DeckDoubleItem.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParserIntItem.hpp>
#include <opm/parser/eclipse/Parser/ParserDoubleItem.hpp>
#include <opm/parser/eclipse/Utility/SwofTable.hpp>
using namespace Opm;
// the data which ought to be parsed
const char *parserData =
"TABDIMS\n"
"-- NTSFUN NTPVT NSSFUN NPPVT NTFIP NRPVT\n"
" 1 1 30 1 1 1 /\n"
"\n"
"-- S_w k_rw k_row p_cow\n"
"SWOF\n"
" 0.1 0.0 1.0 0.0\n"
" 0.2 0.1 1.0 1.0\n"
" 0.3 0.2 0.9 2.0\n"
" 0.4 0.3 0.8 3.0\n"
" 0.5 0.5 0.5 4.0\n"
" 0.6 0.6 0.4 5.0\n"
" 0.7 0.8 0.3 6.0\n"
" 0.8 0.9 0.2 7.0\n"
" 0.9 0.5 0.1 8.0\n"
" 1.0 1.0 0.1 9.0 /\n";
void check_parser(ParserPtr parser) {
DeckPtr deck = parser->parseString(parserData);
DeckKeywordConstPtr kw1 = deck->getKeyword("SWOF");
BOOST_CHECK_EQUAL(1U , kw1->size());
DeckRecordConstPtr record0 = kw1->getRecord(0);
BOOST_CHECK_EQUAL(1U , record0->size());
DeckItemConstPtr item0 = record0->getItem(0);
BOOST_CHECK_EQUAL(10U * 4, item0->size());
}
void check_SwofTable(ParserPtr parser) {
DeckPtr deck = parser->parseString(parserData);
Opm::SwofTable swofTable(deck->getKeyword("SWOF"));
BOOST_CHECK_EQUAL(10U, swofTable.getSwColumn().size());
BOOST_CHECK_EQUAL(0.1, swofTable.getSwColumn()[0]);
BOOST_CHECK_EQUAL(0.0, swofTable.getKrwColumn()[0]);
BOOST_CHECK_EQUAL(1.0, swofTable.getKrowColumn()[0]);
BOOST_CHECK_EQUAL(0.0, swofTable.getPcowColumn()[0]);
}
BOOST_AUTO_TEST_CASE( parse_SWOF_OK ) {
ParserPtr parser(new Parser(/*addDefault=*/true));
check_parser( parser );
check_SwofTable(parser);
}

View File

@@ -54,7 +54,8 @@ namespace Opm {
const double DissolvedGasRatio = 1.0;
const double FlowVolume = 1.0;
const double Density = 1.0;
const double Viscosity = 0.001; // cP -> Pa s
const double Viscosity = 0.001; // cP -> Pa s
const double Timestep = 24*60*60; // days -> s
}
@@ -68,6 +69,7 @@ namespace Opm {
const double FlowVolume = 0.158987294; // STB -> m^3
const double Density = 16.01846; // lb/ft^3 -> kg / m^3
const double Viscosity = 0.001; // cP -> Pa s
const double Timestep = 24*60*60; // days -> s
}
}

View File

@@ -145,6 +145,7 @@ namespace Opm {
system->addDimension("FlowVolume", Metric::FlowVolume );
system->addDimension("Rho" , Metric::Density );
system->addDimension("mu" , Metric::Viscosity);
system->addDimension("Timestep" , Metric::Timestep);
return system;
}
@@ -163,6 +164,7 @@ namespace Opm {
system->addDimension("FlowVolume" , Field::FlowVolume );
system->addDimension("Rho" , Field::Density );
system->addDimension("mu" , Field::Viscosity);
system->addDimension("Timestep", Field::Timestep);
return system;
}

View File

@@ -0,0 +1,143 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_COMPDAT_WRAPPER_HPP
#define OPM_PARSER_COMPDAT_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class CompdatWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'COMPDAT' keyword.
*/
CompdatWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of injection wells
*/
int numWells() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of the well with a given index
*/
std::string wellName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(0)->getString(0); }
/*!
* \brief Return the I-coordinate of the well
*/
int coordinateI(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(1)->getInt(0); }
/*!
* \brief Return the J-coordinate of the well
*/
int coordinateJ(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(2)->getInt(0); }
/*!
* \brief Return the upper K-coordinate of the well
*/
int coordinateKUpper(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(3)->getInt(0); }
/*!
* \brief Return the lower K-coordinate of the well
*/
int coordinateKLower(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(4)->getInt(0); }
/*!
* \brief Return whether a well is open or closed
*
* This is one of:
* - OPEN: Well injects
* - SHUT: Well does not influence the reservoir
* - AUTO: Simulation selects one of the above depending in the
* well parameters and reservoir conditions at the well.
*/
std::string wellStatus(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(5)->getString(0); }
/*!
* \brief Return the index of the saturation table to
* calculate the relative permebilities of the connection
*/
int saturationTableIndex(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(6)->getInt(0); }
/*!
* \brief Return the transmiscibility factor to be used for the connection
*/
double transmiscibilityFactor(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(7)->getSIDouble(0); }
/*!
* \brief Return the diameter of the well
*/
double wellDiameter(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(8)->getSIDouble(0); }
/*!
* \brief Return the effective intrinisic permeability to be used for the well
*/
double intrinsicPermeability(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(9)->getSIDouble(0); }
/*!
* \brief Return the skin factor to be used for the well
*/
double skinFactor(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(10)->getSIDouble(0); }
/*!
* \brief Return the "D-factor" (for non-Darcy flow regimes) to be used for the well
*/
double dFactor(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(11)->getSIDouble(0); }
/*!
* \brief Return the direction into which the cells are penetrated by the well
*
* This is one of:
* - X
* - Y
* - Z
* - FX (fracture in X direction)
* - FY (fracture in Y direction)
*/
std::string penetrationDirection(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(12)->getString(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_COMPDAT_WRAPPER_HPP

View File

@@ -0,0 +1,125 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_EQUIL_WRAPPER_HPP
#define OPM_PARSER_EQUIL_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class EquilWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'EQUIL' keyword.
*/
EquilWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of regions used for initialization
*/
int numRegions() const
{ return m_keyword->size(); }
/*!
* \brief The reference depth
*/
double datumDepth(int regionIdx) const
{ return m_keyword->getRecord(regionIdx)->getItem(0)->getSIDouble(0); }
/*!
* \brief The pressure at reference depth
*/
double datumDepthPressure(int regionIdx) const
{ return m_keyword->getRecord(regionIdx)->getItem(1)->getSIDouble(0); }
/*!
* \brief The depth of the water-oil contact
*/
double waterOilContactDepth(int regionIdx) const
{ return m_keyword->getRecord(regionIdx)->getItem(2)->getSIDouble(0); }
/*!
* \brief The capillary pressure at the water-oil contact
*/
double waterOilContactCapillaryPressure(int regionIdx) const
{ return m_keyword->getRecord(regionIdx)->getItem(3)->getSIDouble(0); }
/*!
* \brief The depth of the gas-oil contact
*/
double gasOilContactDepth(int regionIdx) const
{ return m_keyword->getRecord(regionIdx)->getItem(4)->getSIDouble(0); }
/*!
* \brief The capillary pressure at the gas-oil contact
*/
double gasOilContactCapillaryPressure(int regionIdx) const
{ return m_keyword->getRecord(regionIdx)->getItem(5)->getSIDouble(0); }
/*!
* \brief Integer number specifying the initialization proceedure for live oil
*
* Much fun with eclipse...
*/
int liveOilInitProceedure(int regionIdx) const
{ return m_keyword->getRecord(regionIdx)->getItem(6)->getInt(0); }
/*!
* \brief Integer number specifying the initialization proceedure for wet gas
*/
int wetGasInitProceedure(int regionIdx) const
{ return m_keyword->getRecord(regionIdx)->getItem(7)->getInt(0); }
/*!
* \brief Integer number specifying the desired accuracy of the initialization
*/
int initializationTargetAccuracy(int regionIdx) const
{ return m_keyword->getRecord(regionIdx)->getItem(8)->getInt(0); }
/*!
* \brief Integer number specifying the type of the initialization
*
* This is only relevant for fully-compositional models
*/
int compositionalInitializationProceedure(int regionIdx) const
{ return m_keyword->getRecord(regionIdx)->getItem(9)->getInt(0); }
/*!
* \brief Use the saturation pressure at the of the gas for
* the gas-oil contact.
*
* This is only relevant for fully-compositional models and if
* the initialization proceedure is either '2' or '3'.
*/
bool useSaturationPressure(int regionIdx) const
{ return m_keyword->getRecord(regionIdx)->getItem(10)->getInt(0) == 0; }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_EQUIL_WRAPPER_HPP

View File

@@ -0,0 +1,113 @@
/*
Copyright (C) 2013 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_FULL_TABLE_HPP
#define OPM_PARSER_FULL_TABLE_HPP
#include "SimpleTable.hpp"
#include "SimpleMultiRecordTable.hpp"
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include <cassert>
namespace Opm {
template <class OuterTable = Opm::SimpleMultiRecordTable, class InnerTable = Opm::SimpleTable>
class FullTable
{
typedef FullTable<OuterTable, InnerTable> Self;
typedef std::shared_ptr<const OuterTable> OuterTableConstPtr;
typedef std::shared_ptr<const InnerTable> InnerTableConstPtr;
protected:
// protected default constructor for the derived classes
FullTable() {}
// protected constructor for the case that the derived classes
// use specialized classes for the outer and inner tables
FullTable(Opm::DeckKeywordConstPtr keyword, int tableIdx)
{
m_outerTable.reset(new OuterTable(keyword, tableIdx));
int firstRecordIdx = m_outerTable->firstRecordIndex();
int numRecords = m_outerTable->numRecords();
for (int rowIdx = firstRecordIdx; rowIdx < firstRecordIdx + numRecords; ++rowIdx) {
InnerTableConstPtr curRow(new InnerTable(keyword, /*recordIdx=*/rowIdx));
m_innerTables.push_back(curRow);
}
}
public:
typedef std::shared_ptr<Self> Pointer;
typedef std::shared_ptr<const Self> ConstPointer;
/*!
* \brief Read full tables from keywords like PVTO
*
* The data for these keywords can be considered a 2D table:
* The outer one is a multi-record table for a given state,
* the inner one is a normal table which extends this
* state. For the PVTO keyword, the outer table represents the
* gas dissolution factor, pressure, volume factor and
* viscosity at the oil's saturation point, the inner table is
* the pressure, volume factor and viscosity of untersaturated
* oil with the same gas dissolution factor.
*/
FullTable(Opm::DeckKeywordConstPtr keyword,
const std::vector<std::string> &outerColumnNames,
const std::vector<std::string> &innerColumnNames,
int tableIdx)
{
m_outerTable.reset(new SimpleMultiRecordTable(keyword, outerColumnNames, tableIdx));
for (int rowIdx = 0; rowIdx < m_outerTable->numRecords(); ++rowIdx) {
Opm::SimpleTableConstPtr curRow(
new SimpleTable(keyword,
innerColumnNames,
/*recordIdx=*/m_outerTable->firstRecordIndex() + rowIdx,
/*firstColumnOffset=*/1));
m_innerTables.push_back(curRow);
}
}
std::shared_ptr<const OuterTable> getOuterTable() const
{ return m_outerTable; }
std::shared_ptr<const InnerTable> getInnerTable(int rowIdx) const
{
assert(0 <= rowIdx && rowIdx < static_cast<int>(m_innerTables.size()));
return m_innerTables[rowIdx];
}
protected:
std::shared_ptr<const OuterTable> m_outerTable;
std::vector<std::shared_ptr<const InnerTable> > m_innerTables;
};
typedef FullTable<Opm::SimpleMultiRecordTable, Opm::SimpleTable>::Pointer FullTablePtr;
typedef FullTable<Opm::SimpleMultiRecordTable, Opm::SimpleTable>::ConstPointer FullTableConstPtr;
}
#endif // OPM_PARSER_FULL_TABLE_HPP

View File

@@ -0,0 +1,160 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_GCONINJE_WRAPPER_HPP
#define OPM_PARSER_GCONINJE_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class GconinjeWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'GCONINJE' keyword.
*/
GconinjeWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of injection well groups
*/
int numGroups() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of the well group with a given index
*/
std::string groupName(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(0)->getString(0); }
/*!
* \brief Return the injector type of a well group.
*
* This is one of:
* - OIL
* - WATER
* - GAS
*/
std::string groupType(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(1)->getString(0); }
/*!
* \brief Return the what should be controlled for a given well
*
* This is one of:
* - NONE: The individual wells specify how they are controlled
* - RATE: Control for the surface volume rate of the fluid
* - RESV: Control for the reservoir volume rate of the fluid
* - REIN: Injection rate is production rate times a re-injection ratio
* - VREP: Control the total surface injection rate of all wells
* - WGRA: Control for the wet-gas injection rate
* - FLD: Higher level groups specify this group's control
*/
std::string controlMode(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(2)->getString(0); }
/*!
* \brief Return the target for the volumetric surface rate of a well group
*
* If the control mode does not use the volumetric surface
* rate, this is the upper limit.
*/
double surfaceTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(3)->getSIDouble(0); }
/*!
* \brief Return the target for the volumetric reservoir rate of a well group
*
* If the control mode does not use the volumetric reservoir
* rate, this is the upper limit.
*/
double reservoirTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(4)->getSIDouble(0); }
/*!
* \brief The target fraction for reinjection
*/
double reinjectTargetRatio(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(5)->getSIDouble(0); }
/*!
* \brief The target fraction of the voidage replacement fraction
*/
double voidageReplacementFractionTarget(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(6)->getSIDouble(0); }
/*!
* \brief Returns whether a group is unconstraint so that it
* be used to hit the target of a higher-level group
*/
bool isUnconstraint(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(7)->getString(0) == "YES"; }
/*!
* \brief The target for the group's share of the next
* higher-level group's total injection rate.
*/
double injectionShareTarget(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(8)->getSIDouble(0); }
/*!
* \brief The kind of control which the next higher-level group wants
*
* This is one of:
* - RATE
* - RESV
* - VOID
* - NETV
* - ' '
*/
std::string injectionShareType(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(9)->getString(0); }
/*!
* \brief The name of the production group which should be partially reinjected
*/
std::string reinjectGroupName(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(10)->getString(0); }
/*!
* \brief The name of the group to which the voidage
* replacement volume fraction applies and which's
* production rates should be used.
*/
std::string voidageGroupName(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(11)->getString(0); }
/*!
* \brief The target rate for wet gas injection
*/
double wetGasTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(12)->getSIDouble(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_GCONINJE_WRAPPER_HPP

View File

@@ -0,0 +1,228 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_GCONPROD_WRAPPER_HPP
#define OPM_PARSER_GCONPROD_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class GconprodWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'GCONPROD' keyword.
*/
GconprodWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of prodction well groups
*/
int numGroups() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of the well group with a given index
*/
std::string groupName(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(0)->getString(0); }
/*!
* \brief Return the what should be controlled for a given well
*
* This is one of:
* - NONE
* - ORAT
* - WRAT
* - GRAT
* - LRAT
* - CRAT
* - RESV
* - PRBL
* - WGRA
* - CVAL
* - PBGS
* - PBWS
* - FLD
*/
std::string controlMode(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(1)->getString(0); }
/*!
* \brief Return the target for the volumetric surface oil rate of a well group
*
* If the control mode does not use the volumetric oil surface
* rate, this is the upper limit.
*/
double surfaceOilTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(2)->getSIDouble(0); }
/*!
* \brief Return the target for the volumetric surface water rate of a well group
*
* If the control mode does not use the volumetric water surface
* rate, this is the upper limit.
*/
double surfaceWaterTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(3)->getSIDouble(0); }
/*!
* \brief Return the target for the volumetric surface gas rate of a well group
*
* If the control mode does not use the volumetric gas surface
* rate, this is the upper limit.
*/
double surfaceGasTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(4)->getSIDouble(0); }
/*!
* \brief Return the target for the volumetric surface liquid rate of a well group
*
* If the control mode does not use the volumetric liquid surface
* rate, this is the upper limit.
*/
double surfaceLiquidTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(5)->getSIDouble(0); }
/*!
* \brief Return the procedure which is taken if the target rates are exceeded
*
* This is one of:
* - NONE
* - CON
* - +CON
* - WELL
* - PLUG
* - RATE
*/
std::string oilExceedanceReaction(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(6)->getString(0); }
/*!
* \brief Returns whether a group is unconstraint so that it
* be used to hit the target of a higher-level group
*/
bool isUnconstraint(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(7)->getString(0) == "YES"; }
/*!
* \brief The target for the group's share of the next
* higher-level group's total production rate.
*/
double productionShareTarget(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(8)->getSIDouble(0); }
/*!
* \brief The kind of control which the next higher-level group wants
*
* This is one of:
* - OIL
* - WAT
* - GAS
* - LIQ
* - COMB
* - RES
* - WGA
* - CVAL
* - INJV
* - POTN
* - FORM
* - ' '
*/
std::string productionShareType(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(9)->getString(0); }
/*!
* \brief Return the procedure which is taken if the water target rate is exceeded
*/
std::string waterExceedanceReaction(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(10)->getString(0); }
/*!
* \brief Return the procedure which is taken if the gas target rate is exceeded
*/
std::string gasExceedanceReaction(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(11)->getString(0); }
/*!
* \brief Return the procedure which is taken if the liquid target rate is exceeded
*/
std::string liquidExceedanceReaction(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(12)->getString(0); }
/*!
* \brief Return target rate of all fluids at reservoir conditions
*/
double reservoirTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(13)->getSIDouble(0); }
/*!
* \brief Return balancing fraction of fluids produced at reservoir conditions.
*/
double reservoirBalanceTarget(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(14)->getSIDouble(0); }
/*!
* \brief Return target rate for wet-gas
*/
double wetGasTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(15)->getSIDouble(0); }
/*!
* \brief Return caloric target rate
*/
double caloricTargetRate(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(16)->getSIDouble(0); }
/*!
* \brief Return balancing fraction of gas at surface conditions.
*/
double surfaceGasBalanceTarget(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(17)->getSIDouble(0); }
/*!
* \brief Return balancing fraction of water at surface conditions.
*/
double surfaceWaterBalanceTarget(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(18)->getSIDouble(0); }
/*!
* \brief Return index of the linearly combined rate specified using the LCOM keyword
*/
int lcomIndex(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(19)->getInt(0); }
/*!
* \brief Return the procedure which is taken if the linearly combined rate is exceeded
*/
std::string lcomExceedanceReaction(int wellGroupIdx) const
{ return m_keyword->getRecord(wellGroupIdx)->getItem(20)->getString(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_GCONINJE_WRAPPER_HPP

View File

@@ -0,0 +1,65 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_GRUPTREE_WRAPPER_HPP
#define OPM_PARSER_GRUPTREE_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class GruptreeWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'GRUPTREE' keyword.
*/
GruptreeWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of nodes in the well group tree
*/
int numNodes() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of the child group of
* a well group with a given index
*/
std::string childName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(0)->getString(0); }
/*!
* \brief Return the human-readable name of the parent group
* of a well group with a given index
*/
std::string parentName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(1)->getString(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_GRUPTREE_WRAPPER_HPP

View File

@@ -0,0 +1,65 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_PVDCO_TABLE_HPP
#define OPM_PARSER_PVDCO_TABLE_HPP
#include "SimpleTable.hpp"
namespace Opm {
class PvdcoTable : protected SimpleTable {
typedef SimpleTable ParentType;
public:
/*!
* \brief Read the PVDCO keyword and provide some convenience
* methods for it.
*/
PvdcoTable(Opm::DeckKeywordConstPtr keyword,
int recordIdx = 0,
int firstEntityOffset = 0)
: SimpleTable(keyword,
std::vector<std::string>{"P", "BW", "CW", "MUW", "CMUW"},
recordIdx, firstEntityOffset)
{}
int numRows() const
{ return ParentType::numRows(); };
int numColumns() const
{ return ParentType::numColumns(); };
const std::vector<double> &getPressureColumn() const
{ return ParentType::getColumn(0); }
const std::vector<double> &getFormationFactorColumn() const
{ return ParentType::getColumn(1); }
const std::vector<double> &getCompressibilityColumn() const
{ return ParentType::getColumn(2); }
const std::vector<double> &getViscosityColumn() const
{ return ParentType::getColumn(3); }
const std::vector<double> &getViscosibilityColumn() const
{ return ParentType::getColumn(4); }
};
}
#endif // OPM_PARSER_PVDCO_TABLE_HPP

View File

@@ -0,0 +1,59 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_PVDG_TABLE_HPP
#define OPM_PARSER_PVDG_TABLE_HPP
#include "SimpleTable.hpp"
namespace Opm {
class PvdgTable : protected SimpleTable {
typedef SimpleTable ParentType;
public:
/*!
* \brief Read the PVDG keyword and provide some convenience
* methods for it.
*/
PvdgTable(Opm::DeckKeywordConstPtr keyword,
int recordIdx = 0,
int firstEntityOffset = 0)
: SimpleTable(keyword,
std::vector<std::string>{"P", "BG", "MUG"},
recordIdx, firstEntityOffset)
{}
int numRows() const
{ return ParentType::numRows(); };
int numColumns() const
{ return ParentType::numColumns(); };
const std::vector<double> &getPressureColumn() const
{ return ParentType::getColumn(0); }
const std::vector<double> &getFormationFactorColumn() const
{ return ParentType::getColumn(1); }
const std::vector<double> &getViscosityColumn() const
{ return ParentType::getColumn(2); }
};
}
#endif // OPM_PARSER_PVDG_TABLE_HPP

View File

@@ -0,0 +1,59 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_PVDO_TABLE_HPP
#define OPM_PARSER_PVDO_TABLE_HPP
#include "SimpleTable.hpp"
namespace Opm {
class PvdoTable : protected SimpleTable {
typedef SimpleTable ParentType;
public:
/*!
* \brief Read the PVDO keyword and provide some convenience
* methods for it.
*/
PvdoTable(Opm::DeckKeywordConstPtr keyword,
int recordIdx = 0,
int firstEntityOffset = 0)
: SimpleTable(keyword,
std::vector<std::string>{"P", "BO", "MUO"},
recordIdx, firstEntityOffset)
{}
int numRows() const
{ return ParentType::numRows(); };
int numColumns() const
{ return ParentType::numColumns(); };
const std::vector<double> &getPressureColumn() const
{ return ParentType::getColumn(0); }
const std::vector<double> &getFormationFactorColumn() const
{ return ParentType::getColumn(1); }
const std::vector<double> &getViscosityColumn() const
{ return ParentType::getColumn(2); }
};
}
#endif // OPM_PARSER_PVDO_TABLE_HPP

View File

@@ -0,0 +1,59 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_PVTG_INNER_TABLE_HPP
#define OPM_PARSER_PVTG_INNER_TABLE_HPP
#include "SimpleTable.hpp"
namespace Opm {
class PvtgInnerTable : protected SimpleTable {
typedef SimpleTable ParentType;
public:
/*!
* \brief Read the per record table of the PVTG keyword and
* provide some convenience methods for it.
*
* The first value of the record (-> Rv) is skipped.
*/
PvtgInnerTable(Opm::DeckKeywordConstPtr keyword, int recordIdx = 0)
: SimpleTable(keyword,
std::vector<std::string>{"RV", "BG", "MUG"},
recordIdx, /*firstEntityOffset=*/1)
{}
int numRows() const
{ return ParentType::numRows(); };
int numColumns() const
{ return ParentType::numColumns(); };
const std::vector<double> &getOilSolubilityColumn() const
{ return ParentType::getColumn(0); }
const std::vector<double> &getGasFormationFactorColumn() const
{ return ParentType::getColumn(1); }
const std::vector<double> &getGasViscosityColumn() const
{ return ParentType::getColumn(2); }
};
}
#endif // OPM_PARSER_SIMPLE_TABLE_HPP

View File

@@ -0,0 +1,66 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_PVTG_OUTER_TABLE_HPP
#define OPM_PARSER_PVTG_OUTER_TABLE_HPP
#include "SimpleMultiRecordTable.hpp"
namespace Opm {
class PvtgOuterTable : protected SimpleMultiRecordTable {
typedef SimpleMultiRecordTable ParentType;
public:
/*!
* \brief Read the per record table of the PVTG keyword and
* provide some convenience methods for it.
*/
PvtgOuterTable(Opm::DeckKeywordConstPtr keyword, int tableIdx)
: ParentType(keyword,
std::vector<std::string>{"P", "RV", "BG", "MUG"},
tableIdx)
{}
int numRows() const
{ return ParentType::numRows(); };
int numColumns() const
{ return ParentType::numColumns(); };
int firstRecordIndex() const
{ return ParentType::firstRecordIndex(); }
int numRecords() const
{ return ParentType::numRecords(); }
const std::vector<double> &getPressureColumn() const
{ return ParentType::getColumn(0); }
const std::vector<double> &getOilSolubilityColumn() const
{ return ParentType::getColumn(1); }
const std::vector<double> &getGasFormationFactorColumn() const
{ return ParentType::getColumn(2); }
const std::vector<double> &getGasViscosityColumn() const
{ return ParentType::getColumn(3); }
};
}
#endif // OPM_PARSER_PVTO_OUTER_TABLE_HPP

View File

@@ -0,0 +1,48 @@
/*
Copyright (C) 2013 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_PVTG_TABLE_HPP
#define OPM_PARSER_PVTG_TABLE_HPP
#include "FullTable.hpp"
#include "PvtgInnerTable.hpp"
#include "PvtgOuterTable.hpp"
namespace Opm {
/*!
* \brief Read the table for the PVTG and provide convenient access to it.
*/
class PvtgTable : public Opm::FullTable<Opm::PvtgOuterTable, Opm::PvtgInnerTable>
{
typedef Opm::FullTable<Opm::PvtgOuterTable, Opm::PvtgInnerTable> ParentType;
public:
/*!
* \brief Read the table for the PVTG and provide convenient access to it.
*/
PvtgTable(Opm::DeckKeywordConstPtr keyword, int tableIdx)
: ParentType(keyword, tableIdx)
{ }
};
typedef std::shared_ptr<PvtgTable> PvtgTablePtr;
typedef std::shared_ptr<const PvtgTable> PvtgConstTablePtr;
}
#endif // OPM_PARSER_FULL_TABLE_HPP

View File

@@ -0,0 +1,59 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_PVTO_INNER_TABLE_HPP
#define OPM_PARSER_PVTO_INNER_TABLE_HPP
#include "SimpleTable.hpp"
namespace Opm {
class PvtoInnerTable : protected SimpleTable {
typedef SimpleTable ParentType;
public:
/*!
* \brief Read the per record table of the PVTO keyword and
* provide some convenience methods for it.
*
* The first value of the record (-> Rs) is skipped.
*/
PvtoInnerTable(Opm::DeckKeywordConstPtr keyword, int recordIdx = 0)
: SimpleTable(keyword,
std::vector<std::string>{"P", "BO", "MU"},
recordIdx, /*firstEntityOffset=*/1)
{}
int numRows() const
{ return ParentType::numRows(); };
int numColumns() const
{ return ParentType::numColumns(); };
const std::vector<double> &getPressureColumn() const
{ return ParentType::getColumn(0); }
const std::vector<double> &getOilFormationFactorColumn() const
{ return ParentType::getColumn(1); }
const std::vector<double> &getOilViscosityColumn() const
{ return ParentType::getColumn(2); }
};
}
#endif // OPM_PARSER_SIMPLE_TABLE_HPP

View File

@@ -0,0 +1,68 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_PVTO_OUTER_TABLE_HPP
#define OPM_PARSER_PVTO_OUTER_TABLE_HPP
#include "SimpleMultiRecordTable.hpp"
namespace Opm {
class PvtoOuterTable : protected SimpleMultiRecordTable {
typedef SimpleMultiRecordTable ParentType;
public:
/*!
* \brief Read the per record table of the PVTO keyword and
* provide some convenience methods for it.
*
* The first value of the record (-> Rs) is skipped.
*/
PvtoOuterTable(Opm::DeckKeywordConstPtr keyword, int tableIdx)
: ParentType(keyword,
std::vector<std::string>{"RS", "P", "BO", "MU"},
tableIdx)
{}
int numRows() const
{ return ParentType::numRows(); };
int numColumns() const
{ return ParentType::numColumns(); };
int firstRecordIndex() const
{ return ParentType::firstRecordIndex(); }
int numRecords() const
{ return ParentType::numRecords(); }
const std::vector<double> &getGasSolubilityColumn() const
{ return ParentType::getColumn(0); }
const std::vector<double> &getPressureColumn() const
{ return ParentType::getColumn(1); }
const std::vector<double> &getOilFormationFactorColumn() const
{ return ParentType::getColumn(2); }
const std::vector<double> &getOilViscosityColumn() const
{ return ParentType::getColumn(3); }
};
}
#endif // OPM_PARSER_PVTO_OUTER_TABLE_HPP

View File

@@ -0,0 +1,48 @@
/*
Copyright (C) 2013 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_PVTO_TABLE_HPP
#define OPM_PARSER_PVTO_TABLE_HPP
#include "FullTable.hpp"
#include "PvtoInnerTable.hpp"
#include "PvtoOuterTable.hpp"
namespace Opm {
/*!
* \brief Read the table for the PVTO and provide convenient access to it.
*/
class PvtoTable : public Opm::FullTable<Opm::PvtoOuterTable, Opm::PvtoInnerTable>
{
typedef Opm::FullTable<Opm::PvtoOuterTable, Opm::PvtoInnerTable> ParentType;
public:
/*!
* \brief Read the table for the PVTO and provide convenient access to it.
*/
PvtoTable(Opm::DeckKeywordConstPtr keyword, int tableIdx)
: ParentType(keyword, tableIdx)
{ }
};
typedef std::shared_ptr<PvtoTable> PvtoTablePtr;
typedef std::shared_ptr<const PvtoTable> PvtoConstTablePtr;
}
#endif // OPM_PARSER_FULL_TABLE_HPP

View File

@@ -0,0 +1,65 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_PVTW_TABLE_HPP
#define OPM_PARSER_PVTW_TABLE_HPP
#include "SimpleTable.hpp"
namespace Opm {
class PvtwTable : protected SimpleTable {
typedef SimpleTable ParentType;
public:
/*!
* \brief Read the PVTW keyword and provide some convenience
* methods for it.
*/
PvtwTable(Opm::DeckKeywordConstPtr keyword,
int recordIdx = 0,
int firstEntityOffset = 0)
: SimpleTable(keyword,
std::vector<std::string>{"P", "BW", "CW", "MUW", "CMUW"},
recordIdx, firstEntityOffset)
{}
int numRows() const
{ return ParentType::numRows(); };
int numColumns() const
{ return ParentType::numColumns(); };
const std::vector<double> &getPressureColumn() const
{ return ParentType::getColumn(0); }
const std::vector<double> &getFormationFactorColumn() const
{ return ParentType::getColumn(1); }
const std::vector<double> &getCompressibilityColumn() const
{ return ParentType::getColumn(2); }
const std::vector<double> &getViscosityColumn() const
{ return ParentType::getColumn(3); }
const std::vector<double> &getViscosibilityColumn() const
{ return ParentType::getColumn(4); }
};
}
#endif // OPM_PARSER_PVTW_TABLE_HPP

View File

@@ -0,0 +1,62 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_SGOF_TABLE_HPP
#define OPM_PARSER_SGOF_TABLE_HPP
#include "SimpleTable.hpp"
namespace Opm {
class SgofTable : protected SimpleTable {
typedef SimpleTable ParentType;
public:
/*!
* \brief Read the SGOF keyword and provide some convenience
* methods for it.
*/
SgofTable(Opm::DeckKeywordConstPtr keyword,
int recordIdx = 0,
int firstEntityOffset = 0)
: SimpleTable(keyword,
std::vector<std::string>{"SG", "KRG", "KROG", "PCOG"},
recordIdx, firstEntityOffset)
{}
int numRows() const
{ return ParentType::numRows(); };
int numColumns() const
{ return ParentType::numColumns(); };
const std::vector<double> &getSgColumn() const
{ return ParentType::getColumn(0); }
const std::vector<double> &getKrgColumn() const
{ return ParentType::getColumn(1); }
const std::vector<double> &getKrogColumn() const
{ return ParentType::getColumn(2); }
const std::vector<double> &getPcogColumn() const
{ return ParentType::getColumn(3); }
};
}
#endif // OPM_PARSER_SGOF_TABLE_HPP

View File

@@ -0,0 +1,97 @@
/*
Copyright (C) 2013 by Andreas Lauser
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/>.
*/
#include <opm/parser/eclipse/Utility/SimpleMultiRecordTable.hpp>
namespace Opm {
// create table from first few items of multiple records (i.e. getSIDoubleData() throws an exception)
SimpleMultiRecordTable::SimpleMultiRecordTable(Opm::DeckKeywordConstPtr keyword,
const std::vector<std::string> &columnNames,
size_t tableIdx,
size_t firstEntityOffset)
{
createColumns_(columnNames);
// first, go to the first record of the specified table. For this,
// we need to skip the right number of empty records...
size_t curTableIdx = 0;
for (m_firstRecordIdx = 0;
curTableIdx < tableIdx;
++ m_firstRecordIdx)
{
if (getNumFlatItems_(keyword->getRecord(m_firstRecordIdx)) == 0)
// next table starts with an empty record
++ curTableIdx;
}
if (curTableIdx != tableIdx) {
throw std::runtime_error("keyword does not specify enough tables");
}
// find the number of records in the table
for (m_numRecords = 0;
m_firstRecordIdx + m_numRecords < keyword->size()
&& getNumFlatItems_(keyword->getRecord(m_firstRecordIdx + m_numRecords)) != 0;
++ m_numRecords)
{
}
for (size_t rowIdx = m_firstRecordIdx; rowIdx < m_firstRecordIdx + m_numRecords; ++ rowIdx) {
// extract the actual data from the records of the keyword of
// the deck
Opm::DeckRecordConstPtr deckRecord =
keyword->getRecord(rowIdx);
if ( (getNumFlatItems_(deckRecord) - firstEntityOffset) < numColumns())
throw std::runtime_error("Number of columns in the data file is"
"inconsistent with the ones specified");
for (size_t colIdx = 0; colIdx < numColumns(); ++colIdx) {
size_t deckItemIdx = colIdx + firstEntityOffset;
m_columns[colIdx].push_back(getFlatSiDoubleData_(deckRecord, deckItemIdx));
}
}
}
size_t SimpleMultiRecordTable::getNumFlatItems_(Opm::DeckRecordConstPtr deckRecord) const
{
int result = 0;
for (unsigned i = 0; i < deckRecord->size(); ++ i) {
Opm::DeckItemConstPtr item(deckRecord->getItem(i));
if (item->defaultApplied())
return result;
result += item->size();
}
return result;
}
double SimpleMultiRecordTable::getFlatSiDoubleData_(Opm::DeckRecordConstPtr deckRecord, unsigned flatItemIdx) const
{
unsigned itemFirstFlatIdx = 0;
for (unsigned i = 0; i < deckRecord->size(); ++ i) {
Opm::DeckItemConstPtr item = deckRecord->getItem(i);
if (itemFirstFlatIdx + item->size() > flatItemIdx)
return item->getSIDouble(flatItemIdx - itemFirstFlatIdx);
else
itemFirstFlatIdx += item->size();
}
throw std::range_error("Tried to access out-of-range flat item");
}
}

View File

@@ -0,0 +1,75 @@
/*
Copyright (C) 2013 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_SIMPLE_MULTI_RECORD_TABLE_HPP
#define OPM_PARSER_SIMPLE_MULTI_RECORD_TABLE_HPP
#include <opm/parser/eclipse/Utility/SimpleTable.hpp>
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include <cassert>
namespace Opm {
// create table from first few items of multiple records (i.e. getSIDoubleData() throws an exception)
class SimpleMultiRecordTable : public SimpleTable {
public:
/*!
* \brief Read simple tables from multi-item keywords like PVTW
*
* This creates a table out of the first N items of each of
* the keyword's records. (N is the number of columns.)
*/
SimpleMultiRecordTable(Opm::DeckKeywordConstPtr keyword,
const std::vector<std::string> &columnNames,
size_t tableIndex,
size_t firstEntityOffset = 0);
/*!
* \brief Return the index of the first record which applies
* for this table object.
*/
size_t firstRecordIndex() const
{ return m_firstRecordIdx; }
/*!
* \brief Return the number of records which are used by this
* this table object.
*/
size_t numRecords() const
{ return m_numRecords; }
private:
size_t getNumFlatItems_(Opm::DeckRecordConstPtr deckRecord) const;
double getFlatSiDoubleData_(Opm::DeckRecordConstPtr deckRecord, unsigned flatItemIdx) const;
size_t m_firstRecordIdx;
size_t m_numRecords;
};
typedef std::shared_ptr<SimpleMultiRecordTable> SimpleMultiRecordTablePtr;
typedef std::shared_ptr<const SimpleMultiRecordTable> SimpleMultiRecordTableConstPtr;
}
#endif // OPM_PARSER_SIMPLE_MULTI_RECORD_TABLE_HPP

View File

@@ -0,0 +1,86 @@
/*
Copyright (C) 2013 by Andreas Lauser
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/>.
*/
#include <opm/parser/eclipse/Utility/SimpleTable.hpp>
namespace Opm {
// create table from single record
SimpleTable::SimpleTable(Opm::DeckKeywordConstPtr keyword,
const std::vector<std::string> &columnNames,
size_t recordIdx,
size_t firstEntityOffset)
{
createColumns_(columnNames);
// extract the actual data from the deck
Opm::DeckRecordConstPtr deckRecord =
keyword->getRecord(recordIdx);
size_t numFlatItems = getNumFlatItems_(deckRecord);
if ( (numFlatItems - firstEntityOffset) % numColumns() != 0)
throw std::runtime_error("Number of columns in the data file is"
"inconsistent with the ones specified");
for (size_t rowIdx = 0;
rowIdx*numColumns() < numFlatItems - firstEntityOffset;
++rowIdx)
{
for (size_t colIdx = 0; colIdx < numColumns(); ++colIdx) {
size_t deckItemIdx = rowIdx*numColumns() + firstEntityOffset + colIdx;
m_columns[colIdx].push_back(getFlatSiDoubleData_(deckRecord, deckItemIdx));
}
}
}
void SimpleTable::createColumns_(const std::vector<std::string> &columnNames)
{
// Allocate column names. TODO (?): move the column names into
// the json description of the keyword.
auto columnNameIt = columnNames.begin();
const auto &columnNameEndIt = columnNames.end();
size_t columnIdx = 0;
for (; columnNameIt != columnNameEndIt; ++columnNameIt, ++columnIdx) {
m_columnNames[*columnNameIt] = columnIdx;
}
m_columns.resize(columnIdx);
}
size_t SimpleTable::getNumFlatItems_(Opm::DeckRecordConstPtr deckRecord) const
{
size_t result = 0;
for (size_t i = 0; i < deckRecord->size(); ++ i) {
result += deckRecord->getItem(i)->size();
}
return result;
}
double SimpleTable::getFlatSiDoubleData_(Opm::DeckRecordConstPtr deckRecord, size_t flatItemIdx) const
{
size_t itemFirstFlatIdx = 0;
for (unsigned i = 0; i < deckRecord->size(); ++ i) {
Opm::DeckItemConstPtr item = deckRecord->getItem(i);
if (itemFirstFlatIdx + item->size() > flatItemIdx)
return item->getSIDouble(flatItemIdx - itemFirstFlatIdx);
else
itemFirstFlatIdx += item->size();
}
throw std::range_error("Tried to access out-of-range flat item");
}
}

View File

@@ -0,0 +1,94 @@
/*
Copyright (C) 2013 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_SIMPLE_TABLE_HPP
#define OPM_PARSER_SIMPLE_TABLE_HPP
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
#include <map>
#include <memory>
#include <string>
#include <vector>
#include <cassert>
namespace Opm {
class SimpleTable {
protected:
// protected default constructor for the derived classes
SimpleTable() {}
public:
/*!
* \brief Read simple tables from keywords like SWOF
*
* This requires all data to be a list of doubles in the first
* item of a given record index.
*/
SimpleTable(Opm::DeckKeywordConstPtr keyword,
const std::vector<std::string> &columnNames,
size_t recordIdx = 0,
size_t firstEntityOffset = 0);
// constructor to make the base class compatible with specialized table implementations
SimpleTable(Opm::DeckKeywordConstPtr keyword,
size_t recordIdx = 0,
size_t firstEntityOffset = 0)
{
throw std::logic_error("The base class of simple tables can't be "
"instantiated without specifying columns!");
}
size_t numColumns() const
{ return m_columns.size(); }
size_t numRows() const
{ return m_columns[0].size(); }
const std::vector<double> &getColumn(const std::string &name) const
{
const auto &colIt = m_columnNames.find(name);
if (colIt == m_columnNames.end())
throw std::runtime_error("Unknown column name \""+name+"\"");
int colIdx = colIt->second;
assert(0 <= colIdx && colIdx < static_cast<int>(m_columns.size()));
return m_columns[colIdx];
}
const std::vector<double> &getColumn(size_t colIdx) const
{
assert(0 <= colIdx && colIdx < static_cast<size_t>(m_columns.size()));
return m_columns[colIdx];
}
protected:
void createColumns_(const std::vector<std::string> &columnNames);
size_t getNumFlatItems_(Opm::DeckRecordConstPtr deckRecord) const;
double getFlatSiDoubleData_(Opm::DeckRecordConstPtr deckRecord, size_t flatItemIdx) const;
std::map<std::string, size_t> m_columnNames;
std::vector<std::vector<double> > m_columns;
};
typedef std::shared_ptr<SimpleTable> SimpleTablePtr;
typedef std::shared_ptr<const SimpleTable> SimpleTableConstPtr;
}
#endif // OPM_PARSER_SIMPLE_TABLE_HPP

View File

@@ -0,0 +1,91 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_SPECGRID_WRAPPER_HPP
#define OPM_PARSER_SPECGRID_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class SpecgridWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'SPECGRID' keyword.
*/
SpecgridWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of grid blocks in I direction
*/
int numGridBlocksI() const
{ return m_keyword->getRecord(0)->getItem(0)->getInt(0); }
/*!
* \brief Return the number of grid blocks in J direction
*/
int numGridBlocksJ() const
{ return m_keyword->getRecord(0)->getItem(1)->getInt(0); }
/*!
* \brief Return the number of grid blocks in K direction
*/
int numGridBlocksK() const
{ return m_keyword->getRecord(0)->getItem(2)->getInt(0); }
/*!
* \brief The number of IJK grid blocks as a vector
*/
std::vector<int> numBlocksVector() const
{
std::vector<int> dim(3);
dim[0] = numGridBlocksI();
dim[1] = numGridBlocksJ();
dim[2] = numGridBlocksK();
return dim;
}
/*!
* \brief Return the number of reservoirs
*/
int numReservoirs() const
{ return m_keyword->getRecord(0)->getItem(3)->getInt(0); }
/*!
* \brief Type of the coordinate system
*
* This is one of:
* - "T": cylindrical coordinates
* - "F": cartesianCoordinates
*/
std::string coordSystemType() const
{ return m_keyword->getRecord(0)->getItem(4)->getString(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_SPECGRID_WRAPPER_HPP

View File

@@ -0,0 +1,84 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_START_WRAPPER_HPP
#define OPM_PARSER_START_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <stdexcept>
namespace Opm {
class StartWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data exposed by the 'START' keyword.
*/
StartWrapper(Opm::DeckKeywordConstPtr keyword)
{
int day = keyword->getRecord(0)->getItem(0)->getInt(0);
std::string month = keyword->getRecord(0)->getItem(1)->getString(0);
int year = keyword->getRecord(0)->getItem(2)->getInt(0);
int monthNum = 0;
if (month == "JAN")
monthNum = 1;
else if (month == "FEB")
monthNum = 2;
else if (month == "MAR")
monthNum = 3;
else if (month == "APR")
monthNum = 4;
else if (month == "MAY")
monthNum = 5;
else if (month == "JUN")
monthNum = 6;
else if (month == "JUL")
monthNum = 7;
else if (month == "AUG")
monthNum = 8;
else if (month == "SEP")
monthNum = 9;
else if (month == "OCT")
monthNum = 10;
else if (month == "NOV")
monthNum = 11;
else if (month == "DEC")
monthNum = 12;
else
throw std::runtime_error("Invalid month specified for START keyword");
m_startDate = boost::gregorian::date(year, monthNum, day);
}
/*!
* \brief Return calendar date at which the simulation starts.
*/
const boost::gregorian::date &getStartDate() const
{ return m_startDate; }
private:
boost::gregorian::date m_startDate;
};
}
#endif // OPM_PARSER_START_KEYWORD_HPP

View File

@@ -0,0 +1,62 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_SWOF_TABLE_HPP
#define OPM_PARSER_SWOF_TABLE_HPP
#include "SimpleTable.hpp"
namespace Opm {
class SwofTable : protected SimpleTable {
typedef SimpleTable ParentType;
public:
/*!
* \brief Read the SWOF keyword and provide some convenience
* methods for it.
*/
SwofTable(Opm::DeckKeywordConstPtr keyword,
int recordIdx = 0,
int firstEntityOffset = 0)
: SimpleTable(keyword,
std::vector<std::string>{"SW", "KRW", "KROW", "PCOW"},
recordIdx, firstEntityOffset)
{}
int numRows() const
{ return ParentType::numRows(); };
int numColumns() const
{ return ParentType::numColumns(); };
const std::vector<double> &getSwColumn() const
{ return ParentType::getColumn(0); }
const std::vector<double> &getKrwColumn() const
{ return ParentType::getColumn(1); }
const std::vector<double> &getKrowColumn() const
{ return ParentType::getColumn(2); }
const std::vector<double> &getPcowColumn() const
{ return ParentType::getColumn(3); }
};
}
#endif // OPM_PARSER_SIMPLE_TABLE_HPP

View File

@@ -0,0 +1,59 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_TSTEP_WRAPPER_HPP
#define OPM_PARSER_TSTEP_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class TstepWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data exposed by the 'TSTEP' keyword.
*/
TstepWrapper(Opm::DeckKeywordConstPtr keyword)
{
m_timesteps = keyword->getSIDoubleData();
m_totalTime = std::accumulate(m_timesteps.begin(), m_timesteps.end(), 0.0);
}
/*!
* \brief Return the simulated timestep sizes in seconds.
*/
const std::vector<double> &timestepVector() const
{ return m_timesteps; }
/*!
* \brief Return the total simulation time in seconds.
*/
double totalTime() const
{ return m_totalTime; }
private:
std::vector<double> m_timesteps;
double m_totalTime;
};
}
#endif // OPM_PARSER_TSTEP_KEYWORD_HPP

View File

@@ -0,0 +1,160 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_WCONINJ_WRAPPER_HPP
#define OPM_PARSER_WCONINJ_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class WconinjWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'WCONINJ' keyword.
*/
WconinjWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of injection wells
*/
int numWells() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of the well with a given index
*/
std::string wellName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(0)->getString(0); }
/*!
* \brief Return the injector type of a well.
*
* This is one of:
* - OIL
* - WATER
* - GAS
*/
std::string wellType(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(1)->getString(0); }
/*!
* \brief Return whether a well is open or closed
*
* This is one of:
* - OPEN: Well injects
* - STOP: Well does not reach the reservoir, but it
* injects. (and some of this fluid reaches the reservoir
* via crossflow)
* - SHUT: Well does not influence the reservoir
* - AUTO: Simulation selects one of the above depending in the
* well parameters and reservoir conditions at the well.
*/
std::string wellStatus(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(2)->getString(0); }
/*!
* \brief Return the what should be controlled for a given well
*
* This is one of:
* - RATE: Control for the surface volume rate of the fluid
* - RESV: Control for the reservoir volume rate of the fluid
* - BHP: Control for the bottom hole pressure
* - THP: Control for the top hole pressure
*/
std::string controlMode(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(3)->getString(0); }
/*!
* \brief Return the target for the volumetric surface rate of a well
*
* If the control mode does not use the volumetric surface
* rate, this is the upper limit.
*/
double surfaceTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(4)->getSIDouble(0); }
/*!
* \brief Return the target for the volumetric reservoir rate of a well
*
* If the control mode does not use the volumetric reservoir
* rate, this is the upper limit.
*/
double reservoirTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(5)->getSIDouble(0); }
/*!
* \brief Return the reinjection replacement percentage of well
*/
double reinjectionReplacementRatio(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(6)->getSIDouble(0); }
/*!
* \brief Return how reinjection should be handled
*
* This is one of:
* - NONE
* - GPRD
* - FPRD
*/
std::string reinjectionReplacementType(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(7)->getString(0); }
/*!
* \brief The target of the bottom hole pressure
*
* If the control mode does not use the bottom hole pressure,
* this specifies the upper limit.
*/
double bottomHoleTargetPressure(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(9)->getSIDouble(0); }
/*!
* \brief The target of the top hole pressure
*
* If the control mode does not use the bottom hole pressure,
* this specifies the upper limit.
*/
double topHoleTargetPressure(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(10)->getSIDouble(0); }
/*!
* \brief The index of the PVT table used for the injected fluid
*/
int vfpTableIndex(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(11)->getInt(0); }
/*!
* \brief The vaporized oil concentration in the injected gas (if the well injects gas)
*/
double vaporizedOilConcentration(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(12)->getSIDouble(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_WCONINJ_WRAPPER_HPP

View File

@@ -0,0 +1,170 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_WCONINJE_WRAPPER_HPP
#define OPM_PARSER_WCONINJE_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class WconinjeWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'WCONINJE' keyword.
*/
WconinjeWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of injection wells
*/
int numWells() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of the well with a given index
*/
std::string wellName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(0)->getString(0); }
/*!
* \brief Return the injector type of a well.
*
* This is one of:
* - OIL
* - WATER
* - STEAM-GAS
* - GAS
* - MULTI
*/
std::string wellType(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(1)->getString(0); }
/*!
* \brief Return whether a well is open or closed
*
* This is one of:
* - OPEN: Well injects
* - STOP: Well does not reach the reservoir, but it
* injects. (and some of this fluid reaches the reservoir
* via crossflow)
* - SHUT: Well does not influence the reservoir
* - AUTO: Simulation selects one of the above depending in the
* well parameters and reservoir conditions at the well.
*/
std::string wellStatus(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(2)->getString(0); }
/*!
* \brief Return the what should be controlled for a given well
*
* This is one of:
* - RATE: Control for the surface volume rate of the fluid
* - RESV: Control for the reservoir volume rate of the fluid
* - BHP: Control for the bottom hole pressure
* - THP: Control for the top hole pressure
* - GRUP: Use the control mode which applies for the group of the well
*/
std::string controlMode(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(3)->getString(0); }
/*!
* \brief Return the target for the volumetric surface rate of a well
*
* If the control mode does not use the volumetric surface
* rate, this is the upper limit.
*/
double surfaceTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(4)->getSIDouble(0); }
/*!
* \brief Return the target for the volumetric reservoir rate of a well
*
* If the control mode does not use the volumetric reservoir
* rate, this is the upper limit.
*/
double reservoirTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(5)->getSIDouble(0); }
/*!
* \brief The target of the bottom hole pressure
*
* If the control mode does not use the bottom hole pressure,
* this specifies the upper limit.
*/
double bottomHoleTargetPressure(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(6)->getSIDouble(0); }
/*!
* \brief The target of the top hole pressure
*
* If the control mode does not use the bottom hole pressure,
* this specifies the upper limit.
*/
double topHoleTargetPressure(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(7)->getSIDouble(0); }
/*!
* \brief The index of the PVT table used for the injected fluid
*/
int vfpTableIndex(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(8)->getInt(0); }
/*!
* \brief The vaporized oil concentration in the injected gas (if the well injects gas)
*/
double vaporizedOilConcentration(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(9)->getSIDouble(0); }
/*!
* \brief The gas to steam ratio (at reservoir conditions?) for GAS-STEAM injectors.
*/
double gasSteamRatio(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(10)->getSIDouble(0); }
/*!
* \brief The proportion of oil at the surface for multi-phase injector wells.
*/
double surfaceOilRatio(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(11)->getSIDouble(0); }
/*!
* \brief The proportion water oil at the surface for multi-phase injector wells.
*/
double surfaceWaterRatio(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(12)->getSIDouble(0); }
/*!
* \brief The proportion water oil at the surface for multi-phase injector wells.
*/
double surfaceGasRatio(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(13)->getSIDouble(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_WCONINJE_WRAPPER_HPP

View File

@@ -0,0 +1,196 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_WCONPROD_WRAPPER_HPP
#define OPM_PARSER_WCONPROD_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class WconprodWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'WCONPROD' keyword.
*/
WconprodWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of injection wells
*/
int numWells() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of the well with a given index
*/
std::string wellName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(0)->getString(0); }
/*!
* \brief Return the connection type of a well.
*
* This is one of:
* - OPEN
* - STOP
* - SHUT
* - AUTO
*/
std::string wellStatus(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(1)->getString(0); }
/*!
* \brief Return the control mode of a well.
*
* This is one of:
* - ORAT (surface oil rate)
* - WRAT (surface water rate)
* - GRAT (surface gas rate)
* - LRAT (surface liquid rate)
* - CRAT (linear combination of the surface rates)
* - RESV (reservoir fluid volume rate)
* - BHP (bottom-hole pressure)
* - THP (top-hole pressure)
* - WGRA (wet-gas rate)
* - TMRA (total molar rate)
* - STRA (steam volume rate)
* - SATP (water saturation pressure)
* - SATT (water temperature)
* - CVAL (caloric rate)
* - NGL (NGL rate, WTF?)
* - GRUP (group of the well controls the regime)
* - ' ' (undefined, default)
*/
std::string controlMode(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(2)->getString(0); }
/*!
* \brief The upper limit of the surface oil rate.
*/
double oilTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(3)->getSIDouble(0); }
/*!
* \brief The upper limit of the surface water rate.
*/
double waterTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(4)->getSIDouble(0); }
/*!
* \brief The upper limit of the surface gas rate.
*/
double gasTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(5)->getSIDouble(0); }
/*!
* \brief The upper rate limit of the liquids at the surface.
*/
double liquidTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(6)->getSIDouble(0); }
/*!
* \brief The upper limit of the fluid volumes at the reservoir.
*/
double reservoirTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(7)->getSIDouble(0); }
/*!
* \brief The lower limit of the bottom hole pressure.
*/
double bottomHoleTargetPressure(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(8)->getSIDouble(0); }
/*!
* \brief The lower limit of the top hole pressure.
*/
double topHoleTargetPressure(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(9)->getSIDouble(0); }
/*!
* \brief The index of the well's VFP table
*/
int vfpTableIndex(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(10)->getInt(0); }
/*!
* \brief The artificial lift quantity of the well.
*/
double artificialLiftQuantity(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(11)->getSIDouble(0); }
/*!
* \brief The upper limit of the produced wet gas
*/
double wetGasTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(12)->getSIDouble(0); }
/*!
* \brief The upper limit of the produced molar rate
*/
double molarTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(13)->getSIDouble(0); }
/*!
* \brief The upper limit for the rate of the produced steam
*/
double steamTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(14)->getSIDouble(0); }
/*!
* \brief The pressure offset used for saturation pressure control
*/
double pressureOffset(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(15)->getSIDouble(0); }
/*!
* \brief The temperature offset used for saturation temperature control
*/
double temperatureOffset(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(16)->getSIDouble(0); }
/*!
* \brief The upper limit of the caloric rate
*/
double caloricTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(17)->getSIDouble(0); }
/*!
* \brief The index of the linearly combined rate specified by the LINCOM keyword
*/
int lincomIndex(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(18)->getInt(0); }
/*!
* \brief The upper limit of the NGL rate
*/
double nglTargetRate(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(19)->getSIDouble(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_WCONPROD_WRAPPER_HPP

View File

@@ -0,0 +1,104 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_WELOPEN_WRAPPER_HPP
#define OPM_PARSER_WELOPEN_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class WelopenWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'WELOPEN' keyword.
*/
WelopenWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of injection wells
*/
int numWells() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of the well with a given index
*/
std::string wellName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(0)->getString(0); }
/*!
* \brief Return whether a well is open or closed
*
* This is one of:
* - OPEN: Well injects
* - STOP: Well does not reach the reservoir, but it
* injects. (and some of this fluid reaches the reservoir
* via crossflow)
* - SHUT: Well does not influence the reservoir
* - AUTO: Simulation selects one of the above depending in the
* well parameters and reservoir conditions at the well.
*/
std::string wellStatus(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(1)->getString(0); }
/*!
* \brief Return the I-coordinate of the connection grid block
*/
int coordinateI(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(2)->getInt(0); }
/*!
* \brief Return the J-coordinate of the connection grid block
*/
int coordinateJ(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(3)->getInt(0); }
/*!
* \brief Return the K-coordinate of the connection grid block
*/
int coordinateK(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(4)->getInt(0); }
/*!
* \brief Return the index of the first well completion for
* which this data applies
*/
int firstCompletionNumber(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(5)->getInt(0); }
/*!
* \brief Return the index of the last well completion for
* which this data applies
*/
int lastCompletionNumber(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(6)->getInt(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_WELOPEN_WRAPPER_HPP

View File

@@ -0,0 +1,153 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_WELSPECS_WRAPPER_HPP
#define OPM_PARSER_WELSPECS_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class WelspecsWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of an individual well as exposed by the
* 'WELSPECS' keyword.
*/
WelspecsWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number if wells covered by the WELSPECS keyword.
*/
int numWells() const
{ return m_keyword->size(); }
/*!
* \brief Return the name of the well
*/
const std::string wellName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(0)->getString(0); }
/*!
* \brief Return the name of the group this well belongs to
*/
const std::string groupName(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(1)->getString(0); }
/*!
* \brief Return east-west grid coordinate of the well
*/
int coordinateI(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(2)->getInt(0); }
/*!
* \brief Return north-south grid coordinate of the well
*/
int coordinateJ(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(3)->getInt(0); }
/*!
* \brief Return reference depth to which the bottom hole pressure of the well applies
*/
double referenceDepth(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(4)->getSIDouble(0); }
/*!
* \brief Return the preferred fluid phase of this well
*
* (whatever this means.) This method returns a string that
* contains one of "OIL", "WATER", "GAS", or "LIQ".
*/
const std::string preferredPhase(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(5)->getString(0); }
/*!
* \brief Return effective drainage radius of the well
*/
double drainageRadius(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(6)->getSIDouble(0); }
/*!
* \brief Return the inflow equation to be used for the well
*
* This is one of "STD", "NO", "R-G", "YES", "P-P" or "GPP".
*/
const std::string inflowEquation(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(7)->getString(0); }
/*!
* \brief Returns true if the well is closed for fluids
*/
bool isShut(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(8)->getString(0) == "SHUT"; }
/*!
* \brief Returns true if crossflow should be allowed
*/
bool allowCrossflow(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(9)->getString(0) == "YES"; }
/*!
* \brief Returns the pressure number to be used for the wellbore fluids
*/
int pressureTableNumber(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(10)->getInt(0); }
/*!
* \brief Indicates the type of the calculation to be used for hydrostatic pressure
*
* This is one of:
* - "SEG": segmented density calculation
* - "AVG": averaged density calculation
*/
const std::string hydrostaticCalculation(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(11)->getString(0); }
/*!
* \brief Indicates the "fluid in place" region table number
* used to calculate volumetric rates at reservoir
* conditions.
*/
int inPlaceRegionNumber(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(12)->getInt(0); }
// items 14 and 15 are "reserved for FrontSim"
/*!
* \brief Indicates well model to be used
*
* This is one of:
* - "STD": The standard well model (Peaceman??)
* - "HMIW": High Mobility Injection Wells
*/
const std::string wellModel(int wellIdx) const
{ return m_keyword->getRecord(wellIdx)->getItem(15)->getString(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_WELSPECS_WRAPPER_HPP

View File

@@ -0,0 +1,94 @@
/*
Copyright (C) 2014 by Andreas Lauser
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/>.
*/
#ifndef OPM_PARSER_WGRUPCON_WRAPPER_HPP
#define OPM_PARSER_WGRUPCON_WRAPPER_HPP
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <vector>
#include <algorithm>
namespace Opm {
class WgrupconWrapper {
public:
/*!
* \brief A wrapper class to provide convenient access to the
* data of the 'WGRUPCON' keyword.
*/
WgrupconWrapper(Opm::DeckKeywordConstPtr keyword)
: m_keyword(keyword)
{
}
/*!
* \brief Return the number of well groups to which this keyword applies
*/
int numGroups() const
{ return m_keyword->size(); }
/*!
* \brief Return the human-readable name of a well group with
* a given index
*/
std::string groupName(int groupIdx) const
{ return m_keyword->getRecord(groupIdx)->getItem(0)->getString(0); }
/*!
* \brief Return whether the group is available for higher
* level groups to control.
*/
bool isUnconstraint(int groupIdx) const
{ return m_keyword->getRecord(groupIdx)->getItem(1)->getString(0) == "YES"; }
/*!
* \brief Return the guide rate for the group
*/
double guideRate(int groupIdx) const
{ return m_keyword->getRecord(groupIdx)->getItem(2)->getSIDouble(0); }
/*!
* \brief Return the type of a well group.
*
* This is one of:
* - OIL
* - WAT
* - GAS
* - LIQ
* - COMB
* - WGA
* - CVAL
* - RAT
* - RES
*/
std::string controlPhase(int groupIdx) const
{ return m_keyword->getRecord(groupIdx)->getItem(3)->getString(0); }
/*!
* \brief Return the scaling factor for the guide rate of a group
*/
double guideRateScalingFactor(int groupIdx) const
{ return m_keyword->getRecord(groupIdx)->getItem(4)->getSIDouble(0); }
private:
Opm::DeckKeywordConstPtr m_keyword;
};
}
#endif // OPM_PARSER_WGRUPCON_WRAPPER_HPP

View File

@@ -0,0 +1,3 @@
add_executable(runSimpleTableTests SimpleTableTests.cpp)
target_link_libraries(runSimpleTableTests Parser ${Boost_LIBRARIES})
add_test(NAME runSimpleTableTests WORKING_DIRECTORY ${PROJECT_SOURCE_DIR} COMMAND ${EXECUTABLE_OUTPUT_PATH}/runTimeMapTests )

View File

@@ -0,0 +1,48 @@
/*
Copyright (C) 2013 by Andreas Lauser
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/>.
*/
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Deck/DeckDoubleItem.hpp>
#include <opm/parser/eclipse/Utility/SimpleTable.hpp>
#define BOOST_TEST_MODULE SimpleTableTests
#include <boost/test/unit_test.hpp>
#include <boost/date_time/posix_time/posix_time.hpp>
#include <boost/filesystem.hpp>
#include <stdexcept>
#include <iostream>
BOOST_AUTO_TEST_CASE(CreateSimpleTable_InvalidDeck) {
Opm::DeckKeywordPtr keyword(new Opm::DeckKeyword("SWOF"));
Opm::DeckRecordPtr record(new Opm::DeckRecord());
Opm::DeckDoubleItemPtr item = Opm::DeckDoubleItemPtr(new Opm::DeckDoubleItem(/*name=*/"foo"));
item->push_back(1);
item->push_back(2);
item->push_back(3);
record->addItem(item);
keyword->addRecord(record);
std::vector<std::string> columnNames{"SW", "KRW", "KROW", "PCOW"};
BOOST_CHECK_THROW(Opm::SimpleTable(keyword, columnNames, /*recordIdx=*/0) , std::runtime_error);
}

View File

@@ -6,10 +6,10 @@
{"name" : "K2" , "value_type" : "INT" },
{"name" : "STATE" , "value_type" : "STRING" , "default" : "OPEN"},
{"name" : "SAT_TABLE" , "value_type" : "INT" , "default" : 0},
{"name" : "CF" , "value_type" : "FLOAT"},
{"name" : "DIAMETER" , "value_type" : "FLOAT"},
{"name" : "Kh" , "value_type" : "FLOAT" , "default" : -1},
{"name" : "SKIN" , "value_type" : "FLOAT" , "default" : 0},
{"name" : "D_FACTOR" , "value_type" : "FLOAT" },
{"name" : "CF" , "value_type" : "FLOAT", "dimension" : "1"},
{"name" : "DIAMETER" , "value_type" : "FLOAT", "dimension" : "L"},
{"name" : "Kh" , "value_type" : "FLOAT", "dimension" : "K" , "default" : -1},
{"name" : "SKIN" , "value_type" : "FLOAT", "dimension" : "1" , "default" : 0},
{"name" : "D_FACTOR" , "value_type" : "FLOAT", "dimension" : "1" },
{"name" : "DIR" , "value_type" : "STRING" , "default" : "Z"},
{"name" : "PR" , "value_type" : "FLOAT" }]}
{"name" : "PR" , "value_type" : "FLOAT", "dimension" : "P" }]}

View File

@@ -1 +1 @@
{"name" : "COORD", "data" : {"value_type" : "FLOAT" }}
{"name" : "COORD", "data" : {"value_type" : "FLOAT", "dimension" : "L" }}

View File

@@ -1 +1,3 @@
{"name":"DEPTH", "data": {"value_type" : "FLOAT"}, "comment" : "DEPTHZ is not documented in the Eclipse manual, but found in the SPE1 case"}
{"name" : "DEPTHZ" , "data" : {"value_type" : "FLOAT" , "dimension" : "L"},
"comment" : "DEPTHZ is not documented in the Eclipse manual, but found in the SPE1 case"
}

View File

@@ -1 +1 @@
{"name":"DXV", "data" : {"value_type" : "FLOAT" }}
{"name":"DXV", "data" : {"value_type" : "FLOAT", "dimension":"L" }}

View File

@@ -1 +1 @@
{"name":"DYV", "data" : {"value_type" : "FLOAT" }}
{"name":"DYV", "data" : {"value_type" : "FLOAT", "dimension":"L" }}

View File

@@ -1 +1 @@
{"name":"DZV", "data" : {"value_type" : "FLOAT" }}
{"name":"DZV", "data" : {"value_type" : "FLOAT", "dimension":"L" }}

View File

@@ -4,12 +4,12 @@
{"name" : "CONTROL_MODE" , "value_type" : "STRING" , "default" : "NONE"},
{"name" : "SURFACE_TARGET" , "value_type" : "FLOAT" , "default" : 0 , "dimension" : "FlowVolume/t"},
{"name" : "RESV_TARGET" , "value_type" : "FLOAT" , "default" : 0 , "dimension" : "FlowVolume/t"},
{"name" : "REINJ_TARGET" , "value_type" : "FLOAT" , "default" : 0},
{"name" : "VOIDAGE_TARGET" , "value_type" : "FLOAT" , "default" : 0},
{"name" : "REINJ_TARGET" , "value_type" : "FLOAT" , "default" : 0, "dimension":"1"},
{"name" : "VOIDAGE_TARGET" , "value_type" : "FLOAT" , "default" : 0, "dimension":"1"},
{"name" : "FREE" , "value_type" : "STRING" , "default" : "YES"},
{"name" : "GUIDE_FRACTION" , "value_type" : "FLOAT" , "default" : 0},
{"name" : "GUIDE_FRACTION" , "value_type" : "FLOAT" , "default" : 0, "dimension":"1"},
{"name" : "GUIDE_DEF" , "value_type" : "STRING"},
{"name" : "REINJECT_GROUP" , "value_type" : "STRING"},
{"name" : "VOIDAGE_GROUP" , "value_type" : "STRING"},
{"name" : "WETGAS_TARGET", "value_type" : "FLOAT" , "dimension" : "FlowVolume/t"}
]}
]}

View File

@@ -1,7 +1,7 @@
{"name" : "MAPAXES" , "size" : 1 , "items" : [
{"name" : "X1" , "value_type" : "FLOAT"},
{"name" : "Y1" , "value_type" : "FLOAT"},
{"name" : "X2" , "value_type" : "FLOAT"},
{"name" : "Y2" , "value_type" : "FLOAT"},
{"name" : "X3" , "value_type" : "FLOAT"},
{"name" : "Y3" , "value_type" : "FLOAT"}]}
{"name" : "X1" , "value_type" : "FLOAT", "dimension" : "L" },
{"name" : "Y1" , "value_type" : "FLOAT", "dimension" : "L" },
{"name" : "X2" , "value_type" : "FLOAT", "dimension" : "L" },
{"name" : "Y2" , "value_type" : "FLOAT", "dimension" : "L" },
{"name" : "X3" , "value_type" : "FLOAT", "dimension" : "L" },
{"name" : "Y3" , "value_type" : "FLOAT", "dimension" : "L" }]}

View File

@@ -1 +1 @@
{"name" : "PRESSURE" , "data" : {"value_type" : "FLOAT"}}
{"name" : "PRESSURE" , "data" : {"value_type" : "FLOAT", "dimension" : "P"}}

View File

@@ -1,4 +1,6 @@
{"name" : "PVTG" , "num_tables" : {"keyword":"TABDIMS" , "item":"NTPVT"},
"items" : [{"name" : "GAS_PRESSURE" , "value_type" : "FLOAT"},
{"name" : "DATA" , "size_type" : "ALL" , "value_type" : "FLOAT"}]}
"items" : [
{"name":"GAS_PRESSURE", "value_type" : "FLOAT", "dimension":"P" },
{"name":"DATA", "size_type" : "ALL" , "value_type":"FLOAT" , "dimension" : ["1/Rs","1","mu"]}
]
}

View File

@@ -1,7 +1,6 @@
{"name" : "PVTO" , "size" : {"keyword" : "TABDIMS" , "item" : "NTPVT"},
{"name" : "PVTO" , "num_tables" : {"keyword" : "TABDIMS" , "item" : "NTPVT"},
"items" : [
{"name":"RS", "value_type" : "FLOAT", "dimension":"Rs" },
{"name":"table", "value_type":"FLOAT", "size_type" : "ALL" , "dimension" : ["P","1","mu"]}
{"name":"DATA", "value_type":"FLOAT", "size_type" : "ALL" , "dimension" : ["P","1","mu"]}
]
}

View File

@@ -1,4 +1,4 @@
{"name" : "ROCK" , "size" : {"keyword":"TABDIMS" , "item":"NTPVT"}, "items" : [
{"name" : "PREF" , "value_type" : "FLOAT" , "default" : 1.0132 , "comment" : "Units ...."},
{"name" : "COMPRESSIBILITY" , "value_type" : "FLOAT" , "default" : 0 , "comment" : "Units ...."},
{"name" : "MATRIX_COMPRESSIBILITY" , "value_type" : "FLOAT" , "default" : 0 , "comment" : "Units ...."}]}
{"name" : "PREF" , "value_type" : "FLOAT" , "default" : 1.0132 , "dimension" : "P"},
{"name" : "COMPRESSIBILITY" , "value_type" : "FLOAT" , "default" : 0 , "dimension" : "1/P"},
{"name" : "MATRIX_COMPRESSIBILITY" , "value_type" : "FLOAT" , "default" : 0 , "dimension" : "1/P"}]}

View File

@@ -1 +1 @@
{"name" : "RS" , "data" : {"value_type" : "FLOAT"}}
{"name" : "RS" , "data" : {"value_type" : "FLOAT", "dimension" : "Rs"}}

View File

@@ -1 +1 @@
{"name" : "SGAS" , "data" : {"value_type" : "FLOAT"}}
{"name" : "SGAS" , "data" : {"value_type" : "FLOAT", "dimension" : "1"}}

View File

@@ -1 +1 @@
{"name" : "SWAT" , "data" : {"value_type" : "FLOAT"}}
{"name" : "SWAT" , "data" : {"value_type" : "FLOAT", "dimension" : "1"}}

View File

@@ -1,5 +1,5 @@
{"name" : "SWOF" , "size" : {"keyword" : "TABDIMS" , "item" : "NTSFUN"},
"items" : [
{"name":"table", "value_type":"FLOAT", "size_type" : "ALL" , "dimension" : ["1","1","1","P"]}
{"name":"DATA", "value_type":"FLOAT", "size_type" : "ALL" , "dimension" : ["1","1","1","P"]}
]
}

View File

@@ -1 +1,7 @@
{"name" : "TSTEP" , "size" : 1 , "items" : [{"name" : "step_list" , "value_type" : "FLOAT" , "size_type" : "ALL"}]}
{"name" : "TSTEP" ,
"size" : 1,
"items" : [{
"name" : "step_list" ,
"value_type" : "FLOAT" ,
"dimension" : "Timestep",
"size_type" : "ALL"}]}

View File

@@ -13,4 +13,4 @@
{"name" : "SURFACE_OIL_FRACTION" , "value_type" : "FLOAT" , "default" : 0},
{"name" : "SURFACE_GAS_FRACTION" , "value_type" : "FLOAT" , "default" : 0},
{"name" : "OIL_STEAM_RATIO" , "value_type" : "FLOAT" , "default" : 0}
]}
]}

View File

@@ -5,7 +5,7 @@
{"name" : "HEAD_J" , "value_type" : "INT"},
{"name" : "REF_DEPTH" , "value_type" : "FLOAT", "dimension" : "L"},
{"name" : "PHASE" , "value_type" : "STRING"},
{"name" : "D_RADIUS" , "value_type" : "FLOAT" , "default" : 0},
{"name" : "D_RADIUS" , "value_type" : "FLOAT" , "default" : 0, "dimension" : "L"},
{"name" : "INFLOW_EQ" , "value_type" : "STRING" , "default" : "STD"},
{"name" : "AUTO_SHUTIN" , "value_type" : "STRING" , "default" : "SHUT"},
{"name" : "CROSSFLOW" , "value_type" : "STRING" , "default" : "YES"},

View File

@@ -1 +1 @@
{"name" : "ZCORN", "data" : {"value_type" : "FLOAT" }}
{"name" : "ZCORN", "data" : {"value_type" : "FLOAT", "dimension" : "L" }}

View File

@@ -1,21 +0,0 @@
TABDIMS
-- NTSFUN NTPVT NSSFUN NPPVT NTFIP NRPVT
1 2 30 24 10 20 /
PVTG
--
20.00 0.00002448 0.061895 0.01299
0.00001224 0.061810 0.01300
0.00000000 0.061725 0.01300 /
40.00 0.00000628 0.030252 0.01383
0.00000314 0.030249 0.01383
0.00000000 0.030245 0.01383 /
/
197.66 0.00006327 0.005820 0.02160
0.00003164 0.005840 0.02122
0.00000000 0.005860 0.02086 /
231.13 0.00010861 0.005042 0.02477
0.00005431 0.005061 0.02389
0.00000000 0.005082 0.02306 /
/