2016-01-29 04:32:13 -06: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/>.
|
|
|
|
*/
|
|
|
|
|
2016-04-25 04:45:39 -05:00
|
|
|
#define BOOST_TEST_MODULE SummaryConfigTests
|
2016-01-29 04:32:13 -06:00
|
|
|
|
|
|
|
#include <boost/test/unit_test.hpp>
|
|
|
|
|
|
|
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
|
|
|
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
2016-04-25 04:45:39 -05:00
|
|
|
#include <opm/parser/eclipse/EclipseState/SummaryConfig/SummaryConfig.hpp>
|
2017-09-27 09:34:38 -05:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
2016-03-16 04:15:09 -05:00
|
|
|
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
2016-01-29 04:32:13 -06:00
|
|
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
|
|
|
|
2018-10-04 14:31:05 -05:00
|
|
|
#include <algorithm>
|
|
|
|
|
2016-01-29 04:32:13 -06:00
|
|
|
using namespace Opm;
|
|
|
|
|
2018-02-19 08:30:42 -06:00
|
|
|
static Deck createDeck_no_wells( const std::string& summary ) {
|
|
|
|
Opm::Parser parser;
|
|
|
|
std::string input =
|
|
|
|
"START -- 0 \n"
|
|
|
|
"10 MAI 2007 / \n"
|
|
|
|
"RUNSPEC\n"
|
|
|
|
"\n"
|
|
|
|
"DIMENS\n"
|
|
|
|
" 10 10 10 /\n"
|
|
|
|
"REGDIMS\n"
|
|
|
|
" 3/\n"
|
|
|
|
"GRID\n"
|
|
|
|
"DXV \n 10*400 /\n"
|
|
|
|
"DYV \n 10*400 /\n"
|
|
|
|
"DZV \n 10*400 /\n"
|
|
|
|
"TOPS \n 100*2202 / \n"
|
2019-03-19 15:11:13 -05:00
|
|
|
"PERMX\n"
|
|
|
|
" 1000*0.25 /\n"
|
|
|
|
"COPY\n"
|
|
|
|
" PERMX PERMY /\n"
|
|
|
|
" PERMX PERMZ /\n"
|
|
|
|
"/\n"
|
2018-02-19 08:30:42 -06:00
|
|
|
"REGIONS\n"
|
|
|
|
"FIPNUM\n"
|
|
|
|
"200*1 300*2 500*3 /\n"
|
|
|
|
"SCHEDULE\n"
|
|
|
|
"SUMMARY\n"
|
|
|
|
+ summary;
|
|
|
|
|
2019-01-03 11:05:19 -06:00
|
|
|
return parser.parseString(input);
|
2018-02-19 08:30:42 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-10-13 03:13:32 -05:00
|
|
|
static Deck createDeck( const std::string& summary ) {
|
2016-01-29 04:32:13 -06:00
|
|
|
Opm::Parser parser;
|
2017-09-27 09:34:38 -05:00
|
|
|
std::string input =
|
2016-01-29 04:32:13 -06:00
|
|
|
"START -- 0 \n"
|
|
|
|
"10 MAI 2007 / \n"
|
|
|
|
"RUNSPEC\n"
|
|
|
|
"\n"
|
|
|
|
"DIMENS\n"
|
|
|
|
" 10 10 10 /\n"
|
2017-05-25 16:39:45 -05:00
|
|
|
"REGDIMS\n"
|
|
|
|
" 3/\n"
|
2016-01-29 04:32:13 -06:00
|
|
|
"GRID\n"
|
2016-03-29 07:15:03 -05:00
|
|
|
"DXV \n 10*400 /\n"
|
|
|
|
"DYV \n 10*400 /\n"
|
|
|
|
"DZV \n 10*400 /\n"
|
|
|
|
"TOPS \n 100*2202 / \n"
|
2019-03-19 15:11:13 -05:00
|
|
|
"PERMX\n"
|
|
|
|
" 1000*0.25 /\n"
|
|
|
|
"COPY\n"
|
|
|
|
" PERMX PERMY /\n"
|
|
|
|
" PERMX PERMZ /\n"
|
|
|
|
"/\n"
|
2016-03-18 07:55:48 -05:00
|
|
|
"REGIONS\n"
|
|
|
|
"FIPNUM\n"
|
|
|
|
"200*1 300*2 500*3 /\n"
|
2016-01-29 04:32:13 -06:00
|
|
|
"SCHEDULE\n"
|
|
|
|
"WELSPECS\n"
|
2016-03-29 07:15:03 -05:00
|
|
|
" \'W_1\' \'OP\' 1 1 3.33 \'OIL\' 7* / \n"
|
|
|
|
" \'WX2\' \'OP\' 2 2 3.33 \'OIL\' 7* / \n"
|
|
|
|
" \'W_3\' \'OP\' 2 5 3.92 \'OIL\' 7* / \n"
|
|
|
|
" 'PRODUCER' 'G' 5 5 2000 'GAS' /\n"
|
|
|
|
"/\n"
|
|
|
|
"COMPDAT\n"
|
|
|
|
"'PRODUCER' 5 5 1 1 'OPEN' 1* -1 0.5 / \n"
|
|
|
|
"'W_1' 3 7 2 2 'OPEN' 1* * 0.311 4332.346 2* 'X' 22.123 / \n"
|
2016-07-15 06:24:58 -05:00
|
|
|
"'W_1' 2 2 1 1 /\n"
|
|
|
|
"'WX2' 2 2 1 1 /\n"
|
2016-01-29 04:32:13 -06:00
|
|
|
"/\n"
|
|
|
|
"SUMMARY\n"
|
|
|
|
+ summary;
|
|
|
|
|
2019-01-03 11:05:19 -06:00
|
|
|
return parser.parseString(input);
|
2016-01-29 04:32:13 -06:00
|
|
|
}
|
|
|
|
|
2016-04-25 04:45:39 -05:00
|
|
|
static std::vector< std::string > sorted_names( const SummaryConfig& summary ) {
|
2016-01-29 04:32:13 -06:00
|
|
|
std::vector< std::string > ret;
|
2016-06-28 08:37:05 -05:00
|
|
|
for( const auto& x : summary ) {
|
Decouple SummaryConfig From LibECL
This commit reimplements the SummaryNode class in order not to use
the ecl::smspec_node class from LibECL. Consequently, we remove
class SummaryConfig's binding to LibECL.
Class SummaryNode maintains the same information as before. We also
implement a "named constructor" strategy to assign data members that
only make sense for a subset of the node categories. The previous
member function 'type' is renamed to 'category' to identify the
attachment category (e.g., Well, Group, Field, Block, Region). In
turn, we introduce a new 'type' member function to identify the
parameter kind (e.g, pressure, rate, cumulative total, well count)
represented by a given node. We furthermore capture whether or not
the node is a user defined quantity (i.e., a UDQ).
We reimplement the keyword classifier operations that are currently
needed as free functions named 'is_*()' in SummaryConfig.cpp.
Note that in addition to the renamed member functions of class
SummaryNode, this commit also switches the summary key strategy for
block parameters. Rather than capturing the 'ijk' values
individually as "BOSAT:3,3,6", we now store the equivalent global
(Cartesian) index (i.e., as "BOSAT:523"). Code that directly
constructs block parameter keys must be updated accordingly.
Chase the API change in the 'Summary' constructor and update unit
tests as needed.
2019-09-27 09:50:42 -05:00
|
|
|
auto wgname = x.namedEntity();
|
2018-11-25 04:35:41 -06:00
|
|
|
if(wgname.size())
|
|
|
|
ret.push_back( wgname );
|
2016-06-28 08:37:05 -05:00
|
|
|
}
|
2016-01-29 04:32:13 -06:00
|
|
|
|
|
|
|
std::sort( ret.begin(), ret.end() );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-04-25 04:45:39 -05:00
|
|
|
static std::vector< std::string > sorted_keywords( const SummaryConfig& summary ) {
|
2016-01-29 04:32:13 -06:00
|
|
|
std::vector< std::string > ret;
|
|
|
|
for( const auto& x : summary )
|
2018-11-25 04:35:41 -06:00
|
|
|
ret.push_back( x.keyword() );
|
2016-01-29 04:32:13 -06:00
|
|
|
|
|
|
|
std::sort( ret.begin(), ret.end() );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-06-28 08:37:05 -05:00
|
|
|
static std::vector< std::string > sorted_key_names( const SummaryConfig& summary ) {
|
|
|
|
std::vector< std::string > ret;
|
|
|
|
for( const auto& x : summary ) {
|
Decouple SummaryConfig From LibECL
This commit reimplements the SummaryNode class in order not to use
the ecl::smspec_node class from LibECL. Consequently, we remove
class SummaryConfig's binding to LibECL.
Class SummaryNode maintains the same information as before. We also
implement a "named constructor" strategy to assign data members that
only make sense for a subset of the node categories. The previous
member function 'type' is renamed to 'category' to identify the
attachment category (e.g., Well, Group, Field, Block, Region). In
turn, we introduce a new 'type' member function to identify the
parameter kind (e.g, pressure, rate, cumulative total, well count)
represented by a given node. We furthermore capture whether or not
the node is a user defined quantity (i.e., a UDQ).
We reimplement the keyword classifier operations that are currently
needed as free functions named 'is_*()' in SummaryConfig.cpp.
Note that in addition to the renamed member functions of class
SummaryNode, this commit also switches the summary key strategy for
block parameters. Rather than capturing the 'ijk' values
individually as "BOSAT:3,3,6", we now store the equivalent global
(Cartesian) index (i.e., as "BOSAT:523"). Code that directly
constructs block parameter keys must be updated accordingly.
Chase the API change in the 'Summary' constructor and update unit
tests as needed.
2019-09-27 09:50:42 -05:00
|
|
|
ret.push_back( x.uniqueNodeKey() );
|
2016-06-28 08:37:05 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
std::sort( ret.begin(), ret.end() );
|
|
|
|
return ret;
|
|
|
|
}
|
|
|
|
|
2016-06-29 09:38:09 -05:00
|
|
|
static SummaryConfig createSummary( std::string input , const ParseContext& parseContext = ParseContext()) {
|
2019-01-03 11:05:19 -06:00
|
|
|
ErrorGuard errors;
|
2016-01-29 04:32:13 -06:00
|
|
|
auto deck = createDeck( input );
|
2019-01-03 11:05:19 -06:00
|
|
|
EclipseState state( deck, parseContext, errors );
|
|
|
|
Schedule schedule(deck, state.getInputGrid(), state.get3DProperties(), state.runspec(), parseContext, errors);
|
|
|
|
return SummaryConfig( deck, schedule, state.getTableManager( ), parseContext, errors );
|
2016-01-29 04:32:13 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(wells_all) {
|
|
|
|
const auto input = "WWCT\n/\n";
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
|
2016-03-29 07:15:03 -05:00
|
|
|
const auto wells = { "PRODUCER", "WX2", "W_1", "W_3" };
|
2016-01-29 04:32:13 -06:00
|
|
|
const auto names = sorted_names( summary );
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
|
|
|
wells.begin(), wells.end(),
|
|
|
|
names.begin(), names.end() );
|
|
|
|
}
|
|
|
|
|
2019-03-29 07:14:43 -05:00
|
|
|
BOOST_AUTO_TEST_CASE(EMPTY) {
|
|
|
|
auto deck = createDeck_no_wells( "" );
|
|
|
|
EclipseState state( deck );
|
|
|
|
Schedule schedule(deck, state.getInputGrid(), state.get3DProperties(), state.runspec());
|
|
|
|
SummaryConfig conf(deck, schedule, state.getTableManager());
|
|
|
|
BOOST_CHECK_EQUAL( conf.size(), 0 );
|
|
|
|
}
|
|
|
|
|
2018-02-19 08:30:42 -06:00
|
|
|
BOOST_AUTO_TEST_CASE(wells_missingI) {
|
|
|
|
ParseContext parseContext;
|
2019-01-03 11:05:19 -06:00
|
|
|
ErrorGuard errors;
|
2018-02-19 08:30:42 -06:00
|
|
|
const auto input = "WWCT\n/\n";
|
|
|
|
auto deck = createDeck_no_wells( input );
|
|
|
|
parseContext.update(ParseContext::SUMMARY_UNKNOWN_WELL, InputError::THROW_EXCEPTION);
|
2019-01-03 11:05:19 -06:00
|
|
|
EclipseState state( deck, parseContext, errors );
|
|
|
|
Schedule schedule(deck, state.getInputGrid(), state.get3DProperties(), state.runspec(), parseContext, errors);
|
|
|
|
BOOST_CHECK_NO_THROW( SummaryConfig( deck, schedule, state.getTableManager( ), parseContext, errors ));
|
2018-02-19 08:30:42 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2016-01-29 04:32:13 -06:00
|
|
|
BOOST_AUTO_TEST_CASE(wells_select) {
|
|
|
|
const auto input = "WWCT\n'W_1' 'WX2' /\n";
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
const auto wells = { "WX2", "W_1" };
|
|
|
|
const auto names = sorted_names( summary );
|
|
|
|
|
2016-05-23 03:32:41 -05:00
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
|
|
|
wells.begin(), wells.end(),
|
|
|
|
names.begin(), names.end() );
|
2019-03-29 09:39:50 -05:00
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL( summary.size(), 2 );
|
2016-05-23 03:32:41 -05:00
|
|
|
}
|
|
|
|
|
2016-11-02 04:19:15 -05:00
|
|
|
BOOST_AUTO_TEST_CASE(groups_all) {
|
|
|
|
const auto summary = createSummary( "GWPR \n /\n" );
|
|
|
|
const auto groups = { "G", "OP" };
|
|
|
|
const auto names = sorted_names( summary );
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS( groups.begin(), groups.end(),
|
|
|
|
names.begin(), names.end() );
|
|
|
|
}
|
|
|
|
|
2016-07-18 07:44:00 -05:00
|
|
|
BOOST_AUTO_TEST_CASE(wells_pattern) {
|
|
|
|
const auto input = "WWCT\n'W*' /\n";
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
const auto wells = { "WX2", "W_1", "W_3" };
|
|
|
|
const auto names = sorted_names( summary );
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
|
|
|
wells.begin(), wells.end(),
|
|
|
|
names.begin(), names.end() );
|
|
|
|
}
|
2016-01-29 04:32:13 -06:00
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(fields) {
|
|
|
|
const auto input = "FOPT\n";
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
const auto keywords = { "FOPT" };
|
|
|
|
const auto names = sorted_keywords( summary );
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
|
|
|
keywords.begin(), keywords.end(),
|
|
|
|
names.begin(), names.end() );
|
|
|
|
}
|
|
|
|
|
2017-05-31 04:33:21 -05:00
|
|
|
BOOST_AUTO_TEST_CASE(field_oil_efficiency) {
|
|
|
|
const auto input = "FOE\n";
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL( true , summary.hasKeyword( "FOE"));
|
|
|
|
}
|
|
|
|
|
2016-01-29 04:32:13 -06:00
|
|
|
BOOST_AUTO_TEST_CASE(blocks) {
|
|
|
|
const auto input = "BPR\n"
|
|
|
|
"3 3 6 /\n"
|
|
|
|
"4 3 6 /\n"
|
|
|
|
"/";
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
const auto keywords = { "BPR", "BPR" };
|
|
|
|
const auto names = sorted_keywords( summary );
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
|
|
|
keywords.begin(), keywords.end(),
|
|
|
|
names.begin(), names.end() );
|
|
|
|
}
|
2016-03-18 07:55:48 -05:00
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(regions) {
|
|
|
|
const auto input = "ROIP\n"
|
|
|
|
"1 2 3 /\n"
|
|
|
|
"RWIP\n"
|
|
|
|
"/\n"
|
|
|
|
"RGIP\n"
|
|
|
|
"1 2 /\n";
|
|
|
|
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
const auto keywords = { "RGIP", "RGIP",
|
|
|
|
"ROIP", "ROIP", "ROIP",
|
|
|
|
"RWIP", "RWIP", "RWIP" };
|
|
|
|
const auto names = sorted_keywords( summary );
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
|
|
|
keywords.begin(), keywords.end(),
|
|
|
|
names.begin(), names.end() );
|
|
|
|
}
|
2016-03-29 07:15:03 -05:00
|
|
|
|
2018-12-19 02:38:03 -06:00
|
|
|
BOOST_AUTO_TEST_CASE(region2region) {
|
|
|
|
const auto input = "ROFT\n"
|
|
|
|
"1 2/\n"
|
|
|
|
"3 4/\n"
|
|
|
|
"/\n"
|
|
|
|
"RWIP\n"
|
|
|
|
"/\n"
|
|
|
|
"RGFT\n"
|
|
|
|
"5 6/\n"
|
|
|
|
"7 8/\n"
|
|
|
|
"/\n";
|
|
|
|
|
|
|
|
|
2018-12-19 03:09:02 -06:00
|
|
|
ParseContext parseContext;
|
|
|
|
parseContext.update(ParseContext::SUMMARY_UNHANDLED_KEYWORD, InputError::IGNORE);
|
|
|
|
|
|
|
|
const auto summary = createSummary( input, parseContext );
|
2018-12-19 02:38:03 -06:00
|
|
|
const auto keywords = { "RWIP", "RWIP", "RWIP" };
|
|
|
|
const auto names = sorted_keywords( summary );
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(keywords.begin(), keywords.end(),
|
|
|
|
names.begin(), names.end() );
|
2018-12-19 03:09:02 -06:00
|
|
|
|
|
|
|
parseContext.update(ParseContext::SUMMARY_UNHANDLED_KEYWORD, InputError::THROW_EXCEPTION);
|
|
|
|
BOOST_CHECK_THROW( createSummary(input, parseContext), std::invalid_argument);
|
2018-12-19 02:38:03 -06:00
|
|
|
}
|
|
|
|
|
2016-03-29 07:15:03 -05:00
|
|
|
BOOST_AUTO_TEST_CASE(completions) {
|
2016-07-15 06:24:58 -05:00
|
|
|
const auto input = "CWIR\n" // all specified
|
2016-03-29 07:15:03 -05:00
|
|
|
"'PRODUCER' /\n"
|
|
|
|
"'WX2' 1 1 1 /\n"
|
2016-07-15 06:24:58 -05:00
|
|
|
"'WX2' 2 2 1 /\n"
|
2016-03-29 07:15:03 -05:00
|
|
|
"/\n"
|
2016-07-15 06:24:58 -05:00
|
|
|
"CWIT\n" // block defaulted
|
2016-03-29 07:15:03 -05:00
|
|
|
"'W_1' /\n"
|
2016-07-15 06:24:58 -05:00
|
|
|
"/\n"
|
|
|
|
"CGIT\n" // well defaulted
|
|
|
|
"* 2 2 1 /\n"
|
|
|
|
"/\n"
|
|
|
|
"CGIR\n" // all defaulted
|
|
|
|
" '*' /\n"
|
2017-09-25 04:42:44 -05:00
|
|
|
"/\n"
|
2017-09-11 11:24:48 -05:00
|
|
|
"CPRL\n" // all defaulted
|
|
|
|
" '*' /\n"
|
|
|
|
"/\n";
|
2016-03-29 07:15:03 -05:00
|
|
|
|
|
|
|
const auto summary = createSummary( input );
|
2016-07-15 06:24:58 -05:00
|
|
|
const auto keywords = { "CGIR", "CGIR", "CGIR", "CGIR",
|
|
|
|
"CGIT", "CGIT",
|
2018-01-16 04:24:09 -06:00
|
|
|
"CPRL", "CPRL", "CPRL", "CPRL",
|
2016-07-15 06:24:58 -05:00
|
|
|
"CWIR", "CWIR",
|
|
|
|
"CWIT", "CWIT" };
|
2016-03-29 07:15:03 -05:00
|
|
|
const auto names = sorted_keywords( summary );
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
|
|
|
keywords.begin(), keywords.end(),
|
|
|
|
names.begin(), names.end() );
|
2016-07-04 05:02:43 -05:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE( merge ) {
|
|
|
|
const auto input1 = "WWCT\n/\n";
|
|
|
|
auto summary1 = createSummary( input1 );
|
|
|
|
|
|
|
|
const auto keywords = { "FOPT", "WWCT", "WWCT", "WWCT", "WWCT" };
|
|
|
|
const auto wells = { "PRODUCER", "WX2", "W_1", "W_3" };
|
|
|
|
|
|
|
|
const auto input2 = "FOPT\n";
|
|
|
|
const auto summary2 = createSummary( input2 );
|
|
|
|
|
|
|
|
summary1.merge( summary2 );
|
|
|
|
const auto kw_names = sorted_keywords( summary1 );
|
|
|
|
const auto well_names = sorted_names( summary1 );
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
|
|
|
keywords.begin(), keywords.end(),
|
|
|
|
kw_names.begin(), kw_names.end() );
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
|
|
|
wells.begin(), wells.end(),
|
|
|
|
well_names.begin(), well_names.end() );
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE( merge_move ) {
|
|
|
|
const auto input = "WWCT\n/\n";
|
|
|
|
auto summary = createSummary( input );
|
|
|
|
|
|
|
|
const auto keywords = { "FOPT", "WWCT", "WWCT", "WWCT", "WWCT" };
|
|
|
|
const auto wells = { "PRODUCER", "WX2", "W_1", "W_3" };
|
|
|
|
|
|
|
|
summary.merge( createSummary( "FOPT\n" ) );
|
|
|
|
|
|
|
|
const auto kw_names = sorted_keywords( summary );
|
|
|
|
const auto well_names = sorted_names( summary );
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
|
|
|
keywords.begin(), keywords.end(),
|
|
|
|
kw_names.begin(), kw_names.end() );
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
|
|
|
wells.begin(), wells.end(),
|
|
|
|
well_names.begin(), well_names.end() );
|
2016-03-29 07:15:03 -05:00
|
|
|
}
|
2016-06-28 08:37:05 -05:00
|
|
|
|
2016-07-11 04:20:05 -05:00
|
|
|
static const auto ALL_keywords = {
|
2019-07-31 16:42:04 -05:00
|
|
|
"FAQR", "FAQRG", "FAQT", "FAQTG", "FGIP", "FGIPG", "FGIPL",
|
|
|
|
"FGIR", "FGIT", "FGOR", "FGPR", "FGPT", "FOIP", "FOIPG",
|
|
|
|
"FOIPL", "FOIR", "FOIT", "FOPR", "FOPT", "FPR", "FVIR",
|
|
|
|
"FVIT", "FVPR", "FVPT", "FWCT", "FWGR", "FWIP", "FWIR",
|
|
|
|
"FWIT", "FWPR", "FWPT",
|
|
|
|
"GGIR", "GGIT", "GGOR", "GGPR", "GGPT", "GOIR", "GOIT",
|
|
|
|
"GOPR", "GOPT", "GVIR", "GVIT", "GVPR", "GVPT", "GWCT",
|
|
|
|
"GWGR", "GWIR", "GWIT", "GWPR", "GWPT",
|
|
|
|
"WBHP", "WGIR", "WGIT", "WGOR", "WGPR", "WGPT", "WOIR",
|
|
|
|
"WOIT", "WOPR", "WOPT", "WPI", "WTHP", "WVIR", "WVIT",
|
|
|
|
"WVPR", "WVPT", "WWCT", "WWGR", "WWIR", "WWIT", "WWPR",
|
|
|
|
"WWPT",
|
|
|
|
// ALL will not expand to these keywords yet
|
|
|
|
"AAQR", "AAQRG", "AAQT", "AAQTG"
|
2016-07-04 04:37:01 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2016-06-28 08:37:05 -05:00
|
|
|
BOOST_AUTO_TEST_CASE(summary_ALL) {
|
|
|
|
|
|
|
|
const auto input = "ALL\n";
|
|
|
|
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
const auto key_names = sorted_key_names( summary );
|
|
|
|
|
|
|
|
std::vector<std::string> all;
|
|
|
|
|
2016-07-04 04:37:01 -05:00
|
|
|
for( std::string keyword: ALL_keywords ) {
|
2016-06-28 08:37:05 -05:00
|
|
|
if(keyword[0]=='F') {
|
|
|
|
all.push_back(keyword);
|
|
|
|
}
|
|
|
|
else if (keyword[0]=='G') {
|
2016-06-29 03:11:06 -05:00
|
|
|
auto kn = keyword + ":";
|
2016-06-28 08:37:05 -05:00
|
|
|
all.push_back(kn + "G");
|
|
|
|
all.push_back(kn + "OP");
|
|
|
|
}
|
|
|
|
else if (keyword[0]=='W') {
|
2016-06-29 03:11:06 -05:00
|
|
|
auto kn = keyword + ":";
|
2016-06-28 08:37:05 -05:00
|
|
|
all.push_back(kn + "W_1");
|
|
|
|
all.push_back(kn + "WX2");
|
|
|
|
all.push_back(kn + "W_3");
|
|
|
|
all.push_back(kn + "PRODUCER");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
std::sort(all.begin(), all.end());
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
|
|
|
all.begin(), all.end(),
|
|
|
|
key_names.begin(), key_names.end());
|
|
|
|
|
2016-09-19 13:18:51 -05:00
|
|
|
BOOST_CHECK_EQUAL( true , summary.hasKeyword( "FOPT"));
|
|
|
|
BOOST_CHECK_EQUAL( true , summary.hasKeyword( "GGIT"));
|
|
|
|
BOOST_CHECK_EQUAL( true , summary.hasKeyword( "WWCT"));
|
|
|
|
|
2019-07-31 16:42:04 -05:00
|
|
|
BOOST_CHECK_EQUAL( false, summary.hasKeyword( "WOPP"));
|
|
|
|
BOOST_CHECK_EQUAL( false, summary.hasKeyword( "FOPP"));
|
|
|
|
|
2016-09-19 13:18:51 -05:00
|
|
|
BOOST_CHECK_EQUAL( false , summary.hasKeyword("NO-NOT-THIS"));
|
2016-06-28 08:37:05 -05:00
|
|
|
}
|
2016-06-29 09:38:09 -05:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(INVALID_WELL1) {
|
|
|
|
ParseContext parseContext;
|
|
|
|
const auto input = "CWIR\n"
|
|
|
|
"NEW-WELL /\n"
|
|
|
|
"/\n";
|
|
|
|
parseContext.updateKey( ParseContext::SUMMARY_UNKNOWN_WELL , InputError::THROW_EXCEPTION );
|
|
|
|
BOOST_CHECK_THROW( createSummary( input , parseContext ) , std::invalid_argument);
|
|
|
|
|
|
|
|
parseContext.updateKey( ParseContext::SUMMARY_UNKNOWN_WELL , InputError::IGNORE );
|
2016-07-03 19:55:32 -05:00
|
|
|
BOOST_CHECK_NO_THROW( createSummary( input , parseContext ));
|
2016-06-29 09:38:09 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(INVALID_WELL2) {
|
|
|
|
ParseContext parseContext;
|
|
|
|
const auto input = "WWCT\n"
|
|
|
|
" NEW-WELL /\n";
|
|
|
|
parseContext.updateKey( ParseContext::SUMMARY_UNKNOWN_WELL , InputError::THROW_EXCEPTION );
|
|
|
|
BOOST_CHECK_THROW( createSummary( input , parseContext ) , std::invalid_argument);
|
|
|
|
|
|
|
|
parseContext.updateKey( ParseContext::SUMMARY_UNKNOWN_WELL , InputError::IGNORE );
|
2016-07-03 19:55:32 -05:00
|
|
|
BOOST_CHECK_NO_THROW( createSummary( input , parseContext ));
|
2016-06-29 09:38:09 -05:00
|
|
|
}
|
|
|
|
|
2019-03-09 03:19:11 -06:00
|
|
|
BOOST_AUTO_TEST_CASE(UNDEFINED_UDQ_WELL) {
|
|
|
|
ParseContext parseContext;
|
|
|
|
const auto input = "WUWCT\n"
|
|
|
|
"/\n";
|
|
|
|
parseContext.updateKey( ParseContext::SUMMARY_UNDEFINED_UDQ, InputError::THROW_EXCEPTION );
|
|
|
|
BOOST_CHECK_THROW( createSummary( input , parseContext ) , std::invalid_argument);
|
|
|
|
|
|
|
|
parseContext.updateKey( ParseContext::SUMMARY_UNDEFINED_UDQ, InputError::IGNORE );
|
|
|
|
BOOST_CHECK_NO_THROW( createSummary( input , parseContext ));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2016-06-29 09:38:09 -05:00
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE(INVALID_GROUP) {
|
|
|
|
ParseContext parseContext;
|
|
|
|
const auto input = "GWCT\n"
|
|
|
|
" NEW-GR /\n";
|
|
|
|
parseContext.updateKey( ParseContext::SUMMARY_UNKNOWN_GROUP , InputError::THROW_EXCEPTION );
|
|
|
|
BOOST_CHECK_THROW( createSummary( input , parseContext ) , std::invalid_argument);
|
|
|
|
|
|
|
|
parseContext.updateKey( ParseContext::SUMMARY_UNKNOWN_GROUP , InputError::IGNORE );
|
2016-07-03 19:55:32 -05:00
|
|
|
BOOST_CHECK_NO_THROW( createSummary( input , parseContext ));
|
2016-06-29 09:38:09 -05:00
|
|
|
}
|
2016-07-04 09:44:00 -05:00
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE( REMOVE_DUPLICATED_ENTRIES ) {
|
|
|
|
ParseContext parseContext;
|
|
|
|
const auto input = "WGPR \n/\n"
|
|
|
|
"WGPR \n/\n"
|
|
|
|
"ALL\n";
|
|
|
|
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
const auto keys = sorted_key_names( summary );
|
|
|
|
auto uniq_keys = keys;
|
|
|
|
uniq_keys.erase( std::unique( uniq_keys.begin(),
|
|
|
|
uniq_keys.end(),
|
|
|
|
std::equal_to< std::string >() ),
|
|
|
|
uniq_keys.end() );
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS(
|
|
|
|
keys.begin(), keys.end(),
|
|
|
|
uniq_keys.begin(), uniq_keys.end() );
|
|
|
|
}
|
2016-12-13 05:19:59 -06:00
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE( ANALYTICAL_AQUIFERS ) {
|
|
|
|
const std::string input = R"(
|
|
|
|
AAQR
|
|
|
|
1 2 /
|
|
|
|
AAQP
|
|
|
|
2 1 /
|
|
|
|
AAQT
|
|
|
|
/
|
|
|
|
AAQRG
|
|
|
|
/
|
|
|
|
AAQTG
|
|
|
|
/
|
|
|
|
AAQTD
|
|
|
|
/
|
|
|
|
AAQPD
|
|
|
|
/
|
|
|
|
)";
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
}
|
2016-12-13 05:26:15 -06:00
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE( NUMERICAL_AQUIFERS ) {
|
|
|
|
const std::string input = R"(
|
|
|
|
ANQR
|
|
|
|
1 2 /
|
|
|
|
ANQP
|
|
|
|
2 1 /
|
|
|
|
ANQT
|
|
|
|
/
|
|
|
|
)";
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
}
|
2016-12-13 05:55:09 -06:00
|
|
|
|
|
|
|
static const auto GMWSET_keywords = {
|
|
|
|
"GMCTG", "GMWPT", "GMWPR", "GMWPA", "GMWPU", "GMWPG", "GMWPO", "GMWPS",
|
|
|
|
"GMWPV", "GMWPP", "GMWPL", "GMWIT", "GMWIN", "GMWIA", "GMWIU", "GMWIG",
|
|
|
|
"GMWIS", "GMWIV", "GMWIP", "GMWDR", "GMWDT", "GMWWO", "GMWWT"
|
|
|
|
};
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE( summary_GMWSET ) {
|
|
|
|
|
|
|
|
const auto input = "GMWSET\n";
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
const auto key_names = sorted_key_names( summary );
|
|
|
|
|
|
|
|
std::vector< std::string > all;
|
|
|
|
|
|
|
|
for( std::string kw : GMWSET_keywords ) {
|
|
|
|
all.emplace_back(kw + ":G");
|
|
|
|
all.emplace_back(kw + ":OP");
|
|
|
|
}
|
|
|
|
|
|
|
|
std::sort( all.begin(), all.end() );
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS( all.begin(), all.end(),
|
|
|
|
key_names.begin(), key_names.end() );
|
|
|
|
|
|
|
|
BOOST_CHECK( summary.hasKeyword( "GMWPS" ) );
|
|
|
|
BOOST_CHECK( summary.hasKeyword( "GMWPT" ) );
|
|
|
|
BOOST_CHECK( summary.hasKeyword( "GMWPR" ) );
|
|
|
|
|
|
|
|
BOOST_CHECK( !summary.hasKeyword("NO-NOT-THIS") );
|
|
|
|
}
|
2016-12-13 06:11:46 -06:00
|
|
|
|
|
|
|
static const auto FMWSET_keywords = {
|
|
|
|
"FMCTF", "FMWPT", "FMWPR", "FMWPA", "FMWPU", "FMWPF", "FMWPO", "FMWPS",
|
|
|
|
"FMWPV", "FMWPP", "FMWPL", "FMWIT", "FMWIN", "FMWIA", "FMWIU", "FMWIF",
|
|
|
|
"FMWIS", "FMWIV", "FMWIP", "FMWDR", "FMWDT", "FMWWO", "FMWWT"
|
|
|
|
};
|
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE( summary_FMWSET ) {
|
|
|
|
|
|
|
|
const auto input = "FMWSET\n";
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
const auto key_names = sorted_key_names( summary );
|
|
|
|
|
|
|
|
std::vector< std::string > all( FMWSET_keywords.begin(),
|
|
|
|
FMWSET_keywords.end() );
|
|
|
|
std::sort( all.begin(), all.end() );
|
|
|
|
|
|
|
|
BOOST_CHECK_EQUAL_COLLECTIONS( all.begin(), all.end(),
|
|
|
|
key_names.begin(), key_names.end() );
|
|
|
|
|
|
|
|
BOOST_CHECK( summary.hasKeyword( "FMWPS" ) );
|
|
|
|
BOOST_CHECK( summary.hasKeyword( "FMWPT" ) );
|
|
|
|
BOOST_CHECK( summary.hasKeyword( "FMWPR" ) );
|
|
|
|
|
|
|
|
BOOST_CHECK( !summary.hasKeyword("NO-NOT-THIS") );
|
|
|
|
}
|
2017-02-06 16:52:39 -06:00
|
|
|
|
|
|
|
|
2019-05-20 05:52:05 -05:00
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE( WOPRL ) {
|
|
|
|
const std::string input = R"(
|
|
|
|
WOPRL
|
|
|
|
'W_1' 1 /
|
|
|
|
'WX2' 2 /
|
|
|
|
'W_3' 3 /
|
|
|
|
/
|
|
|
|
)";
|
|
|
|
|
|
|
|
ParseContext parseContext;
|
|
|
|
parseContext.update(ParseContext::SUMMARY_UNHANDLED_KEYWORD, InputError::THROW_EXCEPTION);
|
|
|
|
BOOST_CHECK_THROW(createSummary( input, parseContext ), std::invalid_argument);
|
|
|
|
parseContext.update(ParseContext::SUMMARY_UNHANDLED_KEYWORD, InputError::IGNORE);
|
|
|
|
BOOST_CHECK_NO_THROW( createSummary(input, parseContext ));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-02-06 16:52:39 -06:00
|
|
|
BOOST_AUTO_TEST_CASE( summary_require3DField ) {
|
|
|
|
{
|
|
|
|
const auto input = "WWCT\n/\n";
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
|
|
|
|
BOOST_CHECK( !summary.require3DField( "NO-NOT-THIS"));
|
|
|
|
|
|
|
|
BOOST_CHECK( !summary.require3DField( "PRESSURE"));
|
|
|
|
BOOST_CHECK( !summary.require3DField( "OIP"));
|
|
|
|
BOOST_CHECK( !summary.require3DField( "GIP"));
|
|
|
|
BOOST_CHECK( !summary.require3DField( "WIP"));
|
|
|
|
BOOST_CHECK( !summary.require3DField( "OIPL"));
|
|
|
|
BOOST_CHECK( !summary.require3DField( "OIPG"));
|
|
|
|
BOOST_CHECK( !summary.require3DField( "GIPL"));
|
|
|
|
BOOST_CHECK( !summary.require3DField( "GIPG"));
|
|
|
|
BOOST_CHECK( !summary.require3DField( "SWAT"));
|
|
|
|
BOOST_CHECK( !summary.require3DField( "SGAS"));
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto input = "BPR\n"
|
|
|
|
"3 3 6 /\n"
|
|
|
|
"4 3 6 /\n"
|
|
|
|
"/";
|
|
|
|
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
BOOST_CHECK( summary.require3DField( "PRESSURE"));
|
|
|
|
BOOST_CHECK( !summary.requireFIPNUM( ));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto input = "FPR\n";
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
BOOST_CHECK( summary.require3DField( "PRESSURE"));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto input = "BSWAT\n"
|
|
|
|
"3 3 6 /\n"
|
|
|
|
"4 3 6 /\n"
|
|
|
|
"/";
|
|
|
|
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
BOOST_CHECK( summary.require3DField( "SWAT"));
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto input = "BSGAS\n"
|
Decouple SummaryConfig From LibECL
This commit reimplements the SummaryNode class in order not to use
the ecl::smspec_node class from LibECL. Consequently, we remove
class SummaryConfig's binding to LibECL.
Class SummaryNode maintains the same information as before. We also
implement a "named constructor" strategy to assign data members that
only make sense for a subset of the node categories. The previous
member function 'type' is renamed to 'category' to identify the
attachment category (e.g., Well, Group, Field, Block, Region). In
turn, we introduce a new 'type' member function to identify the
parameter kind (e.g, pressure, rate, cumulative total, well count)
represented by a given node. We furthermore capture whether or not
the node is a user defined quantity (i.e., a UDQ).
We reimplement the keyword classifier operations that are currently
needed as free functions named 'is_*()' in SummaryConfig.cpp.
Note that in addition to the renamed member functions of class
SummaryNode, this commit also switches the summary key strategy for
block parameters. Rather than capturing the 'ijk' values
individually as "BOSAT:3,3,6", we now store the equivalent global
(Cartesian) index (i.e., as "BOSAT:523"). Code that directly
constructs block parameter keys must be updated accordingly.
Chase the API change in the 'Summary' constructor and update unit
tests as needed.
2019-09-27 09:50:42 -05:00
|
|
|
"3 3 6 /\n" // 523
|
|
|
|
"4 3 6 /\n" // 524
|
2017-02-06 16:52:39 -06:00
|
|
|
"/";
|
|
|
|
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
BOOST_CHECK( summary.require3DField( "SGAS"));
|
Decouple SummaryConfig From LibECL
This commit reimplements the SummaryNode class in order not to use
the ecl::smspec_node class from LibECL. Consequently, we remove
class SummaryConfig's binding to LibECL.
Class SummaryNode maintains the same information as before. We also
implement a "named constructor" strategy to assign data members that
only make sense for a subset of the node categories. The previous
member function 'type' is renamed to 'category' to identify the
attachment category (e.g., Well, Group, Field, Block, Region). In
turn, we introduce a new 'type' member function to identify the
parameter kind (e.g, pressure, rate, cumulative total, well count)
represented by a given node. We furthermore capture whether or not
the node is a user defined quantity (i.e., a UDQ).
We reimplement the keyword classifier operations that are currently
needed as free functions named 'is_*()' in SummaryConfig.cpp.
Note that in addition to the renamed member functions of class
SummaryNode, this commit also switches the summary key strategy for
block parameters. Rather than capturing the 'ijk' values
individually as "BOSAT:3,3,6", we now store the equivalent global
(Cartesian) index (i.e., as "BOSAT:523"). Code that directly
constructs block parameter keys must be updated accordingly.
Chase the API change in the 'Summary' constructor and update unit
tests as needed.
2019-09-27 09:50:42 -05:00
|
|
|
BOOST_CHECK( summary.hasSummaryKey( "BSGAS:523" ) );
|
2017-02-06 16:52:39 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto input = "RPR\n/\n";
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
BOOST_CHECK( summary.require3DField( "PRESSURE"));
|
|
|
|
BOOST_CHECK( summary.requireFIPNUM( ));
|
2017-05-25 16:39:45 -05:00
|
|
|
BOOST_CHECK( summary.hasKeyword( "RPR" ) );
|
|
|
|
BOOST_CHECK( summary.hasSummaryKey( "RPR:1" ) );
|
|
|
|
BOOST_CHECK( summary.hasSummaryKey( "RPR:3" ) );
|
|
|
|
BOOST_CHECK( !summary.hasSummaryKey( "RPR:4" ) );
|
2017-02-06 16:52:39 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-05-25 16:39:45 -05:00
|
|
|
{
|
|
|
|
const auto input = "RPR\n 10 /\n";
|
|
|
|
BOOST_CHECK_THROW( createSummary( input ) , std::invalid_argument );
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
2017-02-06 16:52:39 -06:00
|
|
|
{
|
|
|
|
const auto input = "RGIPL\n/\n";
|
|
|
|
const auto summary = createSummary( input );
|
|
|
|
BOOST_CHECK( summary.require3DField( "GIPL"));
|
|
|
|
BOOST_CHECK( summary.requireFIPNUM( ));
|
|
|
|
}
|
|
|
|
}
|
2017-05-25 16:39:45 -05:00
|
|
|
|
2017-05-29 10:09:12 -05:00
|
|
|
|
|
|
|
BOOST_AUTO_TEST_CASE( SUMMARY_MISC) {
|
2017-05-30 00:22:08 -05:00
|
|
|
{
|
|
|
|
const auto summary = createSummary( "TCPU\n" );
|
|
|
|
BOOST_CHECK( summary.hasKeyword( "TCPU" ) );
|
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
const auto summary = createSummary( "PERFORMA\n" );
|
|
|
|
BOOST_CHECK( summary.hasKeyword( "ELAPSED" ) );
|
|
|
|
BOOST_CHECK( !summary.hasKeyword("PERFORMA"));
|
|
|
|
}
|
2017-05-29 10:09:12 -05:00
|
|
|
}
|
|
|
|
|
2018-10-04 14:31:05 -05:00
|
|
|
BOOST_AUTO_TEST_CASE(Summary_Segment)
|
|
|
|
{
|
|
|
|
const auto input = std::string { "SOFR_TEST.DATA" };
|
2019-01-03 11:05:19 -06:00
|
|
|
const auto deck = Parser{}.parseFile(input);
|
|
|
|
const auto state = EclipseState { deck };
|
2018-10-04 14:31:05 -05:00
|
|
|
|
2019-01-03 11:05:19 -06:00
|
|
|
const auto schedule = Schedule { deck, state};
|
2018-10-04 14:31:05 -05:00
|
|
|
const auto summary = SummaryConfig {
|
2019-01-03 11:05:19 -06:00
|
|
|
deck, schedule, state.getTableManager()
|
2018-10-04 14:31:05 -05:00
|
|
|
};
|
|
|
|
|
2018-10-09 14:10:28 -05:00
|
|
|
// SOFR PROD01 segments 1, 10, 21.
|
2018-10-04 14:31:05 -05:00
|
|
|
BOOST_CHECK(deck.hasKeyword("SOFR"));
|
|
|
|
BOOST_CHECK(summary.hasKeyword("SOFR"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SOFR:PROD01:1"));
|
2018-10-09 14:10:28 -05:00
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:2"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:3"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:4"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:5"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:6"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:7"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:8"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:9"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SOFR:PROD01:10"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:11"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:12"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:13"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:14"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:15"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:16"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:17"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:18"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:19"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:20"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SOFR:PROD01:21"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:22"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:23"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:24"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:25"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:26"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:PROD01:27"));
|
|
|
|
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SOFR:INJE01:1"));
|
2018-10-04 14:31:05 -05:00
|
|
|
|
|
|
|
{
|
2018-10-09 14:10:28 -05:00
|
|
|
auto sofr = std::find_if(summary.begin(), summary.end(),
|
|
|
|
[](const SummaryNode& node)
|
|
|
|
{
|
|
|
|
return node.keyword() == "SOFR";
|
|
|
|
});
|
2018-10-04 14:31:05 -05:00
|
|
|
|
2018-10-09 14:10:28 -05:00
|
|
|
BOOST_REQUIRE(sofr != summary.end());
|
2018-10-04 14:31:05 -05:00
|
|
|
|
Decouple SummaryConfig From LibECL
This commit reimplements the SummaryNode class in order not to use
the ecl::smspec_node class from LibECL. Consequently, we remove
class SummaryConfig's binding to LibECL.
Class SummaryNode maintains the same information as before. We also
implement a "named constructor" strategy to assign data members that
only make sense for a subset of the node categories. The previous
member function 'type' is renamed to 'category' to identify the
attachment category (e.g., Well, Group, Field, Block, Region). In
turn, we introduce a new 'type' member function to identify the
parameter kind (e.g, pressure, rate, cumulative total, well count)
represented by a given node. We furthermore capture whether or not
the node is a user defined quantity (i.e., a UDQ).
We reimplement the keyword classifier operations that are currently
needed as free functions named 'is_*()' in SummaryConfig.cpp.
Note that in addition to the renamed member functions of class
SummaryNode, this commit also switches the summary key strategy for
block parameters. Rather than capturing the 'ijk' values
individually as "BOSAT:3,3,6", we now store the equivalent global
(Cartesian) index (i.e., as "BOSAT:523"). Code that directly
constructs block parameter keys must be updated accordingly.
Chase the API change in the 'Summary' constructor and update unit
tests as needed.
2019-09-27 09:50:42 -05:00
|
|
|
BOOST_CHECK_MESSAGE(sofr->category() == SummaryNode::Category::Segment,
|
|
|
|
R"("SOFR" keyword category must be "Segment")"
|
|
|
|
);
|
|
|
|
BOOST_CHECK_EQUAL(sofr->namedEntity(), "PROD01");
|
2018-10-09 14:10:28 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
BOOST_CHECK(deck.hasKeyword("SGFR"));
|
|
|
|
BOOST_CHECK(summary.hasKeyword("SGFR"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:1"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:2"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:3"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:4"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:5"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:6"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:7"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:8"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:9"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:10"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:11"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:12"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:13"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:14"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:15"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:16"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:17"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:18"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:19"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:20"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:21"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:22"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:23"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:24"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:25"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SGFR:PROD01:26"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SGFR:PROD01:27")); // No such segment.
|
|
|
|
|
|
|
|
// SPR PROD01 segment 10 only.
|
|
|
|
BOOST_CHECK(deck.hasKeyword("SPR"));
|
|
|
|
BOOST_CHECK(summary.hasKeyword("SPR"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:1"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:2"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:3"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:4"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:5"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:6"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:7"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:8"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:9"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SPR:PROD01:10"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:11"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:12"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:13"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:14"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:15"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:16"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:17"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:18"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:19"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:20"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:21"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:22"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:23"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:24"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:25"));
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:PROD01:26"));
|
|
|
|
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SPR:INJE01:10"));
|
|
|
|
|
|
|
|
// SWFR for all segments in all MS wells.
|
|
|
|
BOOST_CHECK(deck.hasKeyword("SWFR"));
|
|
|
|
BOOST_CHECK(summary.hasKeyword("SWFR"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:1"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:2"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:3"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:4"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:5"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:6"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:7"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:8"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:9"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:10"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:11"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:12"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:13"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:14"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:15"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:16"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:17"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:18"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:19"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:20"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:21"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:22"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:23"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:24"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:25"));
|
|
|
|
BOOST_CHECK(summary.hasSummaryKey("SWFR:PROD01:26"));
|
|
|
|
|
|
|
|
BOOST_CHECK(!summary.hasSummaryKey("SWFR:INJE01:1"));
|
2018-10-04 14:31:05 -05:00
|
|
|
}
|