From fea4c4c8fa593509ce8c03a3badafc58fb3b601d Mon Sep 17 00:00:00 2001 From: Kai Bao Date: Wed, 7 Mar 2018 09:42:55 +0100 Subject: [PATCH] adding support for WSEGSICD --- CMakeLists_files.cmake | 2 + .../EclipseState/Schedule/MSW/Segment.hpp | 13 ++ .../EclipseState/Schedule/MSW/SpiralICD.hpp | 76 +++++++++ .../Schedule/MSW/WellSegments.hpp | 2 + .../EclipseState/Schedule/Schedule.hpp | 2 + .../EclipseState/Schedule/MSW/Segment.cpp | 16 ++ .../EclipseState/Schedule/MSW/SpiralICD.cpp | 150 ++++++++++++++++++ .../EclipseState/Schedule/Schedule.cpp | 33 ++++ tests/parser/MultisegmentWellTests.cpp | 11 +- tests/parser/WellTests.cpp | 3 + .../SCHEDULE/SCHEDULE_MULTISEGMENT_WELL | 9 +- tests/parser/integration/ParseKEYWORD.cpp | 24 ++- 12 files changed, 336 insertions(+), 5 deletions(-) create mode 100644 opm/parser/eclipse/EclipseState/Schedule/MSW/SpiralICD.hpp create mode 100644 src/opm/parser/eclipse/EclipseState/Schedule/MSW/SpiralICD.cpp diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index 24c2ef1b8..350030677 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -108,6 +108,7 @@ if(ENABLE_ECL_INPUT) src/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.cpp src/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.cpp src/opm/parser/eclipse/EclipseState/Schedule/MSW/updatingConnectionsWithSegments.cpp + src/opm/parser/eclipse/EclipseState/Schedule/MSW/SpiralICD.cpp src/opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.cpp src/opm/parser/eclipse/EclipseState/Schedule/RFTConfig.cpp src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp @@ -636,6 +637,7 @@ if(ENABLE_ECL_INPUT) opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp opm/parser/eclipse/EclipseState/Schedule/MSW/updatingConnectionsWithSegments.hpp + opm/parser/eclipse/EclipseState/Schedule/MSW/SpiralICD.hpp opm/parser/eclipse/EclipseState/SimulationConfig/ThresholdPressure.hpp opm/parser/eclipse/EclipseState/SimulationConfig/SimulationConfig.hpp opm/parser/eclipse/EclipseState/IOConfig/RestartConfig.hpp diff --git a/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp b/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp index dc6f11ece..2aa7be2d0 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.hpp @@ -22,6 +22,8 @@ #include #include +#include +#include namespace Opm { @@ -42,6 +44,7 @@ namespace Opm { double crossArea() const; double volume() const; bool dataReady() const; + WellSegment::SegmentType segmentType() const; void setVolume(const double volume_in); void setDepthAndLength(const double depth_in, const double length_in); @@ -54,6 +57,9 @@ namespace Opm { bool operator==( const Segment& ) const; bool operator!=( const Segment& ) const; + void updateSpiralICD(const SpiralICD& spiral_icd); + + const std::shared_ptr& spiralICD() const; private: // segment number @@ -100,6 +106,13 @@ namespace Opm { // indicate if the data related to 'INC' or 'ABS' is ready // the volume will be updated at a final step. bool m_data_ready; + // indicate the type of the segment + // regular or spiral ICD + WellSegment::SegmentType m_segment_type = WellSegment::REGULAR; + + // information related to SpiralICD. It is nullptr for segments are not + // spiral ICD type + std::shared_ptr m_spiral_icd; static constexpr double invalid_value = -1.e100; // We are not handling the length of segment projected onto the X-axis and Y-axis. diff --git a/opm/parser/eclipse/EclipseState/Schedule/MSW/SpiralICD.hpp b/opm/parser/eclipse/EclipseState/Schedule/MSW/SpiralICD.hpp new file mode 100644 index 000000000..3cebeabc5 --- /dev/null +++ b/opm/parser/eclipse/EclipseState/Schedule/MSW/SpiralICD.hpp @@ -0,0 +1,76 @@ +/* + Copyright 2017 SINTEF Digital, Mathematics and Cybernetics. + + 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 . +*/ + +#ifndef SPIRALICD_HPP_HEADER_INCLUDED +#define SPIRALICD_HPP_HEADER_INCLUDED + +#include +#include +#include + + +namespace Opm { + + class DeckRecord; + class DeckKeyword; + + class SpiralICD { + public: + explicit SpiralICD(const DeckRecord& record); + + // the function will return a map + // [ + // "WELL1" : [, ...] + // .... + static std::map > > + fromWSEGSICD(const DeckKeyword& wsegsicd); + + double maxAbsoluteRate() const; + const std::string& status() const; + double strength() const; + double length() const; + double densityCalibration() const; + double viscosityCalibration() const; + double criticalValue() const; + double widthTransitionRegion() const; + double maxViscosityRatio() const; + double methodFlowScaling() const; + + void updateScalingFactor(const double segment_length, const double completion_length); + double scalingFactor() const; + + private: + double m_strength; + double m_length; + double m_density_calibration; + double m_viscosity_calibration; + double m_critical_value; + double m_width_transition_region; + double m_max_viscosity_ratio; + int m_method_flow_scaling; + double m_max_absolute_rate; + std::string m_status; + // scaling factor is the only one can not be gotten from deck directly, needs to be + // updated afterwards + double m_scaling_fractor; +}; + +} + +#endif diff --git a/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp b/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp index 64dbbdd2a..1805e76ce 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp @@ -83,6 +83,8 @@ namespace Opm { bool operator==( const WellSegments& ) const; bool operator!=( const WellSegments& ) const; + double segmentLength(const int segment_number) const; + private: void processABS(); void processINC(const bool first_time); diff --git a/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp b/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp index 7e699a68a..ea57fcb96 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp @@ -277,6 +277,7 @@ namespace Opm void handleCOMPLUMP( const DeckKeyword& keyword, size_t currentStep ); void handleWELSEGS( const DeckKeyword& keyword, size_t currentStep); void handleCOMPSEGS( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid, const ParseContext& parseContext, ErrorGuard& errors); + void handleWSEGSICD( const DeckKeyword& keyword, size_t currentStep); void handleWCONINJE( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors); void handleWFOAM( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors); void handleWPOLYMER( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors); @@ -297,6 +298,7 @@ namespace Opm void handleGUIDERAT( const DeckKeyword& keyword, size_t currentStep); void handleLINCOM( const DeckKeyword& keyword, size_t currentStep); void handleWEFAC( const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors); + void handleTUNING( const DeckKeyword& keyword, size_t currentStep); void handleNUPCOL( const DeckKeyword& keyword, size_t currentStep); void handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, const UnitSystem& unit_system, const ParseContext& parseContext, ErrorGuard& errors); diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.cpp index 583dbbe5f..e90abca5a 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/MSW/Segment.cpp @@ -99,6 +99,10 @@ namespace Opm { return m_data_ready; } + WellSegment::SegmentType Segment::segmentType() const { + return m_segment_type; + } + void Segment::setDepthAndLength(const double depth_in, const double length_in) { m_total_length = length_in; m_depth = depth_in; @@ -137,4 +141,16 @@ namespace Opm { bool Segment::operator!=( const Segment& rhs ) const { return !this->operator==(rhs); } + + void Segment::updateSpiralICD(const SpiralICD& spiral_icd) { + m_segment_type = WellSegment::SPIRALICD; + m_spiral_icd = std::make_shared(spiral_icd); + } + + const std::shared_ptr& Segment::spiralICD() const { + return m_spiral_icd; + } + + + } diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/MSW/SpiralICD.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/MSW/SpiralICD.cpp new file mode 100644 index 000000000..41ec7cb4f --- /dev/null +++ b/src/opm/parser/eclipse/EclipseState/Schedule/MSW/SpiralICD.cpp @@ -0,0 +1,150 @@ +/* + Copyright 2017 SINTEF Digital, Mathematics and Cybernetics. + + 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 . +*/ + +#include +#include +#include + +#include +#include + + +namespace Opm { + + SpiralICD::SpiralICD(const DeckRecord& record) + : m_strength(record.getItem("STRENGTH").getSIDouble(0)), + m_length(record.getItem("LENGTH").getSIDouble(0)), + m_density_calibration(record.getItem("DENSITY_CALI").getSIDouble(0)), + m_viscosity_calibration(record.getItem("VISCOSITY_CALI").getSIDouble(0)), + m_critical_value(record.getItem("CRITICAL_VALUE").getSIDouble(0)), + m_width_transition_region(record.getItem("WIDTH_TRANS").get(0)), + m_max_viscosity_ratio(record.getItem("MAX_VISC_RATIO").get(0)), + m_method_flow_scaling(record.getItem("METHOD_SCALING_FACTOR").get(0)), + m_max_absolute_rate(record.getItem("MAX_ABS_RATE").hasValue(0) + ? record.getItem("MAX_ABS_RATE").getSIDouble(0) + : std::numeric_limits::max()), + m_status(record.getItem("STATUS").getTrimmedString(0)), + m_scaling_fractor(std::numeric_limits::lowest()) + { + } + + std::map > > + SpiralICD::fromWSEGSICD(const DeckKeyword& wsegsicd) + { + std::map > > res; + + for (const DeckRecord &record : wsegsicd) { + const std::string well_name = record.getItem("WELL").getTrimmedString(0); + + const int start_segment = record.getItem("SEG1").get(0); + const int end_segment = record.getItem("SEG2").get(0); + + if (start_segment < 2 || end_segment < 2 || end_segment < start_segment) { + const std::string message = "Segment numbers " + std::to_string(start_segment) + " and " + + std::to_string(end_segment) + " specified in WSEGSICD for well " + + well_name + + " are illegal "; + throw std::invalid_argument(message); + } + + const SpiralICD spiral_icd(record); + for (int seg = start_segment; seg <= end_segment; seg++) { + res[well_name].push_back(std::make_pair(seg, spiral_icd)); + } + } + + return res; + } + + double SpiralICD::maxAbsoluteRate() const { + return m_max_absolute_rate; + } + + const std::string &SpiralICD::status() const { + return m_status; + } + + double SpiralICD::strength() const { + return m_strength; + } + + double SpiralICD::length() const { + return m_length; + } + + double SpiralICD::densityCalibration() const { + return m_density_calibration; + } + + double SpiralICD::viscosityCalibration() const + { + return m_viscosity_calibration; + } + + double SpiralICD::criticalValue() const { + return m_critical_value; + } + + double SpiralICD::widthTransitionRegion() const + { + return m_width_transition_region; + } + + double SpiralICD::maxViscosityRatio() const + { + return m_max_viscosity_ratio; + } + + double SpiralICD::methodFlowScaling() const + { + return m_method_flow_scaling; + } + + double SpiralICD::scalingFactor() const + { + if (m_scaling_fractor <= 0.) + throw std::runtime_error("the scaling factor has invalid value " + std::to_string(m_scaling_fractor)); + + return m_scaling_fractor; + } + + void SpiralICD::updateScalingFactor(const double outlet_segment_length, const double completion_length) + { + if (m_method_flow_scaling < 0) { + if (m_length > 0.) { // icd length / outlet segment length + m_scaling_fractor = m_length / outlet_segment_length; + } else if (m_length < 0.) { + m_scaling_fractor = std::abs(m_length); + } else { // icd length is zero, not sure the proper way to handle this yet + throw std::logic_error("Zero-value length of SICD is found when calcuating scaling factor"); + } + } else if (m_method_flow_scaling == 0) { + if (m_length <= 0.) + throw std::logic_error("Non positive length of SICD if found when method of scaling is zero"); + + m_scaling_fractor = m_length / outlet_segment_length; + } else if (m_method_flow_scaling == 1) { + m_scaling_fractor = std::abs(m_length); + } else if (m_method_flow_scaling == 2) { + m_scaling_fractor = m_length / completion_length; + } else { + throw std::logic_error(" invalid method specified to calculate flow scaling factor for SICD"); + } + } +} diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp index e43c4006c..22e95ee30 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp @@ -325,6 +325,9 @@ namespace { else if (keyword.name() == "COMPSEGS") handleCOMPSEGS(keyword, currentStep, grid, parseContext, errors); + else if (keyword.name() == "WSEGSICD") + handleWSEGSICD(keyword, currentStep); + else if (keyword.name() == "WELOPEN") handleWELOPEN(keyword, currentStep, parseContext, errors); @@ -417,6 +420,7 @@ namespace { } else { std::string msg = "OPM does not support grid property modifier " + keyword.name() + " in the Schedule section. Error at report: " + std::to_string( currentStep ); parseContext.handleError( ParseContext::UNSUPPORTED_SCHEDULE_GEO_MODIFIER , msg, errors ); + } } } @@ -1961,6 +1965,35 @@ namespace { } } + void Schedule::handleWSEGSICD( const DeckKeyword& keyword, size_t currentStep) { + + const std::map > > spiral_icds = + SpiralICD::fromWSEGSICD(keyword); + + for (const auto& map_elem : spiral_icds) { + const std::string& well_name = map_elem.first; + const std::vector >& sicd_pairs = map_elem.second; + Well& well = this->m_wells.get( well_name ); + SegmentSet segment_set = well.getSegmentSet(currentStep); + // to have spiral ICD devices, frictional pressure drop must be activated + if (segment_set.compPressureDrop() == WellSegment::H__) { + const std::string msg = "to use spiral ICD segment for well " + well_name + + " , you have to activate the frictional pressure drop calculation"; + throw std::runtime_error(msg); + } + + for (const auto& pair_elem : sicd_pairs) { + const int segment_number = pair_elem.first; + const SpiralICD& spiral_icd = pair_elem.second; + Segment segment = segment_set.getFromSegmentNumber(segment_number); + segment.updateSpiralICD(spiral_icd); + segment_set.addSegment(segment); + } + // update the segment set with new information + well.updateSegmentSet(currentStep, segment_set); + } + } + void Schedule::handleWGRUPCON( const DeckKeyword& keyword, size_t currentStep) { for( const auto& record : keyword ) { const auto well_names = this->wellNames(record.getItem("WELL").getTrimmedString(0), currentStep); diff --git a/tests/parser/MultisegmentWellTests.cpp b/tests/parser/MultisegmentWellTests.cpp index d841a643b..fc4c17a53 100644 --- a/tests/parser/MultisegmentWellTests.cpp +++ b/tests/parser/MultisegmentWellTests.cpp @@ -42,6 +42,7 @@ #include BOOST_AUTO_TEST_CASE(MultisegmentWellTest) { + auto dir = Opm::Connection::Direction::Z; Opm::WellConnections connection_set(10,10); Opm::EclipseGrid grid(20,20,20); @@ -58,12 +59,13 @@ BOOST_AUTO_TEST_CASE(MultisegmentWellTest) { const std::string compsegs_string = "WELSEGS \n" - "'PROD01' 2512.5 2512.5 1.0e-5 'ABS' 'H--' 'HO' /\n" + "'PROD01' 2512.5 2512.5 1.0e-5 'ABS' 'HF-' 'HO' /\n" "2 2 1 1 2537.5 2537.5 0.3 0.00010 /\n" "3 3 1 2 2562.5 2562.5 0.2 0.00010 /\n" "4 4 2 2 2737.5 2537.5 0.2 0.00010 /\n" "6 6 2 4 3037.5 2539.5 0.2 0.00010 /\n" "7 7 2 6 3337.5 2534.5 0.2 0.00010 /\n" + "8 8 3 7 3337.6 2534.5 0.2 0.00015 /\n" "/\n" "\n" "COMPSEGS\n" @@ -74,7 +76,10 @@ BOOST_AUTO_TEST_CASE(MultisegmentWellTest) { "19 1 2 2 2637.5 2837.5 /\n" "18 1 2 2 2837.5 3037.5 /\n" "17 1 2 2 3037.5 3237.5 /\n" - "16 1 2 2 3237.5 3437.5 /\n" + "16 1 2 3 3237.5 3437.5 /\n" + "/\n" + "WSEGSICD\n" + "'PROD01' 8 8 0.002 -0.7 1* 1* 0.6 1* 1* 2* 'SHUT' /\n" "/\n"; Opm::Parser parser; @@ -85,6 +90,7 @@ BOOST_AUTO_TEST_CASE(MultisegmentWellTest) { Opm::WellSegments segment_set; const Opm::DeckKeyword welsegs = deck.getKeyword("WELSEGS"); + segment_set.loadWELSEGS(welsegs); BOOST_CHECK_EQUAL(6U, segment_set.size()); @@ -127,6 +133,7 @@ BOOST_AUTO_TEST_CASE(MultisegmentWellTest) { const double center_depth_connection7 = connection7.depth(); BOOST_CHECK_EQUAL(segment_number_connection7, 7); BOOST_CHECK_EQUAL(center_depth_connection7, 2534.5); + } BOOST_AUTO_TEST_CASE(WrongDistanceCOMPSEGS) { diff --git a/tests/parser/WellTests.cpp b/tests/parser/WellTests.cpp index 7d68f37ab..8cbf58ede 100644 --- a/tests/parser/WellTests.cpp +++ b/tests/parser/WellTests.cpp @@ -219,6 +219,7 @@ BOOST_AUTO_TEST_CASE(isProducerCorrectlySet) { } + { Opm::Well well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0); @@ -295,12 +296,14 @@ BOOST_AUTO_TEST_CASE(XHPLimitDefault) { BOOST_AUTO_TEST_CASE(InjectorType) { Opm::Well well("WELL1", "GROUP", 0, 1, 23, 42, 2334.32, Opm::Phase::WATER, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0); + auto injectionProps = std::make_shared(well.getInjectionProperties()); injectionProps->injectorType = Opm::Well::InjectorType::WATER; well.updateInjection(injectionProps); // TODO: Should we test for something other than wate here, as long as // the default value for InjectorType is WellInjector::WATER? BOOST_CHECK( Opm::Well::InjectorType::WATER == well.getInjectionProperties().injectorType); + } diff --git a/tests/parser/data/integration_tests/SCHEDULE/SCHEDULE_MULTISEGMENT_WELL b/tests/parser/data/integration_tests/SCHEDULE/SCHEDULE_MULTISEGMENT_WELL index 56a656133..423487a53 100644 --- a/tests/parser/data/integration_tests/SCHEDULE/SCHEDULE_MULTISEGMENT_WELL +++ b/tests/parser/data/integration_tests/SCHEDULE/SCHEDULE_MULTISEGMENT_WELL @@ -59,12 +59,13 @@ COMPDAT / WELSEGS - 'PROD01' 2512.5 2512.5 1.0e-5 'ABS' 'H--' 'HO' / + 'PROD01' 2512.5 2512.5 1.0e-5 'ABS' 'HF-' 'HO' / 2 2 1 1 2537.5 2537.5 0.3 0.00010 / 3 3 1 2 2562.5 2562.5 0.2 0.00010 / 4 4 2 2 2737.5 2537.5 0.2 0.00010 / 6 6 2 4 3037.5 2539.5 0.2 0.00010 / 7 7 2 6 3337.5 2534.5 0.2 0.00010 / + 8 8 3 7 3337.6 2534.5 0.2 0.00015 / / COMPSEGS @@ -75,5 +76,9 @@ COMPSEGS 19 1 2 2 2637.5 2837.5 / 18 1 2 2 2837.5 3037.5 / 17 1 2 2 3037.5 3237.5 / - 16 1 2 2 3237.5 3437.5 / + 16 1 2 3 3237.5 3437.5 / +/ + +WSEGSICD + 'PROD01' 8 8 0.002 -0.7 1* 1* 0.6 1* 1* 2* 'SHUT' / / diff --git a/tests/parser/integration/ParseKEYWORD.cpp b/tests/parser/integration/ParseKEYWORD.cpp index 40a1c6c83..267bb458a 100644 --- a/tests/parser/integration/ParseKEYWORD.cpp +++ b/tests/parser/integration/ParseKEYWORD.cpp @@ -455,7 +455,7 @@ BOOST_AUTO_TEST_CASE( MULTISEGMENT_ABS ) { // for WELSEGS keyword const auto& kw = deck.getKeyword("WELSEGS"); - BOOST_CHECK_EQUAL( 6, kw.size() ); + BOOST_CHECK_EQUAL( 7, kw.size() ); // check the information for the top segment and the segment set { @@ -523,6 +523,26 @@ BOOST_AUTO_TEST_CASE( MULTISEGMENT_ABS ) { BOOST_CHECK_EQUAL( 0.0001, roughness ); } + { + const auto& rec7 = kw.getRecord(6); + const int segment1 = rec7.getItem("SEGMENT2").get< int >(0); + const int segment2 = rec7.getItem("SEGMENT2").get< int >(0); + BOOST_CHECK_EQUAL( 8, segment1 ); + BOOST_CHECK_EQUAL( 8, segment2 ); + const int branch = rec7.getItem("BRANCH").get< int >(0); + const int outlet_segment = rec7.getItem("JOIN_SEGMENT").get< int >(0); + const double segment_length = rec7.getItem("SEGMENT_LENGTH").get< double >(0); + const double depth_change = rec7.getItem("DEPTH_CHANGE").get< double >(0); + const double diameter = rec7.getItem("DIAMETER").get< double >(0); + const double roughness = rec7.getItem("ROUGHNESS").get< double >(0); + BOOST_CHECK_EQUAL( 3, branch ); + BOOST_CHECK_EQUAL( 7, outlet_segment ); + BOOST_CHECK_EQUAL( 3337.6, segment_length ); + BOOST_CHECK_EQUAL( 2534.5, depth_change ); + BOOST_CHECK_EQUAL( 0.2, diameter ); + BOOST_CHECK_EQUAL( 0.00015, roughness ); + } + // for COMPSEG keyword const auto& kw1 = deck.getKeyword("COMPSEGS"); // check the size of the keywords @@ -569,6 +589,7 @@ BOOST_AUTO_TEST_CASE( MULTISEGMENT_ABS ) { BOOST_CHECK_EQUAL( 3237.5, distance_end ); } + const EclipseState state(deck); const auto& grid = state.getInputGrid(); const TableManager table ( deck ); @@ -606,6 +627,7 @@ BOOST_AUTO_TEST_CASE( MULTISEGMENT_ABS ) { const double connection3_depth = connection3.depth(); BOOST_CHECK_EQUAL(seg_number_connection3, 3); BOOST_CHECK_EQUAL(connection3_depth, 2562.5); + } BOOST_AUTO_TEST_CASE( PLYADS ) {