2019-08-05 14:53:48 -05:00
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
|
|
|
#include "RiaSummaryCurveAnalyzer.h"
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
TEST( RiaSummaryCurveAnalyzer, WellCompletions )
|
2019-08-05 14:53:48 -05:00
|
|
|
{
|
|
|
|
std::vector<RifEclipseSummaryAddress> addresses;
|
|
|
|
|
|
|
|
// Well A
|
|
|
|
std::string wellNameA = "well_name_a";
|
|
|
|
{
|
2020-02-12 04:43:15 -06:00
|
|
|
RifEclipseSummaryAddress adr =
|
|
|
|
RifEclipseSummaryAddress::wellCompletionAddress( "quantity_name", wellNameA, 1, 2, 3 );
|
2019-09-06 03:40:57 -05:00
|
|
|
addresses.push_back( adr );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
{
|
2020-02-12 04:43:15 -06:00
|
|
|
RifEclipseSummaryAddress adr =
|
|
|
|
RifEclipseSummaryAddress::wellCompletionAddress( "quantity_name", wellNameA, 1, 2, 3 );
|
2019-09-06 03:40:57 -05:00
|
|
|
addresses.push_back( adr );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
{
|
2020-02-12 04:43:15 -06:00
|
|
|
RifEclipseSummaryAddress adr =
|
|
|
|
RifEclipseSummaryAddress::wellCompletionAddress( "quantity_name", wellNameA, 5, 2, 3 );
|
2019-09-06 03:40:57 -05:00
|
|
|
addresses.push_back( adr );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Well B
|
|
|
|
std::string wellNameB = "well_name_b";
|
|
|
|
{
|
2020-02-12 04:43:15 -06:00
|
|
|
RifEclipseSummaryAddress adr =
|
|
|
|
RifEclipseSummaryAddress::wellCompletionAddress( "quantity_name", wellNameB, 5, 2, 3 );
|
2019-09-06 03:40:57 -05:00
|
|
|
addresses.push_back( adr );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
{
|
2020-02-12 04:43:15 -06:00
|
|
|
RifEclipseSummaryAddress adr =
|
|
|
|
RifEclipseSummaryAddress::wellCompletionAddress( "quantity_name", wellNameB, 5, 4, 3 );
|
2019-09-06 03:40:57 -05:00
|
|
|
addresses.push_back( adr );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
{
|
2019-11-04 08:08:09 -06:00
|
|
|
RifEclipseSummaryAddress adr =
|
|
|
|
RifEclipseSummaryAddress::wellCompletionAddress( "quantity_name", wellNameB, 5, 4, 30 );
|
2019-09-06 03:40:57 -05:00
|
|
|
addresses.push_back( adr );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
RiaSummaryCurveAnalyzer analyzer;
|
2019-10-04 02:09:22 -05:00
|
|
|
analyzer.appendAddresses( addresses );
|
2019-08-05 14:53:48 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
EXPECT_EQ( 2u, analyzer.wellNames().size() );
|
2019-08-05 14:53:48 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
auto completionsForA = analyzer.wellCompletions( wellNameA );
|
|
|
|
EXPECT_EQ( 2u, completionsForA.size() );
|
2019-08-05 14:53:48 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
auto completionsForB = analyzer.wellCompletions( wellNameB );
|
|
|
|
EXPECT_EQ( 3u, completionsForB.size() );
|
2019-08-05 14:53:48 -05:00
|
|
|
std::string tupleToFind = "5, 4, 30";
|
2019-09-06 03:40:57 -05:00
|
|
|
EXPECT_TRUE( completionsForB.find( tupleToFind ) != completionsForB.end() );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
TEST( RiaSummaryCurveAnalyzer, WellSegments )
|
2019-08-05 14:53:48 -05:00
|
|
|
{
|
|
|
|
std::vector<RifEclipseSummaryAddress> addresses;
|
|
|
|
|
|
|
|
// Well A
|
|
|
|
std::string wellNameA = "well_name_a";
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RifEclipseSummaryAddress adr = RifEclipseSummaryAddress::wellSegmentAddress( "quantity_name", wellNameA, 1 );
|
|
|
|
addresses.push_back( adr );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RifEclipseSummaryAddress adr = RifEclipseSummaryAddress::wellSegmentAddress( "quantity_name", wellNameA, 1 );
|
|
|
|
addresses.push_back( adr );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RifEclipseSummaryAddress adr = RifEclipseSummaryAddress::wellSegmentAddress( "quantity_name", wellNameA, 30 );
|
|
|
|
addresses.push_back( adr );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// Well B
|
|
|
|
std::string wellNameB = "well_name_b";
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RifEclipseSummaryAddress adr = RifEclipseSummaryAddress::wellSegmentAddress( "quantity_name", wellNameB, 1 );
|
|
|
|
addresses.push_back( adr );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RifEclipseSummaryAddress adr = RifEclipseSummaryAddress::wellSegmentAddress( "quantity_name", wellNameB, 3 );
|
|
|
|
addresses.push_back( adr );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RifEclipseSummaryAddress adr = RifEclipseSummaryAddress::wellSegmentAddress( "quantity_name", wellNameB, 10 );
|
|
|
|
addresses.push_back( adr );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
RiaSummaryCurveAnalyzer analyzer;
|
2019-10-04 02:09:22 -05:00
|
|
|
analyzer.appendAddresses( addresses );
|
2019-08-05 14:53:48 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
EXPECT_EQ( 2u, analyzer.wellNames().size() );
|
2019-08-05 14:53:48 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
auto segmentsForA = analyzer.wellSegmentNumbers( wellNameA );
|
|
|
|
EXPECT_EQ( 2u, segmentsForA.size() );
|
2019-08-05 14:53:48 -05:00
|
|
|
|
2019-09-06 03:40:57 -05:00
|
|
|
auto segmentsForB = analyzer.wellSegmentNumbers( wellNameB );
|
|
|
|
EXPECT_EQ( 3u, segmentsForB.size() );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2019-09-06 03:40:57 -05:00
|
|
|
TEST( RiaSummaryCurveAnalyzer, CellBlocks )
|
2019-08-05 14:53:48 -05:00
|
|
|
{
|
|
|
|
std::vector<RifEclipseSummaryAddress> addresses;
|
|
|
|
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RifEclipseSummaryAddress adr = RifEclipseSummaryAddress::blockAddress( "quantity_name", 1, 2, 3 );
|
|
|
|
addresses.push_back( adr );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RifEclipseSummaryAddress adr = RifEclipseSummaryAddress::blockAddress( "quantity_name", 1, 2, 3 );
|
|
|
|
addresses.push_back( adr );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RifEclipseSummaryAddress adr = RifEclipseSummaryAddress::blockAddress( "quantity_name", 2, 2, 3 );
|
|
|
|
addresses.push_back( adr );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
{
|
2019-09-06 03:40:57 -05:00
|
|
|
RifEclipseSummaryAddress adr = RifEclipseSummaryAddress::blockAddress( "quantity_name", 5, 2, 3 );
|
|
|
|
addresses.push_back( adr );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
RiaSummaryCurveAnalyzer analyzer;
|
2019-10-04 02:09:22 -05:00
|
|
|
analyzer.appendAddresses( addresses );
|
2019-08-05 14:53:48 -05:00
|
|
|
|
|
|
|
auto blocks = analyzer.blocks();
|
2019-09-06 03:40:57 -05:00
|
|
|
EXPECT_EQ( 3u, blocks.size() );
|
2019-08-05 14:53:48 -05:00
|
|
|
}
|