Add keyword PLYDHFLF.

This commit is contained in:
Liu Ming
2015-06-20 16:57:42 +08:00
parent e8dea65435
commit e1fa3a98c8
8 changed files with 140 additions and 1 deletions

View File

@@ -224,6 +224,7 @@ EclipseState/Tables/Sof2Table.hpp
EclipseState/Tables/EnptvdTable.hpp
EclipseState/Tables/FullTable.hpp
EclipseState/Tables/PlyviscTable.hpp
EclipseState/Tables/PlydhflfTable.hpp
EclipseState/Tables/PlyshlogTable.hpp
EclipseState/Tables/EnkrvdTable.hpp
EclipseState/Tables/ImkrvdTable.hpp

View File

@@ -206,6 +206,10 @@ namespace Opm {
return m_plyshlogTables;
}
const std::vector<PlydhflfTable>& EclipseState::getPlydhflfTables() const {
return m_plydhflfTables;
}
const std::vector<PvdgTable>& EclipseState::getPvdgTables() const {
return m_pvdgTables;
}
@@ -335,6 +339,7 @@ namespace Opm {
initSimpleTables(deck, "PLYMAX", m_plymaxTables);
initSimpleTables(deck, "PLYROCK", m_plyrockTables);
initSimpleTables(deck, "PLYVISC", m_plyviscTables);
initSimpleTables(deck, "PLYDHFLF", m_plydhflfTables);
initSimpleTables(deck, "PVDG", m_pvdgTables);
initSimpleTables(deck, "PVDO", m_pvdoTables);
initSimpleTables(deck, "RSVD", m_rsvdTables);

View File

@@ -45,6 +45,7 @@
#include <opm/parser/eclipse/EclipseState/Tables/PlyrockTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/PlyviscTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/PlyshlogTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/PlydhflfTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/PvdgTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/PvdoTable.hpp>
#include <opm/parser/eclipse/EclipseState/Tables/PvtgTable.hpp>
@@ -119,6 +120,7 @@ namespace Opm {
const std::vector<PlymaxTable>& getPlymaxTables() const;
const std::vector<PlyrockTable>& getPlyrockTables() const;
const std::vector<PlyviscTable>& getPlyviscTables() const;
const std::vector<PlydhflfTable>& getPlydhflfTables() const;
const std::vector<PlyshlogTable>& getPlyshlogTables() const;
const std::vector<PvdgTable>& getPvdgTables() const;
const std::vector<PvdoTable>& getPvdoTables() const;
@@ -264,6 +266,7 @@ namespace Opm {
std::vector<PlymaxTable> m_plymaxTables;
std::vector<PlyrockTable> m_plyrockTables;
std::vector<PlyviscTable> m_plyviscTables;
std::vector<PlydhflfTable> m_plydhflfTables;
std::vector<PlyshlogTable> m_plyshlogTables;
std::vector<PvdgTable> m_pvdgTables;
std::vector<PvdoTable> m_pvdoTables;

View File

@@ -0,0 +1,68 @@
/*
Copyright (C) 2015 Statoil ASA.
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_PLYDHFLF_TABLE_HPP
#define OPM_PARSER_PLYDHFLF_TABLE_HPP
#include "SingleRecordTable.hpp"
namespace Opm {
// forward declaration
class EclipseState;
class PlydhflfTable : protected SingleRecordTable {
typedef SingleRecordTable ParentType;
friend class EclipseState;
PlydhflfTable() = default;
/*!
* \brief Read the PLYDHFLF keyword and provide some convenience
* methods for it.
*/
void init(Opm::DeckKeywordConstPtr keyword, int recordIdx)
{
ParentType::init(keyword,
std::vector<std::string>{
"Temperature",
"PolymerHalflife"
},
recordIdx,
/*firstEntityOffset=*/0);
ParentType::checkNonDefaultable("Temperetura");
ParentType::checkMonotonic("Temperature", /*isAscending=*/true);
ParentType::checkNonDefaultable("PolymerHalflife");
ParentType::checkMonotonic("PolymerHalflife", /*isAscending=*/false);
}
public:
using ParentType::numTables;
using ParentType::numRows;
using ParentType::numColumns;
using ParentType::evaluate;
const std::vector<double> &getTemperatureColumn() const
{ return ParentType::getColumn(0); }
const std::vector<double> &getPolymerHalflifeColumn() const
{ return ParentType::getColumn(1); }
};
}
#endif

View File

@@ -2,7 +2,7 @@ add_definitions( -DKEYWORD_DIRECTORY="${PROJECT_SOURCE_DIR}/opm/parser/share/key
foreach(tapp CheckDeckValidity IntegrationTests ParseWellProbe
ParseTITLE ParseTOPS ParseWCONHIST ParseWellWithWildcards
ParsePORO ParsePLYVISC ParsePLYSHLOG ParseDATAWithDefault
ParsePORO ParsePLYVISC ParsePLYDHFLF ParsePLYSHLOG ParseDATAWithDefault
ParseTVDP ParseDENSITY ParseVFPPROD ScheduleCreateFromDeck
CompletionsFromDeck ParseEND IncludeTest ParseEQUIL
ParseRSVD ParsePVTG ParsePVTO ParseSWOF BoxTest

View File

@@ -0,0 +1,45 @@
/*
Copyright 2015 Statoil ASA.
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 ParsePLYDHFLF
#include <math.h>
#include <boost/test/unit_test.hpp>
#include <boost/test/test_tools.hpp>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
using namespace Opm;
BOOST_AUTO_TEST_CASE( PARSE_PLYDHFLF_OK) {
ParserPtr parser(new Parser());
boost::filesystem::path deckFile("testdata/integration_tests/POLYMER/plydhflf.data");
DeckPtr deck = parser->parseFile(deckFile.string());
DeckKeywordConstPtr kw = deck->getKeyword("PLYDHFLF");
DeckRecordConstPtr rec = kw->getRecord(0);
DeckItemPtr item = rec->getItem(0);
BOOST_CHECK_EQUAL( 0.0 , item->getRawDouble(0) );
BOOST_CHECK_EQUAL( 365.0, item->getRawDouble(1) );
BOOST_CHECK_EQUAL( 200.0 , item->getRawDouble(5) );
}

View File

@@ -0,0 +1,7 @@
{"name" : "PLYDHFLF" , "sections" : ["SPECIAL", "PROPS", "SCHEDULE"], "size" : {"keyword" : "TABDIMS" , "item" : "NTPVT"} , "items" :
[
{"name":"DATA", "value_type":"DOUBLE", "size_type" : "ALL" , "dimension" : ["Temperature","Time"]}
]
}