2013-10-25 17:30:16 +02:00
|
|
|
/*
|
|
|
|
|
Copyright 2013 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/>.
|
2014-01-30 13:29:04 +01:00
|
|
|
*/
|
2013-10-25 17:30:16 +02:00
|
|
|
|
2013-11-05 17:58:57 +01:00
|
|
|
#define BOOST_TEST_MODULE ScheduleIntegrationTests
|
2013-10-25 17:30:16 +02:00
|
|
|
#include <math.h>
|
|
|
|
|
|
|
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
|
#include <boost/test/test_tools.hpp>
|
|
|
|
|
#include <boost/date_time/posix_time/posix_time.hpp>
|
|
|
|
|
|
|
|
|
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
|
|
|
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
2015-07-24 15:38:22 +02:00
|
|
|
#include <opm/parser/eclipse/Parser/ParseMode.hpp>
|
2013-10-25 17:30:16 +02:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
2014-02-21 12:48:36 +01:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
2013-11-09 13:17:42 +01:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp>
|
2015-06-23 14:20:31 +02:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
|
2013-12-16 17:23:46 +01:00
|
|
|
#include <opm/parser/eclipse/Units/ConversionFactors.hpp>
|
2014-02-14 11:38:49 +01:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/GroupTreeNode.hpp>
|
2013-10-25 17:30:16 +02:00
|
|
|
|
|
|
|
|
using namespace Opm;
|
|
|
|
|
|
2014-03-21 00:05:02 +01:00
|
|
|
|
2013-11-08 15:55:11 +01:00
|
|
|
BOOST_AUTO_TEST_CASE(CreateSchedule) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2013-10-25 17:30:16 +02:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE1");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(10,10,3);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched(new Schedule(parseMode , grid , deck, ioConfig));
|
2013-10-25 17:30:16 +02:00
|
|
|
TimeMapConstPtr timeMap = sched->getTimeMap();
|
2014-02-21 16:31:55 +01:00
|
|
|
BOOST_CHECK_EQUAL(boost::posix_time::ptime(boost::gregorian::date(2007, boost::gregorian::May, 10)), sched->getStartTime());
|
2013-11-08 15:55:11 +01:00
|
|
|
BOOST_CHECK_EQUAL(9U, timeMap->size());
|
2013-12-02 14:59:40 +01:00
|
|
|
BOOST_CHECK( deck->hasKeyword("NETBALAN") );
|
2013-11-05 15:25:47 +01:00
|
|
|
}
|
|
|
|
|
|
2013-11-20 14:35:48 +01:00
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(CreateSchedule_Comments_After_Keywords) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2013-11-20 14:35:48 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_COMMENTS_AFTER_KEYWORDS");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(10,10,3);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched(new Schedule(parseMode , grid , deck, ioConfig));
|
2013-11-20 14:35:48 +01:00
|
|
|
TimeMapConstPtr timeMap = sched->getTimeMap();
|
2014-02-21 16:31:55 +01:00
|
|
|
BOOST_CHECK_EQUAL(boost::posix_time::ptime(boost::gregorian::date(2007, boost::gregorian::May, 10)), sched->getStartTime());
|
2013-11-20 14:35:48 +01:00
|
|
|
BOOST_CHECK_EQUAL(9U, timeMap->size());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-03-03 10:08:34 +01:00
|
|
|
BOOST_AUTO_TEST_CASE(WCONPROD_MissingCmode) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2014-03-03 10:08:34 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_MISSING_CMODE");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(10,10,3);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
BOOST_CHECK_NO_THROW( new Schedule(parseMode , grid , deck, ioConfig) );
|
2014-03-03 10:08:34 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-03-03 15:00:42 +01:00
|
|
|
BOOST_AUTO_TEST_CASE(WCONPROD_Missing_DATA) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2014-03-03 15:00:42 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_CMODE_MISSING_DATA");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(10,10,3);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
BOOST_CHECK_THROW( new Schedule(parseMode , grid , deck, ioConfig) , std::invalid_argument );
|
2014-03-03 15:00:42 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-01-26 11:34:28 +01:00
|
|
|
BOOST_AUTO_TEST_CASE(WellTestRefDepth) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2015-01-26 11:34:28 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_WELLS2");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-27 10:39:39 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(40,60,30);
|
|
|
|
|
BOOST_CHECK_EQUAL(3, 3);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched(new Schedule(parseMode , grid , deck, ioConfig));
|
2015-01-27 10:39:39 +01:00
|
|
|
BOOST_CHECK_EQUAL(4, 4);
|
2015-01-26 11:34:28 +01:00
|
|
|
|
|
|
|
|
WellPtr well1 = sched->getWell("W_1");
|
|
|
|
|
WellPtr well2 = sched->getWell("W_2");
|
|
|
|
|
WellPtr well4 = sched->getWell("W_4");
|
|
|
|
|
BOOST_CHECK_EQUAL( well1->getRefDepth() , grid->getCellDepth( 29 , 36 , 0 ));
|
|
|
|
|
BOOST_CHECK_EQUAL( well2->getRefDepth() , 100 );
|
|
|
|
|
BOOST_CHECK_THROW( well4->getRefDepth() , std::invalid_argument );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2015-05-28 14:55:09 +02:00
|
|
|
BOOST_AUTO_TEST_CASE(WellTestOpen) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2015-05-28 14:55:09 +02:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_WELLS2");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-05-28 14:55:09 +02:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(40,60,30);
|
|
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched(new Schedule(parseMode , grid , deck, ioConfig));
|
2015-05-28 14:55:09 +02:00
|
|
|
|
|
|
|
|
auto well1 = sched->getWell( "W_1" );
|
|
|
|
|
auto well2 = sched->getWell( "W_2" );
|
|
|
|
|
auto well3 = sched->getWell( "W_3" );
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
auto wells = sched->getOpenWells( 3 );
|
|
|
|
|
BOOST_CHECK_EQUAL( 1U , wells.size() );
|
|
|
|
|
BOOST_CHECK_EQUAL( well1 , wells[0] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
auto wells = sched->getOpenWells(6);
|
|
|
|
|
BOOST_CHECK_EQUAL( 3U , wells.size() );
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL( well1 , wells[0] );
|
|
|
|
|
BOOST_CHECK_EQUAL( well2 , wells[1] );
|
|
|
|
|
BOOST_CHECK_EQUAL( well3 , wells[2] );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
auto wells = sched->getOpenWells(12);
|
|
|
|
|
BOOST_CHECK_EQUAL( 2U , wells.size() );
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL( well2 , wells[0] );
|
|
|
|
|
BOOST_CHECK_EQUAL( well3 , wells[1] );
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2015-01-26 11:34:28 +01:00
|
|
|
|
2014-03-03 10:08:34 +01:00
|
|
|
|
2013-11-08 15:55:11 +01:00
|
|
|
BOOST_AUTO_TEST_CASE(WellTesting) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2013-11-05 15:25:47 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_WELLS2");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-27 10:39:39 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(40,60,30);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched(new Schedule(parseMode , grid , deck, ioConfig));
|
2013-11-14 16:08:10 +01:00
|
|
|
|
2015-01-26 11:34:28 +01:00
|
|
|
BOOST_CHECK_EQUAL(4U, sched->numWells());
|
2013-11-09 13:17:42 +01:00
|
|
|
BOOST_CHECK(sched->hasWell("W_1"));
|
|
|
|
|
BOOST_CHECK(sched->hasWell("W_2"));
|
|
|
|
|
BOOST_CHECK(sched->hasWell("W_3"));
|
2013-11-05 15:25:47 +01:00
|
|
|
|
2014-01-29 15:55:02 +01:00
|
|
|
{
|
|
|
|
|
WellPtr well2 = sched->getWell("W_2");
|
2014-03-17 16:03:58 +01:00
|
|
|
BOOST_CHECK_EQUAL( 0 , well2->getProductionPropertiesCopy(2).ResVRate);
|
|
|
|
|
BOOST_CHECK_CLOSE( 777/Metric::Time , well2->getProductionPropertiesCopy(7).ResVRate , 0.0001);
|
|
|
|
|
BOOST_CHECK_EQUAL( 0 , well2->getProductionPropertiesCopy(8).ResVRate);
|
2014-01-29 15:55:02 +01:00
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL( WellCommon::SHUT , well2->getStatus(3));
|
2014-01-30 13:29:04 +01:00
|
|
|
|
2014-03-21 00:05:02 +01:00
|
|
|
{
|
|
|
|
|
const WellProductionProperties& prop3 = well2->getProductionProperties(3);
|
|
|
|
|
BOOST_CHECK_EQUAL( WellProducer::ORAT , prop3.controlMode);
|
|
|
|
|
BOOST_CHECK( prop3.hasProductionControl(WellProducer::ORAT));
|
|
|
|
|
BOOST_CHECK( prop3.hasProductionControl(WellProducer::GRAT));
|
2014-10-13 19:26:53 +02:00
|
|
|
BOOST_CHECK( prop3.hasProductionControl(WellProducer::WRAT));
|
2014-03-21 00:05:02 +01:00
|
|
|
}
|
2014-06-27 00:19:48 +02:00
|
|
|
|
|
|
|
|
// BOOST_CHECK( !well2->getProductionProperties(8).hasProductionControl(WellProducer::GRAT));
|
2014-01-29 15:55:02 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
WellPtr well3 = sched->getWell("W_3");
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL( WellCommon::AUTO , well3->getStatus(3));
|
2014-03-17 16:03:58 +01:00
|
|
|
BOOST_CHECK_EQUAL( 0 , well3->getProductionPropertiesCopy(2).LiquidRate);
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2014-03-21 00:05:02 +01:00
|
|
|
{
|
|
|
|
|
const WellProductionProperties& prop7 = well3->getProductionProperties(7);
|
|
|
|
|
BOOST_CHECK_CLOSE( 999/Metric::Time , prop7.LiquidRate , 0.001);
|
|
|
|
|
BOOST_CHECK_EQUAL( WellProducer::RESV, prop7.controlMode);
|
|
|
|
|
}
|
2014-03-17 16:03:58 +01:00
|
|
|
BOOST_CHECK_EQUAL( 0 , well3->getProductionPropertiesCopy(8).LiquidRate);
|
2014-01-29 15:55:02 +01:00
|
|
|
}
|
|
|
|
|
|
2013-11-05 15:25:47 +01:00
|
|
|
{
|
2013-11-09 13:17:42 +01:00
|
|
|
WellPtr well1 = sched->getWell("W_1");
|
2013-11-08 15:55:11 +01:00
|
|
|
|
2014-03-20 23:27:18 +01:00
|
|
|
BOOST_CHECK(well1->getProductionPropertiesCopy(0).predictionMode);
|
2014-03-17 16:03:58 +01:00
|
|
|
BOOST_CHECK_EQUAL(0, well1->getProductionPropertiesCopy(0).OilRate);
|
2013-12-16 17:23:46 +01:00
|
|
|
|
2014-03-17 16:03:58 +01:00
|
|
|
BOOST_CHECK_EQUAL(0, well1->getProductionPropertiesCopy(1).OilRate);
|
|
|
|
|
BOOST_CHECK_EQUAL(0, well1->getProductionPropertiesCopy(2).OilRate);
|
2013-11-14 16:08:10 +01:00
|
|
|
|
2014-03-20 23:27:18 +01:00
|
|
|
BOOST_CHECK(!well1->getProductionPropertiesCopy(3).predictionMode);
|
2014-03-17 16:03:58 +01:00
|
|
|
BOOST_CHECK_CLOSE(4000/Metric::Time , well1->getProductionPropertiesCopy(3).OilRate , 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE(4000/Metric::Time , well1->getProductionPropertiesCopy(4).OilRate , 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE(4000/Metric::Time , well1->getProductionPropertiesCopy(5).OilRate , 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE(4/Metric::Time , well1->getProductionPropertiesCopy(3).WaterRate , 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE(12345/Metric::Time , well1->getProductionPropertiesCopy(3).GasRate , 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE(4/Metric::Time , well1->getProductionPropertiesCopy(4).WaterRate , 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE(12345/Metric::Time , well1->getProductionPropertiesCopy(4).GasRate , 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE(4/Metric::Time , well1->getProductionPropertiesCopy(5).WaterRate , 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE(12345/Metric::Time , well1->getProductionPropertiesCopy(5).GasRate , 0.001);
|
2013-12-16 17:23:46 +01:00
|
|
|
|
2013-11-08 15:55:11 +01:00
|
|
|
|
2014-03-20 23:27:18 +01:00
|
|
|
BOOST_CHECK(!well1->getProductionPropertiesCopy(6).predictionMode);
|
2014-03-17 16:03:58 +01:00
|
|
|
BOOST_CHECK_CLOSE(14000/Metric::Time , well1->getProductionPropertiesCopy(6).OilRate , 0.001);
|
2013-11-14 16:08:10 +01:00
|
|
|
|
2014-03-20 23:27:18 +01:00
|
|
|
BOOST_CHECK(well1->getProductionPropertiesCopy(7).predictionMode);
|
2014-03-17 16:03:58 +01:00
|
|
|
BOOST_CHECK_CLOSE(11000/Metric::Time , well1->getProductionPropertiesCopy(7).OilRate , 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE(44/Metric::Time , well1->getProductionPropertiesCopy(7).WaterRate , 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE(188/Metric::Time , well1->getProductionPropertiesCopy(7).GasRate , 0.001);
|
2013-11-14 16:08:10 +01:00
|
|
|
|
2014-03-20 23:27:18 +01:00
|
|
|
BOOST_CHECK(!well1->getProductionPropertiesCopy(8).predictionMode);
|
2014-03-17 16:03:58 +01:00
|
|
|
BOOST_CHECK_CLOSE(13000/Metric::Time , well1->getProductionPropertiesCopy(8).OilRate , 0.001);
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2014-03-17 16:03:58 +01:00
|
|
|
BOOST_CHECK_CLOSE(123.00 * Metric::Pressure , well1->getInjectionPropertiesCopy(10).BHPLimit, 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE(678.00 * Metric::Pressure , well1->getInjectionPropertiesCopy(10).THPLimit, 0.001);
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2014-03-21 00:05:02 +01:00
|
|
|
{
|
|
|
|
|
const WellInjectionProperties& prop11 = well1->getInjectionProperties(11);
|
|
|
|
|
BOOST_CHECK_CLOSE(5000/Metric::Time , prop11.surfaceInjectionRate, 0.001);
|
|
|
|
|
BOOST_CHECK_EQUAL( WellInjector::RATE , prop11.controlMode);
|
|
|
|
|
BOOST_CHECK_EQUAL( WellCommon::OPEN , well1->getStatus( 11 ));
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-29 13:33:28 +01:00
|
|
|
|
2014-01-30 16:31:35 +01:00
|
|
|
|
2014-03-21 00:05:02 +01:00
|
|
|
BOOST_CHECK( well1->isInjector(9));
|
|
|
|
|
{
|
|
|
|
|
const WellInjectionProperties& prop9 = well1->getInjectionProperties(9);
|
|
|
|
|
BOOST_CHECK_CLOSE(20000/Metric::Time , prop9.surfaceInjectionRate , 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE(200000/Metric::Time , prop9.reservoirInjectionRate, 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE(6891 * Metric::Pressure , prop9.BHPLimit, 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE(0 , prop9.THPLimit , 0.001);
|
|
|
|
|
BOOST_CHECK_EQUAL( WellInjector::RESV , prop9.controlMode);
|
|
|
|
|
BOOST_CHECK( prop9.hasInjectionControl(WellInjector::RATE ));
|
|
|
|
|
BOOST_CHECK( prop9.hasInjectionControl(WellInjector::RESV ));
|
|
|
|
|
BOOST_CHECK( !prop9.hasInjectionControl(WellInjector::THP));
|
|
|
|
|
BOOST_CHECK( !prop9.hasInjectionControl(WellInjector::BHP));
|
|
|
|
|
}
|
|
|
|
|
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2014-03-21 00:05:02 +01:00
|
|
|
BOOST_CHECK_EQUAL( WellCommon::SHUT , well1->getStatus( 12 ));
|
2014-03-17 16:03:58 +01:00
|
|
|
BOOST_CHECK( well1->getInjectionPropertiesCopy(12).hasInjectionControl(WellInjector::RATE ));
|
|
|
|
|
BOOST_CHECK( !well1->getInjectionPropertiesCopy(12).hasInjectionControl(WellInjector::RESV));
|
|
|
|
|
BOOST_CHECK( well1->getInjectionPropertiesCopy(12).hasInjectionControl(WellInjector::THP ));
|
|
|
|
|
BOOST_CHECK( well1->getInjectionPropertiesCopy(12).hasInjectionControl(WellInjector::BHP ));
|
2014-01-30 16:31:35 +01:00
|
|
|
|
2013-11-09 13:17:42 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2015-01-02 16:39:50 +01:00
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WellTestCOMPDAT_DEFAULTED_ITEMS) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2015-01-02 16:39:50 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_COMPDAT1");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-27 10:39:39 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(40,60,30);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched(new Schedule(parseMode , grid, deck, ioConfig));
|
2015-01-02 16:39:50 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2013-11-14 16:08:10 +01:00
|
|
|
BOOST_AUTO_TEST_CASE(WellTestCOMPDAT) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2013-11-09 13:17:42 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_WELLS2");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(40,60,30);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched(new Schedule(parseMode , grid , deck, ioConfig));
|
2013-11-09 13:17:42 +01:00
|
|
|
|
2015-01-26 11:34:28 +01:00
|
|
|
BOOST_CHECK_EQUAL(4U, sched->numWells());
|
2013-11-14 16:08:10 +01:00
|
|
|
BOOST_CHECK(sched->hasWell("W_1"));
|
|
|
|
|
BOOST_CHECK(sched->hasWell("W_2"));
|
|
|
|
|
BOOST_CHECK(sched->hasWell("W_3"));
|
2013-11-09 13:17:42 +01:00
|
|
|
{
|
|
|
|
|
WellPtr well1 = sched->getWell("W_1");
|
2014-03-17 16:03:58 +01:00
|
|
|
BOOST_CHECK_CLOSE(13000/Metric::Time , well1->getProductionPropertiesCopy(8).OilRate , 0.0001);
|
2013-11-14 16:08:10 +01:00
|
|
|
CompletionSetConstPtr completions = well1->getCompletions(0);
|
|
|
|
|
BOOST_CHECK_EQUAL(0U, completions->size());
|
|
|
|
|
|
|
|
|
|
completions = well1->getCompletions(3);
|
|
|
|
|
BOOST_CHECK_EQUAL(4U, completions->size());
|
2014-01-28 15:30:25 +01:00
|
|
|
|
2015-01-26 00:09:13 +01:00
|
|
|
BOOST_CHECK_EQUAL(WellCompletion::OPEN, completions->get(3)->getState());
|
2014-09-06 12:35:43 +02:00
|
|
|
BOOST_CHECK_EQUAL(2.2836805555555556e-12 , completions->get(3)->getConnectionTransmissibilityFactor());
|
2014-01-28 15:30:25 +01:00
|
|
|
BOOST_CHECK_EQUAL(0.311/Metric::Length, completions->get(3)->getDiameter());
|
|
|
|
|
BOOST_CHECK_EQUAL(3.3, completions->get(3)->getSkinFactor());
|
2013-11-14 16:08:10 +01:00
|
|
|
|
|
|
|
|
completions = well1->getCompletions(7);
|
|
|
|
|
BOOST_CHECK_EQUAL(4U, completions->size());
|
2015-01-26 00:09:13 +01:00
|
|
|
BOOST_CHECK_EQUAL(WellCompletion::SHUT, completions->get(3)->getState());
|
2013-11-05 15:25:47 +01:00
|
|
|
}
|
2013-10-25 17:30:16 +02:00
|
|
|
}
|
2013-11-14 16:08:10 +01:00
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(GroupTreeTest_GRUPTREE_with_explicit_L0_parenting) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2013-11-14 16:08:10 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_GRUPTREE_EXPLICIT_PARENTING");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(10,10,3);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched(new Schedule(parseMode , grid , deck, ioConfig));
|
2013-11-14 16:08:10 +01:00
|
|
|
|
|
|
|
|
GroupTreeNodePtr rootNode = sched->getGroupTree(0)->getNode("FIELD");
|
2013-11-18 15:28:58 +01:00
|
|
|
|
2013-11-14 16:08:10 +01:00
|
|
|
|
|
|
|
|
BOOST_REQUIRE_EQUAL("FIELD", rootNode->name());
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK(rootNode->hasChildGroup("FIRST_LEVEL1"));
|
|
|
|
|
GroupTreeNodePtr FIRST_LEVEL1 = rootNode->getChildGroup("FIRST_LEVEL1");
|
|
|
|
|
BOOST_CHECK(rootNode->hasChildGroup("FIRST_LEVEL2"));
|
|
|
|
|
GroupTreeNodePtr FIRST_LEVEL2 = rootNode->getChildGroup("FIRST_LEVEL2");
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK(FIRST_LEVEL1->hasChildGroup("SECOND_LEVEL1"));
|
|
|
|
|
GroupTreeNodePtr SECOND_LEVEL1 = FIRST_LEVEL1->getChildGroup("SECOND_LEVEL1");
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK(FIRST_LEVEL2->hasChildGroup("SECOND_LEVEL2"));
|
|
|
|
|
GroupTreeNodePtr SECOND_LEVEL2 = FIRST_LEVEL2->getChildGroup("SECOND_LEVEL2");
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK(SECOND_LEVEL1->hasChildGroup("THIRD_LEVEL1"));
|
|
|
|
|
GroupTreeNodePtr THIRD_LEVEL1 = SECOND_LEVEL1->getChildGroup("THIRD_LEVEL1");
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-03 13:29:02 +01:00
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(GroupTreeTest_GRUPTREE_correct) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2014-03-03 13:29:02 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_WELSPECS_GRUPTREE");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(10,10,3);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr schedule(new Schedule(parseMode , grid , deck, ioConfig));
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2014-03-03 13:29:02 +01:00
|
|
|
BOOST_CHECK( schedule->hasGroup( "FIELD" ));
|
|
|
|
|
BOOST_CHECK( schedule->hasGroup( "PROD" ));
|
|
|
|
|
BOOST_CHECK( schedule->hasGroup( "INJE" ));
|
|
|
|
|
BOOST_CHECK( schedule->hasGroup( "MANI-PROD" ));
|
|
|
|
|
BOOST_CHECK( schedule->hasGroup( "MANI-INJ" ));
|
|
|
|
|
BOOST_CHECK( schedule->hasGroup( "DUMMY-PROD" ));
|
|
|
|
|
BOOST_CHECK( schedule->hasGroup( "DUMMY-INJ" ));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2014-02-14 11:38:49 +01:00
|
|
|
BOOST_AUTO_TEST_CASE(GroupTreeTest_WELSPECS_AND_GRUPTREE_correct_iter_function) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2014-02-14 11:38:49 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_WELSPECS_GROUPS");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(10,10,3);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr schedule(new Schedule(parseMode , grid , deck, ioConfig));
|
2014-02-14 11:38:49 +01:00
|
|
|
|
|
|
|
|
// Time 0, only from WELSPECS
|
|
|
|
|
GroupTreeNodeConstPtr root = schedule->getGroupTree(0)->getNode("FIELD");
|
|
|
|
|
|
|
|
|
|
int iter_counted = 0;
|
|
|
|
|
|
2014-12-08 16:34:28 +01:00
|
|
|
for (auto iter=root->begin(); iter != root->end(); ++iter)
|
2014-02-14 12:36:26 +01:00
|
|
|
iter_counted++;
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2014-02-14 11:38:49 +01:00
|
|
|
BOOST_CHECK_EQUAL(2, iter_counted);
|
|
|
|
|
// Time 1, a new group added in tree
|
|
|
|
|
iter_counted = 0;
|
|
|
|
|
|
|
|
|
|
root = schedule->getGroupTree(1)->getNode("FIELD");
|
|
|
|
|
for (auto iter=root->begin(); iter != root->end(); ++iter) {
|
|
|
|
|
iter_counted++;
|
|
|
|
|
}
|
|
|
|
|
BOOST_CHECK_EQUAL(3, iter_counted);
|
|
|
|
|
}
|
|
|
|
|
|
2013-11-18 15:28:58 +01:00
|
|
|
BOOST_AUTO_TEST_CASE(GroupTreeTest_WELSPECS_AND_GRUPTREE_correct_tree) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2013-11-14 16:08:10 +01:00
|
|
|
ParserPtr parser(new Parser());
|
2013-11-18 15:28:58 +01:00
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_WELSPECS_GROUPS");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(10,10,3);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr schedule(new Schedule(parseMode , grid , deck, ioConfig));
|
2013-11-14 16:08:10 +01:00
|
|
|
|
2013-11-18 15:28:58 +01:00
|
|
|
// Time 0, only from WELSPECS
|
|
|
|
|
GroupTreeNodePtr root0 = schedule->getGroupTree(0)->getNode("FIELD");
|
|
|
|
|
BOOST_REQUIRE_EQUAL("FIELD", root0->name());
|
|
|
|
|
BOOST_CHECK(root0->hasChildGroup("GROUP_BJARNE"));
|
|
|
|
|
GroupTreeNodePtr GROUP_BJARNE = root0->getChildGroup("GROUP_BJARNE");
|
|
|
|
|
BOOST_CHECK_EQUAL("GROUP_BJARNE", GROUP_BJARNE->name());
|
2013-11-14 16:08:10 +01:00
|
|
|
|
2013-11-18 15:28:58 +01:00
|
|
|
BOOST_CHECK(root0->hasChildGroup("GROUP_ODD"));
|
|
|
|
|
GroupTreeNodePtr GROUP_ODD = root0->getChildGroup("GROUP_ODD");
|
|
|
|
|
BOOST_CHECK_EQUAL("GROUP_ODD", GROUP_ODD->name());
|
2013-11-14 16:08:10 +01:00
|
|
|
|
2013-11-18 15:28:58 +01:00
|
|
|
// Time 1, now also from GRUPTREE
|
|
|
|
|
GroupTreeNodePtr root1 = schedule->getGroupTree(1)->getNode("FIELD");
|
|
|
|
|
BOOST_REQUIRE_EQUAL("FIELD", root1->name());
|
|
|
|
|
BOOST_CHECK(root1->hasChildGroup("GROUP_BJARNE"));
|
|
|
|
|
GroupTreeNodePtr GROUP_BJARNE1 = root1->getChildGroup("GROUP_BJARNE");
|
|
|
|
|
BOOST_CHECK_EQUAL("GROUP_BJARNE", GROUP_BJARNE1->name());
|
2013-11-14 16:08:10 +01:00
|
|
|
|
2013-11-18 15:28:58 +01:00
|
|
|
BOOST_CHECK(root1->hasChildGroup("GROUP_ODD"));
|
|
|
|
|
GroupTreeNodePtr GROUP_ODD1 = root1->getChildGroup("GROUP_ODD");
|
|
|
|
|
BOOST_CHECK_EQUAL("GROUP_ODD", GROUP_ODD1->name());
|
2013-11-14 16:08:10 +01:00
|
|
|
|
2013-11-18 15:28:58 +01:00
|
|
|
// - from GRUPTREE
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2013-11-18 15:28:58 +01:00
|
|
|
BOOST_CHECK(GROUP_BJARNE1->hasChildGroup("GROUP_BIRGER"));
|
|
|
|
|
GroupTreeNodePtr GROUP_BIRGER = GROUP_BJARNE1->getChildGroup("GROUP_BIRGER");
|
|
|
|
|
BOOST_CHECK_EQUAL("GROUP_BIRGER", GROUP_BIRGER->name());
|
2013-11-14 16:08:10 +01:00
|
|
|
|
2013-11-18 15:28:58 +01:00
|
|
|
BOOST_CHECK(root1->hasChildGroup("GROUP_NEW"));
|
|
|
|
|
GroupTreeNodePtr GROUP_NEW = root1->getChildGroup("GROUP_NEW");
|
|
|
|
|
BOOST_CHECK_EQUAL("GROUP_NEW", GROUP_NEW->name());
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2013-11-18 15:28:58 +01:00
|
|
|
BOOST_CHECK(GROUP_NEW->hasChildGroup("GROUP_NILS"));
|
|
|
|
|
GroupTreeNodePtr GROUP_NILS = GROUP_NEW->getChildGroup("GROUP_NILS");
|
|
|
|
|
BOOST_CHECK_EQUAL("GROUP_NILS", GROUP_NILS->name());
|
2014-05-08 16:56:19 +02:00
|
|
|
}
|
2013-11-14 16:08:10 +01:00
|
|
|
|
2013-11-20 13:48:55 +01:00
|
|
|
BOOST_AUTO_TEST_CASE(GroupTreeTest_GRUPTREE_WITH_REPARENT_correct_tree) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2013-11-20 13:48:55 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_GROUPS_REPARENT");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(10,10,3);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr schedule(new Schedule(parseMode , grid , deck, ioConfig));
|
2013-11-20 13:48:55 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
// Time , from first GRUPTREE
|
|
|
|
|
GroupTreeNodePtr root0 = schedule->getGroupTree(0)->getNode("FIELD");
|
|
|
|
|
BOOST_REQUIRE_EQUAL("FIELD", root0->name());
|
|
|
|
|
BOOST_CHECK(root0->hasChildGroup("GROUP_BJARNE"));
|
|
|
|
|
GroupTreeNodePtr GROUP_BJARNE0 = root0->getChildGroup("GROUP_BJARNE");
|
|
|
|
|
BOOST_CHECK_EQUAL("GROUP_BJARNE", GROUP_BJARNE0->name());
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK(root0->hasChildGroup("GROUP_NEW"));
|
|
|
|
|
GroupTreeNodePtr GROUP_NEW0 = root0->getChildGroup("GROUP_NEW");
|
|
|
|
|
BOOST_CHECK_EQUAL("GROUP_NEW", GROUP_NEW0->name());
|
|
|
|
|
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2013-11-20 13:48:55 +01:00
|
|
|
BOOST_CHECK(GROUP_BJARNE0->hasChildGroup("GROUP_BIRGER"));
|
|
|
|
|
GroupTreeNodePtr GROUP_BIRGER0 = GROUP_BJARNE0->getChildGroup("GROUP_BIRGER");
|
|
|
|
|
BOOST_CHECK_EQUAL("GROUP_BIRGER", GROUP_BIRGER0->name());
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK(GROUP_NEW0->hasChildGroup("GROUP_NILS"));
|
|
|
|
|
GroupTreeNodePtr GROUP_NILS0 = GROUP_NEW0->getChildGroup("GROUP_NILS");
|
|
|
|
|
BOOST_CHECK_EQUAL("GROUP_NILS", GROUP_NILS0->name());
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2013-11-20 13:48:55 +01:00
|
|
|
// SÅ den nye strukturen med et barneflytt
|
2014-05-08 16:56:19 +02:00
|
|
|
}
|
2013-11-20 13:48:55 +01:00
|
|
|
|
|
|
|
|
|
2013-11-18 15:28:58 +01:00
|
|
|
BOOST_AUTO_TEST_CASE(GroupTreeTest_PrintGrouptree) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2013-11-18 15:28:58 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_WELSPECS_GROUPS");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(10,10,3);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched(new Schedule(parseMode , grid , deck, ioConfig));
|
2013-11-14 16:08:10 +01:00
|
|
|
|
2013-11-18 15:28:58 +01:00
|
|
|
GroupTreePtr rootNode = sched->getGroupTree(0);
|
2014-08-25 11:54:03 +02:00
|
|
|
rootNode->printTree(std::cout);
|
2013-11-14 16:08:10 +01:00
|
|
|
|
2013-11-18 15:28:58 +01:00
|
|
|
}
|
2013-11-14 16:08:10 +01:00
|
|
|
|
|
|
|
|
|
2013-11-18 16:06:50 +01:00
|
|
|
BOOST_AUTO_TEST_CASE( WellTestGroups ) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2013-11-18 16:06:50 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_GROUPS");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(10,10,3);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched( new Schedule(parseMode , grid , deck, ioConfig));
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2013-11-18 16:06:50 +01:00
|
|
|
BOOST_CHECK_EQUAL( 3U , sched->numGroups() );
|
|
|
|
|
BOOST_CHECK( sched->hasGroup( "INJ" ));
|
|
|
|
|
BOOST_CHECK( sched->hasGroup( "OP" ));
|
|
|
|
|
|
2013-11-20 17:07:49 +01:00
|
|
|
{
|
|
|
|
|
GroupPtr group = sched->getGroup("INJ");
|
2014-01-28 08:18:03 +01:00
|
|
|
BOOST_CHECK_EQUAL( Phase::WATER , group->getInjectionPhase( 3 ));
|
2013-11-20 17:07:49 +01:00
|
|
|
BOOST_CHECK_EQUAL( GroupInjection::VREP , group->getInjectionControlMode( 3 ));
|
2013-12-16 17:23:46 +01:00
|
|
|
BOOST_CHECK_CLOSE( 10/Metric::Time , group->getSurfaceMaxRate( 3 ) , 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE( 20/Metric::Time , group->getReservoirMaxRate( 3 ) , 0.001);
|
2013-11-20 17:07:49 +01:00
|
|
|
BOOST_CHECK_EQUAL( 0.75 , group->getTargetReinjectFraction( 3 ));
|
|
|
|
|
BOOST_CHECK_EQUAL( 0.95 , group->getTargetVoidReplacementFraction( 3 ));
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2014-01-28 08:18:03 +01:00
|
|
|
BOOST_CHECK_EQUAL( Phase::OIL , group->getInjectionPhase( 6 ));
|
2013-11-20 17:07:49 +01:00
|
|
|
BOOST_CHECK_EQUAL( GroupInjection::RATE , group->getInjectionControlMode( 6 ));
|
2013-12-16 17:23:46 +01:00
|
|
|
BOOST_CHECK_CLOSE( 1000/Metric::Time , group->getSurfaceMaxRate( 6 ) , 0.0001);
|
2014-02-10 15:29:59 +01:00
|
|
|
|
|
|
|
|
BOOST_CHECK(group->isInjectionGroup(3));
|
2013-11-20 17:07:49 +01:00
|
|
|
}
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2013-11-20 17:07:49 +01:00
|
|
|
{
|
|
|
|
|
GroupPtr group = sched->getGroup("OP");
|
|
|
|
|
BOOST_CHECK_EQUAL( GroupProduction::ORAT , group->getProductionControlMode(3));
|
2013-12-16 17:23:46 +01:00
|
|
|
BOOST_CHECK_CLOSE( 10/Metric::Time , group->getOilTargetRate(3) , 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE( 20/Metric::Time , group->getWaterTargetRate(3) , 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE( 30/Metric::Time , group->getGasTargetRate(3) , 0.001);
|
|
|
|
|
BOOST_CHECK_CLOSE( 40/Metric::Time , group->getLiquidTargetRate(3) , 0.001);
|
2014-02-10 15:29:59 +01:00
|
|
|
|
|
|
|
|
BOOST_CHECK(group->isProductionGroup(3));
|
2013-11-20 17:07:49 +01:00
|
|
|
}
|
|
|
|
|
|
2013-11-18 16:06:50 +01:00
|
|
|
}
|
2013-11-14 16:08:10 +01:00
|
|
|
|
2013-11-26 12:48:20 +01:00
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE( WellTestGroupAndWellRelation ) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2013-11-26 12:48:20 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_WELLS_AND_GROUPS");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(10,10,3);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched( new Schedule(parseMode , grid , deck, ioConfig));
|
2013-11-26 12:48:20 +01:00
|
|
|
|
|
|
|
|
GroupPtr group1 = sched->getGroup("GROUP1");
|
|
|
|
|
GroupPtr group2 = sched->getGroup("GROUP2");
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2013-11-26 12:48:20 +01:00
|
|
|
BOOST_CHECK( group1->hasBeenDefined(0) );
|
|
|
|
|
BOOST_CHECK_EQUAL(false , group2->hasBeenDefined(0));
|
|
|
|
|
BOOST_CHECK( group2->hasBeenDefined(1));
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL( true , group1->hasWell("W_1" , 0));
|
|
|
|
|
BOOST_CHECK_EQUAL( true , group1->hasWell("W_2" , 0));
|
|
|
|
|
BOOST_CHECK_EQUAL( false, group2->hasWell("W_1" , 0));
|
|
|
|
|
BOOST_CHECK_EQUAL( false, group2->hasWell("W_2" , 0));
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2013-11-26 12:48:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL( true , group1->hasWell("W_1" , 1));
|
|
|
|
|
BOOST_CHECK_EQUAL( false , group1->hasWell("W_2" , 1));
|
|
|
|
|
BOOST_CHECK_EQUAL( false , group2->hasWell("W_1" , 1));
|
|
|
|
|
BOOST_CHECK_EQUAL( true , group2->hasWell("W_2" , 1));
|
|
|
|
|
}
|
|
|
|
|
|
2014-01-20 14:52:30 +01:00
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WellTestWELSPECSDataLoaded) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2014-01-20 14:52:30 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_WELLS2");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-27 10:39:39 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(40,60,30);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched(new Schedule(parseMode , grid , deck, ioConfig));
|
2014-01-20 14:52:30 +01:00
|
|
|
|
2015-01-26 11:34:28 +01:00
|
|
|
BOOST_CHECK_EQUAL(4U, sched->numWells());
|
2014-01-20 14:52:30 +01:00
|
|
|
BOOST_CHECK(sched->hasWell("W_1"));
|
|
|
|
|
BOOST_CHECK(sched->hasWell("W_2"));
|
|
|
|
|
BOOST_CHECK(sched->hasWell("W_3"));
|
|
|
|
|
{
|
|
|
|
|
WellConstPtr well1 = sched->getWell("W_1");
|
|
|
|
|
BOOST_CHECK(!well1->hasBeenDefined(2));
|
|
|
|
|
BOOST_CHECK(well1->hasBeenDefined(3));
|
2014-01-29 11:48:02 +01:00
|
|
|
BOOST_CHECK_EQUAL(29, well1->getHeadI());
|
|
|
|
|
BOOST_CHECK_EQUAL(36, well1->getHeadJ());
|
2014-01-20 14:52:30 +01:00
|
|
|
|
|
|
|
|
WellConstPtr well2 = sched->getWell("W_2");
|
|
|
|
|
BOOST_CHECK(!well2->hasBeenDefined(2));
|
|
|
|
|
BOOST_CHECK(well2->hasBeenDefined(3));
|
2014-01-29 11:48:02 +01:00
|
|
|
BOOST_CHECK_EQUAL(19, well2->getHeadI());
|
|
|
|
|
BOOST_CHECK_EQUAL(50, well2->getHeadJ());
|
2014-01-20 14:52:30 +01:00
|
|
|
|
|
|
|
|
WellConstPtr well3 = sched->getWell("W_3");
|
|
|
|
|
BOOST_CHECK(!well3->hasBeenDefined(2));
|
|
|
|
|
BOOST_CHECK(well3->hasBeenDefined(3));
|
2014-01-29 11:48:02 +01:00
|
|
|
BOOST_CHECK_EQUAL(30, well3->getHeadI());
|
|
|
|
|
BOOST_CHECK_EQUAL(17, well3->getHeadJ());
|
2014-01-20 14:52:30 +01:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WellTestWELSPECS_InvalidConfig_Throws) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2014-01-20 14:52:30 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_WELL_INVALID_WELSPECS");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(10,10,3);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
BOOST_CHECK_THROW(new Schedule(parseMode , grid , deck, ioConfig), std::invalid_argument);
|
2014-01-20 14:52:30 +01:00
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2015-01-26 00:09:13 +01:00
|
|
|
/*
|
2014-02-04 16:12:49 +01:00
|
|
|
BOOST_AUTO_TEST_CASE(WellTestWELOPEN_ConfigWithIndexes_Throws) {
|
|
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_WELOPEN_INVALID");
|
|
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string());
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(10,10,3);
|
|
|
|
|
BOOST_CHECK_THROW(new Schedule(grid , deck), std::logic_error);
|
2014-02-04 16:12:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WellTestWELOPENControlsSet) {
|
|
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_WELOPEN");
|
|
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string());
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>( 10,10,10 );
|
2015-01-25 23:48:48 +01:00
|
|
|
ScheduleConstPtr sched(new Schedule(grid , deck));
|
2014-02-04 16:12:49 +01:00
|
|
|
|
|
|
|
|
WellConstPtr well1 = sched->getWell("W_1");
|
|
|
|
|
BOOST_CHECK_EQUAL(WellCommon::StatusEnum::OPEN, sched->getWell("W_1")->getStatus(0));
|
|
|
|
|
BOOST_CHECK_EQUAL(WellCommon::StatusEnum::SHUT, sched->getWell("W_1")->getStatus(1));
|
|
|
|
|
BOOST_CHECK_EQUAL(WellCommon::StatusEnum::OPEN, sched->getWell("W_1")->getStatus(2));
|
|
|
|
|
BOOST_CHECK_EQUAL(WellCommon::StatusEnum::STOP, sched->getWell("W_1")->getStatus(3));
|
|
|
|
|
BOOST_CHECK_EQUAL(WellCommon::StatusEnum::AUTO, sched->getWell("W_1")->getStatus(4));
|
|
|
|
|
BOOST_CHECK_EQUAL(WellCommon::StatusEnum::STOP, sched->getWell("W_1")->getStatus(5));
|
|
|
|
|
}
|
2015-01-26 00:09:13 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
2014-02-04 16:12:49 +01:00
|
|
|
|
2014-02-17 16:10:31 +01:00
|
|
|
BOOST_AUTO_TEST_CASE(WellTestWGRUPCONWellPropertiesSet) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2014-02-17 16:10:31 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_WGRUPCON");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>( 10,10,10 );
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched(new Schedule(parseMode , grid , deck, ioConfig));
|
2015-01-25 23:48:48 +01:00
|
|
|
|
2014-02-17 16:10:31 +01:00
|
|
|
WellConstPtr well1 = sched->getWell("W_1");
|
|
|
|
|
BOOST_CHECK(well1->isAvailableForGroupControl(0));
|
2014-02-19 15:43:42 +01:00
|
|
|
BOOST_CHECK_EQUAL(-1, well1->getGuideRate(0));
|
2014-02-21 12:48:36 +01:00
|
|
|
BOOST_CHECK_EQUAL(GuideRate::OIL, well1->getGuideRatePhase(0));
|
|
|
|
|
BOOST_CHECK_EQUAL(1.0, well1->getGuideRateScalingFactor(0));
|
2014-02-19 15:43:42 +01:00
|
|
|
|
2014-02-17 16:10:31 +01:00
|
|
|
WellConstPtr well2 = sched->getWell("W_2");
|
|
|
|
|
BOOST_CHECK(!well2->isAvailableForGroupControl(0));
|
2014-02-21 12:48:36 +01:00
|
|
|
BOOST_CHECK_EQUAL(-1, well2->getGuideRate(0));
|
|
|
|
|
BOOST_CHECK_EQUAL(GuideRate::UNDEFINED, well2->getGuideRatePhase(0));
|
|
|
|
|
BOOST_CHECK_EQUAL(1.0, well2->getGuideRateScalingFactor(0));
|
2014-02-19 15:43:42 +01:00
|
|
|
|
2014-02-17 16:10:31 +01:00
|
|
|
WellConstPtr well3 = sched->getWell("W_3");
|
|
|
|
|
BOOST_CHECK(well3->isAvailableForGroupControl(0));
|
2014-02-19 15:43:42 +01:00
|
|
|
BOOST_CHECK_EQUAL(100, well3->getGuideRate(0));
|
2014-02-21 12:48:36 +01:00
|
|
|
BOOST_CHECK_EQUAL(GuideRate::RAT, well3->getGuideRatePhase(0));
|
|
|
|
|
BOOST_CHECK_EQUAL(0.5, well3->getGuideRateScalingFactor(0));
|
2014-02-17 16:10:31 +01:00
|
|
|
}
|
2014-02-04 16:12:49 +01:00
|
|
|
|
2014-03-27 15:41:19 +01:00
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(TestDefaultedCOMPDATIJ) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2014-03-27 15:41:19 +01:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
const char * deckString = "\n\
|
|
|
|
|
START\n\
|
|
|
|
|
\n\
|
|
|
|
|
10 MAI 2007 /\n\
|
|
|
|
|
\n\
|
|
|
|
|
SCHEDULE\n\
|
|
|
|
|
WELSPECS \n\
|
|
|
|
|
'W1' 'OP' 11 21 3.33 'OIL' 7* / \n\
|
|
|
|
|
/\n\
|
|
|
|
|
COMPDAT \n\
|
|
|
|
|
'W1' 2* 1 1 'OPEN' 1* 32.948 0.311 3047.839 2* 'X' 22.100 /\n\
|
|
|
|
|
/\n";
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseString(deckString, parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>( 30,30,10 );
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched(new Schedule(parseMode , grid , deck, ioConfig));
|
2014-03-27 15:41:19 +01:00
|
|
|
WellConstPtr well = sched->getWell("W1");
|
|
|
|
|
CompletionSetConstPtr completions = well->getCompletions(0);
|
|
|
|
|
BOOST_CHECK_EQUAL( 10 , completions->get(0)->getI() );
|
|
|
|
|
BOOST_CHECK_EQUAL( 20 , completions->get(0)->getJ() );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2014-08-25 13:57:51 +02:00
|
|
|
/**
|
|
|
|
|
This is a deck used in the opm-core wellsManager testing; just be
|
|
|
|
|
certain we can parse it.
|
|
|
|
|
*/
|
|
|
|
|
BOOST_AUTO_TEST_CASE(OpmCode) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2014-08-25 13:57:51 +02:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/wells_group.data");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-26 00:09:13 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(10,10,3);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
BOOST_CHECK_NO_THROW( new Schedule(parseMode , grid , deck, ioConfig) );
|
2014-10-14 16:59:35 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WELLS_SHUT) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2014-10-14 16:59:35 +02:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_SHUT_WELL");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-27 10:39:39 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>( 20,40,1 );
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched(new Schedule(parseMode , grid , deck, ioConfig));
|
2015-01-25 23:48:48 +01:00
|
|
|
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2014-10-14 16:59:35 +02:00
|
|
|
WellConstPtr well1 = sched->getWell("W1");
|
|
|
|
|
WellConstPtr well2 = sched->getWell("W2");
|
|
|
|
|
WellConstPtr well3 = sched->getWell("W3");
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL( WellCommon::StatusEnum::OPEN , well1->getStatus(1));
|
|
|
|
|
BOOST_CHECK_EQUAL( WellCommon::StatusEnum::OPEN , well2->getStatus(1));
|
|
|
|
|
BOOST_CHECK_EQUAL( WellCommon::StatusEnum::OPEN , well3->getStatus(1));
|
|
|
|
|
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2014-10-14 16:59:35 +02:00
|
|
|
BOOST_CHECK_EQUAL( WellCommon::StatusEnum::SHUT , well1->getStatus(2));
|
|
|
|
|
BOOST_CHECK_EQUAL( WellCommon::StatusEnum::SHUT , well2->getStatus(2));
|
|
|
|
|
BOOST_CHECK_EQUAL( WellCommon::StatusEnum::SHUT , well3->getStatus(2));
|
2014-08-25 13:57:51 +02:00
|
|
|
}
|
2015-01-26 00:09:13 +01:00
|
|
|
|
2014-08-25 13:57:51 +02:00
|
|
|
|
2014-11-21 13:21:24 +08:00
|
|
|
BOOST_AUTO_TEST_CASE(WellTestWPOLYMER) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2014-11-21 13:21:24 +08:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_POLYMER");
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-01-25 23:48:48 +01:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>( 30,30,30);
|
2015-05-24 14:37:37 +02:00
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched(new Schedule(parseMode , grid , deck, ioConfig));
|
2015-01-25 23:48:48 +01:00
|
|
|
|
2014-11-21 13:21:24 +08:00
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(4U, sched->numWells());
|
|
|
|
|
BOOST_CHECK(sched->hasWell("INJE01"));
|
|
|
|
|
BOOST_CHECK(sched->hasWell("PROD01"));
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2014-11-21 13:21:24 +08:00
|
|
|
WellConstPtr well1 = sched->getWell("INJE01");
|
|
|
|
|
BOOST_CHECK( well1->isInjector(0));
|
|
|
|
|
{
|
|
|
|
|
const WellPolymerProperties& props_well10 = well1->getPolymerProperties(0);
|
|
|
|
|
BOOST_CHECK_CLOSE(1.5*Metric::PolymerDensity, props_well10.m_polymerConcentration, 0.0001);
|
|
|
|
|
const WellPolymerProperties& props_well11 = well1->getPolymerProperties(1);
|
|
|
|
|
BOOST_CHECK_CLOSE(1.0*Metric::PolymerDensity, props_well11.m_polymerConcentration, 0.0001);
|
|
|
|
|
const WellPolymerProperties& props_well12 = well1->getPolymerProperties(2);
|
|
|
|
|
BOOST_CHECK_CLOSE(0.1*Metric::PolymerDensity, props_well12.m_polymerConcentration, 0.0001);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WellConstPtr well2 = sched->getWell("INJE02");
|
|
|
|
|
BOOST_CHECK( well2->isInjector(0));
|
|
|
|
|
{
|
|
|
|
|
const WellPolymerProperties& props_well20 = well2->getPolymerProperties(0);
|
|
|
|
|
BOOST_CHECK_CLOSE(2.0*Metric::PolymerDensity, props_well20.m_polymerConcentration, 0.0001);
|
|
|
|
|
const WellPolymerProperties& props_well21 = well2->getPolymerProperties(1);
|
|
|
|
|
BOOST_CHECK_CLOSE(1.5*Metric::PolymerDensity, props_well21.m_polymerConcentration, 0.0001);
|
|
|
|
|
const WellPolymerProperties& props_well22 = well2->getPolymerProperties(2);
|
|
|
|
|
BOOST_CHECK_CLOSE(0.2*Metric::PolymerDensity, props_well22.m_polymerConcentration, 0.0001);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
WellConstPtr well3 = sched->getWell("INJE03");
|
|
|
|
|
BOOST_CHECK( well3->isInjector(0));
|
|
|
|
|
{
|
|
|
|
|
const WellPolymerProperties& props_well30 = well3->getPolymerProperties(0);
|
|
|
|
|
BOOST_CHECK_CLOSE(2.5*Metric::PolymerDensity, props_well30.m_polymerConcentration, 0.0001);
|
|
|
|
|
const WellPolymerProperties& props_well31 = well3->getPolymerProperties(1);
|
|
|
|
|
BOOST_CHECK_CLOSE(2.0*Metric::PolymerDensity, props_well31.m_polymerConcentration, 0.0001);
|
|
|
|
|
const WellPolymerProperties& props_well32 = well3->getPolymerProperties(2);
|
|
|
|
|
BOOST_CHECK_CLOSE(0.3*Metric::PolymerDensity, props_well32.m_polymerConcentration, 0.0001);
|
|
|
|
|
}
|
|
|
|
|
}
|
2015-06-23 14:20:31 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(TestEvents) {
|
2015-07-26 23:13:49 +02:00
|
|
|
ParseMode parseMode;
|
2015-06-23 14:20:31 +02:00
|
|
|
ParserPtr parser(new Parser());
|
|
|
|
|
boost::filesystem::path scheduleFile("testdata/integration_tests/SCHEDULE/SCHEDULE_EVENTS");
|
|
|
|
|
|
2015-07-26 23:13:49 +02:00
|
|
|
DeckPtr deck = parser->parseFile(scheduleFile.string(), parseMode);
|
2015-06-23 14:20:31 +02:00
|
|
|
std::shared_ptr<const EclipseGrid> grid = std::make_shared<const EclipseGrid>(40,40,30);
|
|
|
|
|
IOConfigPtr ioConfig;
|
2015-07-26 23:13:49 +02:00
|
|
|
ScheduleConstPtr sched(new Schedule(parseMode , grid , deck, ioConfig));
|
2015-06-23 14:20:31 +02:00
|
|
|
const Events& events = sched->getEvents();
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL( true , events.hasEvent(ScheduleEvents::NEW_WELL , 0 ) );
|
|
|
|
|
BOOST_CHECK_EQUAL( false , events.hasEvent(ScheduleEvents::NEW_WELL , 1 ) );
|
|
|
|
|
BOOST_CHECK_EQUAL( true , events.hasEvent(ScheduleEvents::NEW_WELL , 2 ) );
|
|
|
|
|
BOOST_CHECK_EQUAL( false , events.hasEvent(ScheduleEvents::NEW_WELL , 3 ) );
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL( true , events.hasEvent(ScheduleEvents::COMPLETION_CHANGE , 0 ) );
|
|
|
|
|
BOOST_CHECK_EQUAL( false , events.hasEvent(ScheduleEvents::COMPLETION_CHANGE , 1) );
|
|
|
|
|
BOOST_CHECK_EQUAL( true , events.hasEvent(ScheduleEvents::COMPLETION_CHANGE , 5 ) );
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL( true , events.hasEvent(ScheduleEvents::WELL_STATUS_CHANGE , 1 ));
|
|
|
|
|
BOOST_CHECK_EQUAL( false , events.hasEvent(ScheduleEvents::WELL_STATUS_CHANGE , 2 ));
|
|
|
|
|
BOOST_CHECK_EQUAL( true , events.hasEvent(ScheduleEvents::WELL_STATUS_CHANGE , 3 ));
|
|
|
|
|
BOOST_CHECK_EQUAL( true , events.hasEvent(ScheduleEvents::COMPLETION_CHANGE , 5) );
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL( true , events.hasEvent(ScheduleEvents::GROUP_CHANGE , 0 ));
|
|
|
|
|
BOOST_CHECK_EQUAL( false , events.hasEvent(ScheduleEvents::GROUP_CHANGE , 1 ));
|
|
|
|
|
BOOST_CHECK_EQUAL( true , events.hasEvent(ScheduleEvents::GROUP_CHANGE , 3 ) );
|
|
|
|
|
BOOST_CHECK_EQUAL( false , events.hasEvent(ScheduleEvents::NEW_GROUP , 2 ) );
|
|
|
|
|
BOOST_CHECK_EQUAL( true , events.hasEvent(ScheduleEvents::NEW_GROUP , 3 ) );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|