2013-11-05 12:55:03 +01: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/>.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <stdexcept>
|
|
|
|
|
#include <iostream>
|
|
|
|
|
#include <boost/filesystem.hpp>
|
|
|
|
|
|
|
|
|
|
#define BOOST_TEST_MODULE WellTest
|
|
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
|
#include <boost/date_time/posix_time/posix_time.hpp>
|
|
|
|
|
|
2016-10-10 15:41:19 +02:00
|
|
|
#include <opm/parser/eclipse/Units/Units.hpp>
|
2019-06-08 12:25:29 +02:00
|
|
|
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
|
2015-01-26 16:40:13 +01:00
|
|
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
2016-02-09 12:09:40 +01:00
|
|
|
#include <opm/parser/eclipse/Deck/DeckItem.hpp>
|
2014-01-20 14:52:30 +01:00
|
|
|
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
|
2013-11-05 12:55:03 +01:00
|
|
|
|
2015-01-26 16:40:13 +01:00
|
|
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
2015-08-28 16:21:14 +02:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
|
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
2019-05-09 17:03:29 +02:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
|
2014-01-28 14:31:51 +01:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
2019-03-08 07:12:07 +01:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Connection.hpp>
|
|
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.hpp>
|
2013-11-05 15:25:47 +01:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp>
|
2016-03-16 17:15:09 +08:00
|
|
|
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
2015-01-26 16:40:13 +01:00
|
|
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
|
|
|
|
|
2019-05-19 15:39:03 +02:00
|
|
|
#include "src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp"
|
|
|
|
|
#include "src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp"
|
|
|
|
|
|
2016-11-29 15:46:55 +01:00
|
|
|
using namespace Opm;
|
|
|
|
|
|
2013-11-08 09:14:57 +01:00
|
|
|
|
2016-10-12 16:30:06 +02:00
|
|
|
namespace Opm {
|
2018-06-08 16:23:03 +02:00
|
|
|
inline std::ostream& operator<<( std::ostream& stream, const Connection& c ) {
|
2016-10-12 16:30:06 +02:00
|
|
|
return stream << "(" << c.getI() << "," << c.getJ() << "," << c.getK() << ")";
|
|
|
|
|
}
|
2019-05-04 12:00:32 +02:00
|
|
|
inline std::ostream& operator<<( std::ostream& stream, const Well2& well ) {
|
2017-01-09 14:09:34 +01:00
|
|
|
return stream << "(" << well.name() << ")";
|
|
|
|
|
}
|
2016-10-12 16:30:06 +02:00
|
|
|
}
|
|
|
|
|
|
2013-11-08 23:20:09 +01:00
|
|
|
|
2015-08-28 16:21:14 +02:00
|
|
|
BOOST_AUTO_TEST_CASE(WellCOMPDATtestTRACK) {
|
|
|
|
|
Opm::Parser parser;
|
|
|
|
|
std::string input =
|
|
|
|
|
"START -- 0 \n"
|
|
|
|
|
"19 JUN 2007 / \n"
|
|
|
|
|
"SCHEDULE\n"
|
|
|
|
|
"DATES -- 1\n"
|
|
|
|
|
" 10 OKT 2008 / \n"
|
|
|
|
|
"/\n"
|
|
|
|
|
"WELSPECS\n"
|
|
|
|
|
" 'OP_1' 'OP' 9 9 1* 'OIL' 1* 1* 1* 1* 1* 1* 1* / \n"
|
|
|
|
|
"/\n"
|
|
|
|
|
"COMPORD\n"
|
|
|
|
|
" OP_1 TRACK / \n"
|
|
|
|
|
"/\n"
|
|
|
|
|
"COMPDAT\n"
|
|
|
|
|
" 'OP_1' 9 9 1 1 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / \n"
|
|
|
|
|
" 'OP_1' 9 9 3 9 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / \n"
|
|
|
|
|
" 'OP_1' 9 9 2 2 'OPEN' 1* 46.825 0.311 4332.346 1* 1* 'X' 22.123 / \n"
|
|
|
|
|
"/\n"
|
|
|
|
|
"DATES -- 2\n"
|
|
|
|
|
" 20 JAN 2010 / \n"
|
|
|
|
|
"/\n";
|
|
|
|
|
|
|
|
|
|
|
2019-01-03 18:05:19 +01:00
|
|
|
auto deck = parser.parseString(input);
|
2016-09-08 19:42:45 +02:00
|
|
|
Opm::EclipseGrid grid(10,10,10);
|
2017-02-15 11:13:29 +01:00
|
|
|
TableManager table ( deck );
|
|
|
|
|
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
2018-10-17 13:35:25 +02:00
|
|
|
Opm::Runspec runspec (deck);
|
2019-01-03 18:05:19 +01:00
|
|
|
Opm::Schedule schedule(deck, grid , eclipseProperties, runspec);
|
2019-05-04 12:00:32 +02:00
|
|
|
const auto& op_1 = schedule.getWell2("OP_1", 2);
|
2015-08-28 16:21:14 +02:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
const auto& completions = op_1.getConnections();
|
2016-10-12 16:30:06 +02:00
|
|
|
BOOST_CHECK_EQUAL(9U, completions.size());
|
2015-08-28 16:21:14 +02:00
|
|
|
|
|
|
|
|
//Verify TRACK completion ordering
|
2016-10-12 16:30:06 +02:00
|
|
|
for (size_t k = 0; k < completions.size(); ++k) {
|
|
|
|
|
BOOST_CHECK_EQUAL(completions.get( k ).getK(), k);
|
2015-08-28 16:21:14 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WellCOMPDATtestDefaultTRACK) {
|
|
|
|
|
Opm::Parser parser;
|
|
|
|
|
std::string input =
|
|
|
|
|
"START -- 0 \n"
|
|
|
|
|
"19 JUN 2007 / \n"
|
|
|
|
|
"SCHEDULE\n"
|
|
|
|
|
"DATES -- 1\n"
|
|
|
|
|
" 10 OKT 2008 / \n"
|
|
|
|
|
"/\n"
|
|
|
|
|
"WELSPECS\n"
|
|
|
|
|
" 'OP_1' 'OP' 9 9 1* 'OIL' 1* 1* 1* 1* 1* 1* 1* / \n"
|
|
|
|
|
"/\n"
|
|
|
|
|
"COMPDAT\n"
|
|
|
|
|
" 'OP_1' 9 9 1 1 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / \n"
|
|
|
|
|
" 'OP_1' 9 9 3 9 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / \n"
|
|
|
|
|
" 'OP_1' 9 9 2 2 'OPEN' 1* 46.825 0.311 4332.346 1* 1* 'X' 22.123 / \n"
|
|
|
|
|
"/\n"
|
|
|
|
|
"DATES -- 2\n"
|
|
|
|
|
" 20 JAN 2010 / \n"
|
|
|
|
|
"/\n";
|
|
|
|
|
|
|
|
|
|
|
2019-01-03 18:05:19 +01:00
|
|
|
auto deck = parser.parseString(input);
|
2016-09-08 19:42:45 +02:00
|
|
|
Opm::EclipseGrid grid(10,10,10);
|
2017-02-15 11:13:29 +01:00
|
|
|
TableManager table ( deck );
|
|
|
|
|
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
2018-10-17 13:35:25 +02:00
|
|
|
Opm::Runspec runspec (deck);
|
2019-01-03 18:05:19 +01:00
|
|
|
Opm::Schedule schedule(deck, grid , eclipseProperties, runspec);
|
2019-05-04 12:00:32 +02:00
|
|
|
const auto& op_1 = schedule.getWell2("OP_1", 2);
|
2015-08-28 16:21:14 +02:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
const auto& completions = op_1.getConnections();
|
2016-10-12 16:30:06 +02:00
|
|
|
BOOST_CHECK_EQUAL(9U, completions.size());
|
2015-08-28 16:21:14 +02:00
|
|
|
|
|
|
|
|
//Verify TRACK completion ordering
|
2016-10-12 16:30:06 +02:00
|
|
|
for (size_t k = 0; k < completions.size(); ++k) {
|
|
|
|
|
BOOST_CHECK_EQUAL(completions.get( k ).getK(), k);
|
2015-08-28 16:21:14 +02:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WellCOMPDATtestINPUT) {
|
|
|
|
|
Opm::Parser parser;
|
|
|
|
|
std::string input =
|
|
|
|
|
"START -- 0 \n"
|
|
|
|
|
"19 JUN 2007 / \n"
|
|
|
|
|
"SCHEDULE\n"
|
|
|
|
|
"DATES -- 1\n"
|
|
|
|
|
" 10 OKT 2008 / \n"
|
|
|
|
|
"/\n"
|
|
|
|
|
"WELSPECS\n"
|
|
|
|
|
" 'OP_1' 'OP' 9 9 1* 'OIL' 1* 1* 1* 1* 1* 1* 1* / \n"
|
|
|
|
|
"/\n"
|
|
|
|
|
"COMPORD\n"
|
|
|
|
|
" OP_1 INPUT / \n"
|
|
|
|
|
"/\n"
|
|
|
|
|
"COMPDAT\n"
|
|
|
|
|
" 'OP_1' 9 9 1 1 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / \n"
|
|
|
|
|
" 'OP_1' 9 9 3 9 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 / \n"
|
|
|
|
|
" 'OP_1' 9 9 2 2 'OPEN' 1* 46.825 0.311 4332.346 1* 1* 'X' 22.123 / \n"
|
|
|
|
|
"/\n"
|
|
|
|
|
"DATES -- 2\n"
|
|
|
|
|
" 20 JAN 2010 / \n"
|
|
|
|
|
"/\n";
|
|
|
|
|
|
|
|
|
|
|
2019-01-03 18:05:19 +01:00
|
|
|
auto deck = parser.parseString(input);
|
2016-09-08 19:42:45 +02:00
|
|
|
Opm::EclipseGrid grid(10,10,10);
|
2019-01-03 18:05:19 +01:00
|
|
|
Opm::ErrorGuard errors;
|
2017-02-15 11:13:29 +01:00
|
|
|
TableManager table ( deck );
|
|
|
|
|
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
2018-10-17 13:35:25 +02:00
|
|
|
Opm::Runspec runspec (deck);
|
2019-01-03 18:05:19 +01:00
|
|
|
Opm::Schedule schedule(deck, grid , eclipseProperties, runspec, Opm::ParseContext(), errors);
|
2019-05-04 12:00:32 +02:00
|
|
|
const auto& op_1 = schedule.getWell2("OP_1", 2);
|
2015-08-28 16:21:14 +02:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
const auto& completions = op_1.getConnections();
|
2016-10-12 16:30:06 +02:00
|
|
|
BOOST_CHECK_EQUAL(9U, completions.size());
|
2015-08-28 16:21:14 +02:00
|
|
|
|
|
|
|
|
//Verify INPUT completion ordering
|
2016-10-12 16:30:06 +02:00
|
|
|
BOOST_CHECK_EQUAL(completions.get( 0 ).getK(), 0);
|
|
|
|
|
BOOST_CHECK_EQUAL(completions.get( 1 ).getK(), 2);
|
|
|
|
|
BOOST_CHECK_EQUAL(completions.get( 2 ).getK(), 3);
|
|
|
|
|
BOOST_CHECK_EQUAL(completions.get( 3 ).getK(), 4);
|
|
|
|
|
BOOST_CHECK_EQUAL(completions.get( 4 ).getK(), 5);
|
|
|
|
|
BOOST_CHECK_EQUAL(completions.get( 5 ).getK(), 6);
|
|
|
|
|
BOOST_CHECK_EQUAL(completions.get( 6 ).getK(), 7);
|
|
|
|
|
BOOST_CHECK_EQUAL(completions.get( 7 ).getK(), 8);
|
|
|
|
|
BOOST_CHECK_EQUAL(completions.get( 8 ).getK(), 1);
|
2015-08-28 16:21:14 +02:00
|
|
|
}
|
2013-11-08 23:20:09 +01:00
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(NewWellZeroCompletions) {
|
2019-06-19 13:24:21 +02:00
|
|
|
Opm::Well2 well("WELL1", "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
2019-05-04 12:00:32 +02:00
|
|
|
BOOST_CHECK_EQUAL( 0U , well.getConnections( ).size() );
|
2014-01-24 13:24:22 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2013-11-11 14:35:14 +01:00
|
|
|
BOOST_AUTO_TEST_CASE(isProducerCorrectlySet) {
|
2014-03-17 14:13:02 +01:00
|
|
|
// HACK: This test checks correctly setting of isProducer/isInjector. This property depends on which of
|
|
|
|
|
// WellProductionProperties/WellInjectionProperties is set last, independent of actual values.
|
2019-06-19 13:24:21 +02:00
|
|
|
Opm::Well2 well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
2013-11-11 14:35:14 +01:00
|
|
|
|
|
|
|
|
/* 1: Well is created as producer */
|
2019-05-04 12:00:32 +02:00
|
|
|
BOOST_CHECK_EQUAL( false , well.isInjector());
|
|
|
|
|
BOOST_CHECK_EQUAL( true , well.isProducer());
|
2013-11-11 14:35:14 +01:00
|
|
|
|
2014-01-24 13:24:22 +01:00
|
|
|
/* Set a surface injection rate => Well becomes an Injector */
|
2019-05-04 12:00:32 +02:00
|
|
|
auto injectionProps1 = std::make_shared<Opm::WellInjectionProperties>(well.getInjectionProperties());
|
|
|
|
|
injectionProps1->surfaceInjectionRate = 100;
|
|
|
|
|
well.updateInjection(injectionProps1);
|
|
|
|
|
BOOST_CHECK_EQUAL( true , well.isInjector());
|
|
|
|
|
BOOST_CHECK_EQUAL( false , well.isProducer());
|
|
|
|
|
BOOST_CHECK_EQUAL( 100 , well.getInjectionProperties().surfaceInjectionRate);
|
|
|
|
|
|
|
|
|
|
{
|
2019-06-19 13:24:21 +02:00
|
|
|
Opm::Well2 well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
2019-05-04 12:00:32 +02:00
|
|
|
|
|
|
|
|
/* Set a reservoir injection rate => Well becomes an Injector */
|
|
|
|
|
auto injectionProps2 = std::make_shared<Opm::WellInjectionProperties>(well.getInjectionProperties());
|
|
|
|
|
injectionProps2->reservoirInjectionRate = 200;
|
|
|
|
|
well.updateInjection(injectionProps2);
|
|
|
|
|
BOOST_CHECK_EQUAL( true , well.isInjector());
|
|
|
|
|
BOOST_CHECK_EQUAL( false , well.isProducer());
|
|
|
|
|
BOOST_CHECK_EQUAL( 200 , well.getInjectionProperties().reservoirInjectionRate);
|
|
|
|
|
}
|
2013-11-11 14:35:14 +01:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
{
|
2019-06-19 13:24:21 +02:00
|
|
|
Opm::Well2 well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
2019-05-04 12:00:32 +02:00
|
|
|
|
|
|
|
|
/* Set rates => Well becomes a producer; injection rate should be set to 0. */
|
|
|
|
|
auto injectionProps3 = std::make_shared<Opm::WellInjectionProperties>(well.getInjectionProperties());
|
|
|
|
|
well.updateInjection(injectionProps3);
|
|
|
|
|
|
|
|
|
|
auto properties = std::make_shared<Opm::WellProductionProperties>( well.getProductionProperties() );
|
|
|
|
|
properties->OilRate = 100;
|
|
|
|
|
properties->GasRate = 200;
|
|
|
|
|
properties->WaterRate = 300;
|
|
|
|
|
well.updateProduction(properties);
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL( false , well.isInjector());
|
|
|
|
|
BOOST_CHECK_EQUAL( true , well.isProducer());
|
|
|
|
|
BOOST_CHECK_EQUAL( 0 , well.getInjectionProperties().surfaceInjectionRate);
|
|
|
|
|
BOOST_CHECK_EQUAL( 0 , well.getInjectionProperties().reservoirInjectionRate);
|
|
|
|
|
BOOST_CHECK_EQUAL( 100 , well.getProductionProperties().OilRate);
|
|
|
|
|
BOOST_CHECK_EQUAL( 200 , well.getProductionProperties().GasRate);
|
|
|
|
|
BOOST_CHECK_EQUAL( 300 , well.getProductionProperties().WaterRate);
|
|
|
|
|
}
|
|
|
|
|
}
|
2013-11-11 14:35:14 +01:00
|
|
|
|
2013-11-25 16:06:10 +01:00
|
|
|
BOOST_AUTO_TEST_CASE(GroupnameCorretlySet) {
|
2019-06-19 13:24:21 +02:00
|
|
|
Opm::Well2 well("WELL1" , "G1", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
2013-11-25 16:06:10 +01:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
BOOST_CHECK_EQUAL("G1" , well.groupName());
|
|
|
|
|
well.updateGroup( "GROUP2");
|
|
|
|
|
BOOST_CHECK_EQUAL("GROUP2" , well.groupName());
|
2013-11-25 16:06:10 +01:00
|
|
|
}
|
2014-01-20 14:52:30 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(addWELSPECS_setData_dataSet) {
|
2019-06-19 13:24:21 +02:00
|
|
|
Opm::Well2 well("WELL1", "GROUP", 0, 1, 23, 42, 2334.32, Opm::Phase::WATER, WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
2014-01-20 14:52:30 +01:00
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(23, well.getHeadI());
|
|
|
|
|
BOOST_CHECK_EQUAL(42, well.getHeadJ());
|
|
|
|
|
BOOST_CHECK_EQUAL(2334.32, well.getRefDepth());
|
2014-04-06 23:11:38 +02:00
|
|
|
BOOST_CHECK_EQUAL(Opm::Phase::WATER, well.getPreferredPhase());
|
2014-01-20 14:52:30 +01:00
|
|
|
}
|
2014-01-27 18:27:57 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(XHPLimitDefault) {
|
2019-06-19 13:24:21 +02:00
|
|
|
Opm::Well2 well("WELL1", "GROUP", 0, 1, 23, 42, 2334.32, Opm::Phase::WATER, WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
2019-05-04 12:00:32 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
auto productionProps = std::make_shared<Opm::WellProductionProperties>(well.getProductionProperties());
|
|
|
|
|
productionProps->BHPLimit = 100;
|
|
|
|
|
productionProps->addProductionControl(Opm::WellProducer::BHP);
|
|
|
|
|
well.updateProduction(productionProps);
|
|
|
|
|
BOOST_CHECK_EQUAL( 100 , well.getProductionProperties().BHPLimit);
|
|
|
|
|
BOOST_CHECK_EQUAL( true, well.getProductionProperties().hasProductionControl( Opm::WellProducer::BHP ));
|
|
|
|
|
|
|
|
|
|
auto injProps = std::make_shared<Opm::WellInjectionProperties>(well.getInjectionProperties());
|
|
|
|
|
injProps->THPLimit = 200;
|
|
|
|
|
well.updateInjection(injProps);
|
|
|
|
|
BOOST_CHECK_EQUAL( 200 , well.getInjectionProperties().THPLimit);
|
|
|
|
|
BOOST_CHECK( !well.getInjectionProperties().hasInjectionControl( Opm::WellInjector::THP ));
|
2014-01-27 18:27:57 +01:00
|
|
|
}
|
|
|
|
|
|
2014-01-28 14:31:51 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(InjectorType) {
|
2019-06-19 13:24:21 +02:00
|
|
|
Opm::Well2 well("WELL1", "GROUP", 0, 1, 23, 42, 2334.32, Opm::Phase::WATER, WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
auto injectionProps = std::make_shared<Opm::WellInjectionProperties>(well.getInjectionProperties());
|
|
|
|
|
injectionProps->injectorType = Opm::WellInjector::WATER;
|
|
|
|
|
well.updateInjection(injectionProps);
|
2014-03-12 11:21:57 +01:00
|
|
|
// TODO: Should we test for something other than water here, as long as
|
|
|
|
|
// the default value for InjectorType is WellInjector::WATER?
|
2019-05-04 12:00:32 +02:00
|
|
|
BOOST_CHECK_EQUAL( Opm::WellInjector::WATER , well.getInjectionProperties().injectorType);
|
2014-01-28 14:31:51 +01:00
|
|
|
}
|
|
|
|
|
|
2014-01-29 13:33:28 +01:00
|
|
|
|
|
|
|
|
|
2014-01-30 15:19:50 +01:00
|
|
|
/*****************************************************************/
|
|
|
|
|
|
|
|
|
|
|
2014-03-12 12:21:55 +01:00
|
|
|
BOOST_AUTO_TEST_CASE(WellHaveProductionControlLimit) {
|
2019-06-19 13:24:21 +02:00
|
|
|
Opm::Well2 well("WELL1", "GROUP", 0, 1, 23, 42, 2334.32, Opm::Phase::WATER, WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
2014-01-30 15:19:50 +01:00
|
|
|
|
2014-03-17 14:13:02 +01:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
BOOST_CHECK( !well.getProductionProperties().hasProductionControl( Opm::WellProducer::ORAT ));
|
|
|
|
|
BOOST_CHECK( !well.getProductionProperties().hasProductionControl( Opm::WellProducer::RESV ));
|
2014-03-12 12:21:55 +01:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
auto properties1 = std::make_shared<Opm::WellProductionProperties>(well.getProductionProperties());
|
|
|
|
|
properties1->OilRate = 100;
|
|
|
|
|
properties1->addProductionControl(Opm::WellProducer::ORAT);
|
|
|
|
|
well.updateProduction(properties1);
|
|
|
|
|
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::WellProducer::ORAT ));
|
|
|
|
|
BOOST_CHECK( !well.getProductionProperties().hasProductionControl( Opm::WellProducer::RESV ));
|
2014-01-30 16:31:35 +01:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
auto properties2 = std::make_shared<Opm::WellProductionProperties>(well.getProductionProperties());
|
|
|
|
|
properties2->ResVRate = 100;
|
|
|
|
|
properties2->addProductionControl(Opm::WellProducer::RESV);
|
|
|
|
|
well.updateProduction(properties2);
|
|
|
|
|
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::WellProducer::RESV ));
|
2014-03-17 14:13:02 +01:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
auto properties3 = std::make_shared<Opm::WellProductionProperties>(well.getProductionProperties());
|
|
|
|
|
properties3->OilRate = 100;
|
|
|
|
|
properties3->WaterRate = 100;
|
|
|
|
|
properties3->GasRate = 100;
|
|
|
|
|
properties3->LiquidRate = 100;
|
|
|
|
|
properties3->ResVRate = 100;
|
|
|
|
|
properties3->BHPLimit = 100;
|
|
|
|
|
properties3->THPLimit = 100;
|
|
|
|
|
properties3->addProductionControl(Opm::WellProducer::ORAT);
|
|
|
|
|
properties3->addProductionControl(Opm::WellProducer::LRAT);
|
|
|
|
|
properties3->addProductionControl(Opm::WellProducer::BHP);
|
|
|
|
|
well.updateProduction(properties3);
|
2014-02-21 12:48:36 +01:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::WellProducer::ORAT ));
|
|
|
|
|
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::WellProducer::LRAT ));
|
|
|
|
|
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::WellProducer::BHP ));
|
2014-02-21 12:48:36 +01:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
auto properties4 = std::make_shared<Opm::WellProductionProperties>(well.getProductionProperties());
|
|
|
|
|
properties4->dropProductionControl( Opm::WellProducer::LRAT );
|
|
|
|
|
well.updateProduction(properties4);
|
2014-02-21 12:48:36 +01:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::WellProducer::ORAT ));
|
|
|
|
|
BOOST_CHECK(!well.getProductionProperties().hasProductionControl( Opm::WellProducer::LRAT ));
|
|
|
|
|
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::WellProducer::BHP ));
|
2014-02-21 12:48:36 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
BOOST_AUTO_TEST_CASE(WellHaveInjectionControlLimit) {
|
2019-06-19 13:24:21 +02:00
|
|
|
Opm::Well2 well("WELL1", "GROUP", 0, 1, 23, 42, 2334.32, Opm::Phase::WATER, WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
2019-05-04 12:00:32 +02:00
|
|
|
|
|
|
|
|
BOOST_CHECK( !well.getInjectionProperties().hasInjectionControl( Opm::WellInjector::RATE ));
|
|
|
|
|
BOOST_CHECK( !well.getInjectionProperties().hasInjectionControl( Opm::WellInjector::RESV ));
|
|
|
|
|
|
|
|
|
|
auto injProps1 = std::make_shared<Opm::WellInjectionProperties>(well.getInjectionProperties());
|
|
|
|
|
injProps1->surfaceInjectionRate = 100;
|
|
|
|
|
injProps1->addInjectionControl(Opm::WellInjector::RATE);
|
|
|
|
|
well.updateInjection(injProps1);
|
|
|
|
|
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::WellInjector::RATE ));
|
|
|
|
|
BOOST_CHECK( !well.getInjectionProperties().hasInjectionControl( Opm::WellInjector::RESV ));
|
|
|
|
|
|
|
|
|
|
auto injProps2 = std::make_shared<Opm::WellInjectionProperties>(well.getInjectionProperties());
|
|
|
|
|
injProps2->reservoirInjectionRate = 100;
|
|
|
|
|
injProps2->addInjectionControl(Opm::WellInjector::RESV);
|
|
|
|
|
well.updateInjection(injProps2);
|
|
|
|
|
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::WellInjector::RESV ));
|
|
|
|
|
|
|
|
|
|
auto injProps3 = std::make_shared<Opm::WellInjectionProperties>(well.getInjectionProperties());
|
|
|
|
|
injProps3->BHPLimit = 100;
|
|
|
|
|
injProps3->addInjectionControl(Opm::WellInjector::BHP);
|
|
|
|
|
injProps3->THPLimit = 100;
|
|
|
|
|
injProps3->addInjectionControl(Opm::WellInjector::THP);
|
|
|
|
|
well.updateInjection(injProps3);
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::WellInjector::RATE ));
|
|
|
|
|
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::WellInjector::RESV ));
|
|
|
|
|
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::WellInjector::THP ));
|
|
|
|
|
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::WellInjector::BHP ));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto injProps4 = std::make_shared<Opm::WellInjectionProperties>(well.getInjectionProperties());
|
|
|
|
|
injProps4->dropInjectionControl( Opm::WellInjector::RESV );
|
|
|
|
|
well.updateInjection(injProps4);
|
|
|
|
|
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::WellInjector::RATE ));
|
|
|
|
|
BOOST_CHECK( !well.getInjectionProperties().hasInjectionControl( Opm::WellInjector::RESV ));
|
|
|
|
|
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::WellInjector::THP ));
|
|
|
|
|
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::WellInjector::BHP ));
|
2014-02-21 12:48:36 +01:00
|
|
|
}
|
2019-05-04 12:00:32 +02:00
|
|
|
/*********************************************************************/
|
2014-02-21 12:48:36 +01:00
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WellGuideRatePhase_GuideRatePhaseSet) {
|
2019-06-19 13:24:21 +02:00
|
|
|
Opm::Well2 well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
2014-02-21 12:48:36 +01:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
BOOST_CHECK_EQUAL(Opm::GuideRate::UNDEFINED, well.getGuideRatePhase());
|
2014-02-21 12:48:36 +01:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
BOOST_CHECK(well.updateWellGuideRate(true, 100, Opm::GuideRate::RAT, 66.0));
|
|
|
|
|
BOOST_CHECK_EQUAL(Opm::GuideRate::RAT, well.getGuideRatePhase());
|
|
|
|
|
BOOST_CHECK_EQUAL(100, well.getGuideRate());
|
|
|
|
|
BOOST_CHECK_EQUAL(66.0, well.getGuideRateScalingFactor());
|
2014-02-21 12:48:36 +01:00
|
|
|
}
|
2015-08-28 16:21:14 +02:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
BOOST_AUTO_TEST_CASE(WellEfficiencyFactorSet) {
|
2019-06-19 13:24:21 +02:00
|
|
|
Opm::Well2 well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
2015-08-28 16:21:14 +02:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
BOOST_CHECK_EQUAL(1.0, well.getEfficiencyFactor());
|
|
|
|
|
BOOST_CHECK( well.updateEfficiencyFactor(0.9));
|
|
|
|
|
BOOST_CHECK_EQUAL(0.9, well.getEfficiencyFactor());
|
2015-08-28 16:21:14 +02:00
|
|
|
}
|
2017-05-24 14:48:27 +02:00
|
|
|
|
2019-05-04 12:00:32 +02:00
|
|
|
|
2017-05-24 14:48:27 +02:00
|
|
|
namespace {
|
|
|
|
|
namespace WCONHIST {
|
2018-01-05 20:04:52 +01:00
|
|
|
std::string all_specified_CMODE_THP() {
|
2017-05-24 14:48:27 +02:00
|
|
|
const std::string input =
|
|
|
|
|
"WCONHIST\n"
|
2018-01-05 20:04:52 +01:00
|
|
|
"'P' 'OPEN' 'THP' 1 2 3/\n/\n";
|
2017-05-24 14:48:27 +02:00
|
|
|
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
std::string all_specified() {
|
|
|
|
|
const std::string input =
|
|
|
|
|
"WCONHIST\n"
|
|
|
|
|
"'P' 'OPEN' 'ORAT' 1 2 3/\n/\n";
|
|
|
|
|
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string orat_defaulted() {
|
|
|
|
|
const std::string input =
|
|
|
|
|
"WCONHIST\n"
|
|
|
|
|
"'P' 'OPEN' 'WRAT' 1* 2 3/\n/\n";
|
|
|
|
|
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string owrat_defaulted() {
|
|
|
|
|
const std::string input =
|
|
|
|
|
"WCONHIST\n"
|
|
|
|
|
"'P' 'OPEN' 'GRAT' 1* 1* 3/\n/\n";
|
|
|
|
|
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string all_defaulted() {
|
|
|
|
|
const std::string input =
|
|
|
|
|
"WCONHIST\n"
|
|
|
|
|
"'P' 'OPEN' 'LRAT'/\n/\n";
|
|
|
|
|
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string all_defaulted_with_bhp() {
|
|
|
|
|
const std::string input =
|
|
|
|
|
"WCONHIST\n"
|
|
|
|
|
"-- 1 2 3 4-9 10\n"
|
|
|
|
|
" 'P' 'OPEN' 'RESV' 6* 500/\n/\n";
|
|
|
|
|
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-30 14:12:50 +02:00
|
|
|
std::string bhp_defaulted() {
|
|
|
|
|
const std::string input =
|
|
|
|
|
"WCONHIST\n"
|
|
|
|
|
"-- 1 2 3 4-9 10\n"
|
|
|
|
|
" 'P' 'OPEN' 'BHP' 6* 500/\n/\n";
|
|
|
|
|
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string all_defaulted_with_bhp_vfp_table() {
|
|
|
|
|
const std::string input =
|
|
|
|
|
"WCONHIST\n"
|
|
|
|
|
"-- 1 2 3 4-6 7 8 9 10\n"
|
|
|
|
|
" 'P' 'OPEN' 'RESV' 3* 3 10. 1* 500/\n/\n";
|
|
|
|
|
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
|
2018-07-04 12:47:30 +02:00
|
|
|
|
2017-05-24 14:48:27 +02:00
|
|
|
Opm::WellProductionProperties properties(const std::string& input) {
|
|
|
|
|
Opm::Parser parser;
|
|
|
|
|
|
2019-01-03 18:05:19 +01:00
|
|
|
auto deck = parser.parseString(input);
|
2017-05-24 14:48:27 +02:00
|
|
|
const auto& record = deck.getKeyword("WCONHIST").getRecord(0);
|
2019-06-22 07:14:14 +02:00
|
|
|
Opm::WellProductionProperties hist("W");
|
2019-04-08 09:18:32 +02:00
|
|
|
hist.handleWCONHIST(record);
|
|
|
|
|
|
2017-05-24 14:48:27 +02:00
|
|
|
|
|
|
|
|
return hist;
|
|
|
|
|
}
|
|
|
|
|
} // namespace WCONHIST
|
|
|
|
|
|
|
|
|
|
namespace WCONPROD {
|
|
|
|
|
std::string
|
|
|
|
|
all_specified_CMODE_BHP()
|
|
|
|
|
{
|
|
|
|
|
const std::string input =
|
2018-05-30 14:12:50 +02:00
|
|
|
"WCONHIST\n"
|
2017-05-24 14:48:27 +02:00
|
|
|
"'P' 'OPEN' 'BHP' 1 2 3/\n/\n";
|
|
|
|
|
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
|
2018-05-30 14:12:50 +02:00
|
|
|
std::string orat_CMODE_other_defaulted()
|
|
|
|
|
{
|
|
|
|
|
const std::string input =
|
|
|
|
|
"WCONPROD\n"
|
|
|
|
|
"'P' 'OPEN' 'ORAT' 1 2 3/\n/\n";
|
|
|
|
|
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string thp_CMODE()
|
|
|
|
|
{
|
|
|
|
|
const std::string input =
|
|
|
|
|
"WCONPROD\n"
|
|
|
|
|
"'P' 'OPEN' 'THP' 1 2 3 3* 10. 8 13./\n/\n";
|
|
|
|
|
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
std::string bhp_CMODE()
|
|
|
|
|
{
|
|
|
|
|
const std::string input =
|
|
|
|
|
"WCONPROD\n"
|
|
|
|
|
"'P' 'OPEN' 'BHP' 1 2 3 2* 20. 10. 8 13./\n/\n";
|
|
|
|
|
|
|
|
|
|
return input;
|
|
|
|
|
}
|
|
|
|
|
|
2017-05-24 14:48:27 +02:00
|
|
|
|
|
|
|
|
Opm::WellProductionProperties
|
|
|
|
|
properties(const std::string& input)
|
|
|
|
|
{
|
|
|
|
|
Opm::Parser parser;
|
2019-01-03 18:05:19 +01:00
|
|
|
auto deck = parser.parseString(input);
|
2018-05-30 14:12:50 +02:00
|
|
|
const auto& kwd = deck.getKeyword("WCONPROD");
|
2017-05-24 14:48:27 +02:00
|
|
|
const auto& record = kwd.getRecord(0);
|
2019-06-22 07:14:14 +02:00
|
|
|
Opm::WellProductionProperties pred("W");
|
2019-04-08 09:18:32 +02:00
|
|
|
pred.handleWCONPROD(record);
|
2017-05-24 14:48:27 +02:00
|
|
|
|
|
|
|
|
return pred;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
} // namespace anonymous
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WCH_All_Specified_BHP_Defaulted)
|
|
|
|
|
{
|
|
|
|
|
const Opm::WellProductionProperties& p =
|
|
|
|
|
WCONHIST::properties(WCONHIST::all_specified());
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK(p.hasProductionControl(Opm::WellProducer::ORAT));
|
2018-01-05 20:04:52 +01:00
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::WRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::GRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::LRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::RESV));
|
2017-05-24 14:48:27 +02:00
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(p.controlMode , Opm::WellProducer::ORAT);
|
|
|
|
|
|
2018-01-05 20:04:52 +01:00
|
|
|
BOOST_CHECK(p.hasProductionControl(Opm::WellProducer::BHP));
|
2018-12-18 14:42:25 +01:00
|
|
|
BOOST_CHECK_EQUAL(p.BHPLimit, 101325.);
|
2017-05-24 14:48:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WCH_ORAT_Defaulted_BHP_Defaulted)
|
|
|
|
|
{
|
|
|
|
|
const Opm::WellProductionProperties& p =
|
|
|
|
|
WCONHIST::properties(WCONHIST::orat_defaulted());
|
|
|
|
|
|
2018-01-05 20:04:52 +01:00
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::ORAT));
|
2017-05-24 14:48:27 +02:00
|
|
|
BOOST_CHECK(p.hasProductionControl(Opm::WellProducer::WRAT));
|
2018-01-05 20:04:52 +01:00
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::GRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::LRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::RESV));
|
2017-05-24 14:48:27 +02:00
|
|
|
BOOST_CHECK_EQUAL(p.controlMode , Opm::WellProducer::WRAT);
|
|
|
|
|
|
2018-01-05 20:04:52 +01:00
|
|
|
BOOST_CHECK(p.hasProductionControl(Opm::WellProducer::BHP));
|
2018-12-18 14:42:25 +01:00
|
|
|
BOOST_CHECK_EQUAL(p.BHPLimit, 101325.);
|
2017-05-24 14:48:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WCH_OWRAT_Defaulted_BHP_Defaulted)
|
|
|
|
|
{
|
|
|
|
|
const Opm::WellProductionProperties& p =
|
|
|
|
|
WCONHIST::properties(WCONHIST::owrat_defaulted());
|
|
|
|
|
|
2018-01-05 20:04:52 +01:00
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::ORAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::WRAT));
|
2017-05-24 14:48:27 +02:00
|
|
|
BOOST_CHECK(p.hasProductionControl(Opm::WellProducer::GRAT));
|
2018-01-05 20:04:52 +01:00
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::LRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::RESV));
|
2017-05-24 14:48:27 +02:00
|
|
|
BOOST_CHECK_EQUAL(p.controlMode , Opm::WellProducer::GRAT);
|
|
|
|
|
|
2018-01-05 20:04:52 +01:00
|
|
|
BOOST_CHECK(p.hasProductionControl(Opm::WellProducer::BHP));
|
2018-12-18 14:42:25 +01:00
|
|
|
BOOST_CHECK_EQUAL(p.BHPLimit, 101325.);
|
2017-05-24 14:48:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WCH_Rates_Defaulted_BHP_Defaulted)
|
|
|
|
|
{
|
|
|
|
|
const Opm::WellProductionProperties& p =
|
|
|
|
|
WCONHIST::properties(WCONHIST::all_defaulted());
|
|
|
|
|
|
2018-01-05 20:04:52 +01:00
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::ORAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::WRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::GRAT));
|
2017-05-24 14:48:27 +02:00
|
|
|
BOOST_CHECK(p.hasProductionControl(Opm::WellProducer::LRAT));
|
2018-01-05 20:04:52 +01:00
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::RESV));
|
2017-05-24 14:48:27 +02:00
|
|
|
BOOST_CHECK_EQUAL(p.controlMode , Opm::WellProducer::LRAT);
|
|
|
|
|
|
2018-01-05 20:04:52 +01:00
|
|
|
BOOST_CHECK(p.hasProductionControl(Opm::WellProducer::BHP));
|
2018-12-18 14:42:25 +01:00
|
|
|
BOOST_CHECK_EQUAL(p.BHPLimit, 101325.);
|
2017-05-24 14:48:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WCH_Rates_Defaulted_BHP_Specified)
|
|
|
|
|
{
|
|
|
|
|
const Opm::WellProductionProperties& p =
|
|
|
|
|
WCONHIST::properties(WCONHIST::all_defaulted_with_bhp());
|
|
|
|
|
|
2018-01-05 20:04:52 +01:00
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::ORAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::WRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::GRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::LRAT));
|
2017-05-24 14:48:27 +02:00
|
|
|
BOOST_CHECK(p.hasProductionControl(Opm::WellProducer::RESV));
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(p.controlMode , Opm::WellProducer::RESV);
|
|
|
|
|
|
2018-01-05 20:04:52 +01:00
|
|
|
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::WellProducer::BHP));
|
2018-12-18 14:42:25 +01:00
|
|
|
BOOST_CHECK_EQUAL(p.BHPLimit, 101325.);
|
2018-05-30 14:12:50 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WCH_Rates_NON_Defaulted_VFP)
|
|
|
|
|
{
|
|
|
|
|
const Opm::WellProductionProperties& p =
|
|
|
|
|
WCONHIST::properties(WCONHIST::all_defaulted_with_bhp_vfp_table());
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::ORAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::WRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::GRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::LRAT));
|
|
|
|
|
BOOST_CHECK(p.hasProductionControl(Opm::WellProducer::RESV));
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(p.controlMode , Opm::WellProducer::RESV);
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::WellProducer::BHP));
|
2018-07-04 12:47:30 +02:00
|
|
|
BOOST_CHECK_EQUAL(p.VFPTableNumber, 3);
|
|
|
|
|
BOOST_CHECK_EQUAL(p.ALQValue, 10.);
|
2018-12-18 14:42:25 +01:00
|
|
|
BOOST_CHECK_EQUAL(p.BHPLimit, 101325.);
|
2018-07-04 12:47:30 +02:00
|
|
|
}
|
|
|
|
|
|
2018-05-30 14:12:50 +02:00
|
|
|
BOOST_AUTO_TEST_CASE(WCH_BHP_Specified)
|
|
|
|
|
{
|
|
|
|
|
const Opm::WellProductionProperties& p =
|
|
|
|
|
WCONHIST::properties(WCONHIST::bhp_defaulted());
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::ORAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::WRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::GRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::LRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::RESV));
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(p.controlMode , Opm::WellProducer::BHP);
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::WellProducer::BHP));
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(p.BHPLimit, 5.e7); // 500 barsa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WCONPROD_ORAT_CMode)
|
|
|
|
|
{
|
2019-04-08 09:18:32 +02:00
|
|
|
const Opm::WellProductionProperties& p = WCONPROD::properties(WCONPROD::orat_CMODE_other_defaulted());
|
2018-05-30 14:12:50 +02:00
|
|
|
|
|
|
|
|
BOOST_CHECK( p.hasProductionControl(Opm::WellProducer::ORAT));
|
|
|
|
|
BOOST_CHECK( p.hasProductionControl(Opm::WellProducer::WRAT));
|
|
|
|
|
BOOST_CHECK( p.hasProductionControl(Opm::WellProducer::GRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::LRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::RESV));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::THP));
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(p.controlMode , Opm::WellProducer::ORAT);
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::WellProducer::BHP));
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(p.VFPTableNumber, 0);
|
|
|
|
|
BOOST_CHECK_EQUAL(p.ALQValue, 0.);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WCONPROD_THP_CMode)
|
|
|
|
|
{
|
|
|
|
|
const Opm::WellProductionProperties& p =
|
|
|
|
|
WCONPROD::properties(WCONPROD::thp_CMODE());
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK( p.hasProductionControl(Opm::WellProducer::ORAT));
|
|
|
|
|
BOOST_CHECK( p.hasProductionControl(Opm::WellProducer::WRAT));
|
|
|
|
|
BOOST_CHECK( p.hasProductionControl(Opm::WellProducer::GRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::LRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::RESV));
|
|
|
|
|
BOOST_CHECK( p.hasProductionControl(Opm::WellProducer::THP));
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(p.controlMode , Opm::WellProducer::THP);
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::WellProducer::BHP));
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(p.VFPTableNumber, 8);
|
|
|
|
|
BOOST_CHECK_EQUAL(p.ALQValue, 13.);
|
|
|
|
|
BOOST_CHECK_EQUAL(p.THPLimit, 1000000.); // 10 barsa
|
|
|
|
|
BOOST_CHECK_EQUAL(p.BHPLimit, 101325.); // 1 atm.
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WCONPROD_BHP_CMode)
|
|
|
|
|
{
|
|
|
|
|
const Opm::WellProductionProperties& p =
|
|
|
|
|
WCONPROD::properties(WCONPROD::bhp_CMODE());
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK( p.hasProductionControl(Opm::WellProducer::ORAT));
|
|
|
|
|
BOOST_CHECK( p.hasProductionControl(Opm::WellProducer::WRAT));
|
|
|
|
|
BOOST_CHECK( p.hasProductionControl(Opm::WellProducer::GRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::LRAT));
|
|
|
|
|
BOOST_CHECK( !p.hasProductionControl(Opm::WellProducer::RESV));
|
|
|
|
|
BOOST_CHECK( p.hasProductionControl(Opm::WellProducer::THP));
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(p.controlMode , Opm::WellProducer::BHP);
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::WellProducer::BHP));
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL(p.VFPTableNumber, 8);
|
|
|
|
|
BOOST_CHECK_EQUAL(p.ALQValue, 13.);
|
|
|
|
|
BOOST_CHECK_EQUAL(p.THPLimit, 1000000.); // 10 barsa
|
|
|
|
|
BOOST_CHECK_EQUAL(p.BHPLimit, 2000000.); // 20 barsa
|
2017-05-24 14:48:27 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(BHP_CMODE)
|
|
|
|
|
{
|
2018-01-05 20:04:52 +01:00
|
|
|
BOOST_CHECK_THROW( WCONHIST::properties(WCONHIST::all_specified_CMODE_THP()) , std::invalid_argument);
|
2017-05-24 14:48:27 +02:00
|
|
|
BOOST_CHECK_THROW( WCONPROD::properties(WCONPROD::all_specified_CMODE_BHP()) , std::invalid_argument);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(CMODE_DEFAULT) {
|
2019-06-22 07:14:14 +02:00
|
|
|
const Opm::WellProductionProperties Pproperties("W");
|
2019-06-22 07:19:09 +02:00
|
|
|
const Opm::WellInjectionProperties Iproperties("W");
|
2017-05-24 14:48:27 +02:00
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL( Pproperties.controlMode , Opm::WellProducer::CMODE_UNDEFINED );
|
|
|
|
|
BOOST_CHECK_EQUAL( Iproperties.controlMode , Opm::WellInjector::CMODE_UNDEFINED );
|
|
|
|
|
}
|
2019-05-09 17:03:29 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(WELL_CONTROLS) {
|
2019-06-19 13:24:21 +02:00
|
|
|
Opm::Well2 well("WELL", "GROUP", 0, 0, 0, 0, 1000, Opm::Phase::OIL, Opm::WellProducer::CMODE_UNDEFINED, Opm::WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
2019-05-09 17:03:29 +02:00
|
|
|
Opm::SummaryState st;
|
2019-06-17 09:08:47 +02:00
|
|
|
well.productionControls(st);
|
2019-05-09 17:03:29 +02:00
|
|
|
}
|
2019-06-17 07:39:23 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(ExtraAccessors) {
|
2019-06-19 13:24:21 +02:00
|
|
|
Opm::Well2 inj("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
|
|
|
|
Opm::Well2 prod("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::WellProducer::CMODE_UNDEFINED, WellCompletion::DEPTH, UnitSystem::newMETRIC(), 0);
|
2019-06-17 07:39:23 +02:00
|
|
|
|
|
|
|
|
auto inj_props= std::make_shared<Opm::WellInjectionProperties>(inj.getInjectionProperties());
|
|
|
|
|
inj_props->VFPTableNumber = 100;
|
|
|
|
|
inj.updateInjection(inj_props);
|
|
|
|
|
|
|
|
|
|
auto prod_props = std::make_shared<Opm::WellProductionProperties>( prod.getProductionProperties() );
|
|
|
|
|
prod_props->VFPTableNumber = 200;
|
|
|
|
|
prod.updateProduction(prod_props);
|
|
|
|
|
|
|
|
|
|
BOOST_CHECK_THROW(inj.alq_value(), std::runtime_error);
|
|
|
|
|
BOOST_CHECK_THROW(prod.temperature(), std::runtime_error);
|
|
|
|
|
BOOST_CHECK_EQUAL(inj.vfp_table_number(), 100);
|
|
|
|
|
BOOST_CHECK_EQUAL(prod.vfp_table_number(), 200);
|
|
|
|
|
}
|