diff --git a/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp b/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp index d92c3c3fe..6c41bd91b 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp @@ -179,7 +179,8 @@ namespace Opm { msg); throw std::invalid_argument(msg); } - if (well->getRefDepthDefaulted() != record->getItem("REF_DEPTH")->defaultApplied(0)) { + + if (well->getRefDepthDefaulted() == record->getItem("REF_DEPTH")->hasValue(0)) { std::string msg = "Unable process WELSPECS for well " + well->name() + ", REF_DEPTH defaulted state deviates from existing value"; logger->addError(keyword->getFileName(), @@ -610,20 +611,18 @@ namespace Opm { } void Schedule::addWell(const std::string& wellName, DeckRecordConstPtr record, size_t timeStep) { - // We change from eclipse's 1 - n, to a 0 - n-1 solution int headI = record->getItem("HEAD_I")->getInt(0) - 1; int headJ = record->getItem("HEAD_J")->getInt(0) - 1; Phase::PhaseEnum preferredPhase = Phase::PhaseEnumFromString(record->getItem("PHASE")->getTrimmedString(0)); + Value refDepth("REF_DEPTH"); WellPtr well; + auto refDepthItem = record->getItem("REF_DEPTH"); - if (!record->getItem("REF_DEPTH")->defaultApplied(0)) { - double refDepth = record->getItem("REF_DEPTH")->getSIDouble(0); - well = std::make_shared(wellName, headI, headJ, refDepth, preferredPhase, m_timeMap , timeStep); - } else { - well = std::make_shared(wellName, headI, headJ, preferredPhase, m_timeMap , timeStep); - } + if (refDepthItem->hasValue(0)) + refDepth.setValue( refDepthItem->getSIDouble(0)); + well = std::make_shared(wellName, headI, headJ, refDepth, preferredPhase, m_timeMap , timeStep); m_wells.insert( wellName , well); } diff --git a/opm/parser/eclipse/EclipseState/Schedule/Well.cpp b/opm/parser/eclipse/EclipseState/Schedule/Well.cpp index 93e8645b4..ff569c957 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Well.cpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Well.cpp @@ -19,6 +19,7 @@ #include +#include #include #include #include @@ -27,7 +28,7 @@ namespace Opm { - Well::Well(const std::string& name_, int headI, int headJ, double refDepth, Phase::PhaseEnum preferredPhase, + Well::Well(const std::string& name_, int headI, int headJ, Value refDepth , Phase::PhaseEnum preferredPhase, TimeMapConstPtr timeMap, size_t creationTimeStep) : m_status(new DynamicState(timeMap, WellCommon::OPEN)), m_isAvailableForGroupControl(new DynamicState(timeMap, true)), @@ -42,7 +43,6 @@ namespace Opm { m_groupName( new DynamicState( timeMap , "" )), m_headI(headI), m_headJ(headJ), - m_refDepthDefaulted(false), m_refDepth(refDepth), m_preferredPhase(preferredPhase) { @@ -50,29 +50,6 @@ namespace Opm { m_creationTimeStep = creationTimeStep; } - Well::Well(const std::string& name_, int headI, int headJ, Phase::PhaseEnum preferredPhase, - TimeMapConstPtr timeMap, size_t creationTimeStep) - : m_status(new DynamicState(timeMap, WellCommon::OPEN)), - m_isAvailableForGroupControl(new DynamicState(timeMap, true)), - m_guideRate(new DynamicState(timeMap, -1.0)), - m_guideRatePhase(new DynamicState(timeMap, GuideRate::UNDEFINED)), - m_guideRateScalingFactor(new DynamicState(timeMap, 1.0)), - m_isProducer(new DynamicState(timeMap, true)) , - m_completions( new DynamicState( timeMap , CompletionSetConstPtr( new CompletionSet()) )), - m_productionProperties( new DynamicState(timeMap, WellProductionProperties() )), - m_injectionProperties( new DynamicState(timeMap, WellInjectionProperties() )), - m_polymerProperties( new DynamicState(timeMap, WellPolymerProperties() )), - m_groupName( new DynamicState( timeMap , "" )), - m_headI(headI), - m_headJ(headJ), - m_refDepthDefaulted(true), - m_refDepth(-1e100), - m_preferredPhase(preferredPhase) - { - m_name = name_; - m_creationTimeStep = creationTimeStep; - } - const std::string& Well::name() const { return m_name; } @@ -191,11 +168,11 @@ namespace Opm { } bool Well::getRefDepthDefaulted() const { - return m_refDepthDefaulted; + return !m_refDepth.hasValue(); } double Well::getRefDepth() const { - return m_refDepth; + return m_refDepth.getValue(); } Phase::PhaseEnum Well::getPreferredPhase() const { diff --git a/opm/parser/eclipse/EclipseState/Schedule/Well.hpp b/opm/parser/eclipse/EclipseState/Schedule/Well.hpp index b1f29e66d..01867f6d1 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Well.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Well.hpp @@ -41,10 +41,7 @@ namespace Opm { class Well { public: - Well(const std::string& name, int headI, int headJ, double refDepth, Phase::PhaseEnum preferredPhase, - TimeMapConstPtr timeMap, size_t creationTimeStep); - /// Use this constructor when reference depth is defaulted. - Well(const std::string& name, int headI, int headJ, Phase::PhaseEnum preferredPhase, + Well(const std::string& name, int headI, int headJ, Value refDepth , Phase::PhaseEnum preferredPhase, TimeMapConstPtr timeMap, size_t creationTimeStep); const std::string& name() const; @@ -110,8 +107,7 @@ namespace Opm { // WELSPECS data - assumes this is not dynamic int m_headI; int m_headJ; - bool m_refDepthDefaulted; - double m_refDepth; + Value m_refDepth; Phase::PhaseEnum m_preferredPhase; }; typedef std::shared_ptr WellPtr; diff --git a/opm/parser/eclipse/EclipseState/Schedule/tests/GroupTests.cpp b/opm/parser/eclipse/EclipseState/Schedule/tests/GroupTests.cpp index a6152c83f..8d9b8667b 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/tests/GroupTests.cpp +++ b/opm/parser/eclipse/EclipseState/Schedule/tests/GroupTests.cpp @@ -27,6 +27,7 @@ +#include #include #include #include @@ -148,8 +149,8 @@ BOOST_AUTO_TEST_CASE(GroupAddWell) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); Opm::Group group("G1" , timeMap , 0); - Opm::WellPtr well1(new Opm::Well("WELL1" , 0, 0, 0.0, Opm::Phase::OIL, timeMap, 0)); - Opm::WellPtr well2(new Opm::Well("WELL2" , 0, 0, 0.0, Opm::Phase::OIL, timeMap, 0)); + Opm::WellPtr well1(new Opm::Well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::OIL, timeMap, 0)); + Opm::WellPtr well2(new Opm::Well("WELL2" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::OIL, timeMap, 0)); BOOST_CHECK_EQUAL(0U , group.numWells(2)); group.addWell( 3 , well1 ); @@ -185,8 +186,8 @@ BOOST_AUTO_TEST_CASE(GroupAddAndDelWell) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); Opm::Group group("G1" , timeMap , 0); - Opm::WellPtr well1(new Opm::Well("WELL1" , 0, 0, 0.0, Opm::Phase::OIL, timeMap, 0)); - Opm::WellPtr well2(new Opm::Well("WELL2" , 0, 0, 0.0, Opm::Phase::OIL, timeMap, 0)); + Opm::WellPtr well1(new Opm::Well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::OIL, timeMap, 0)); + Opm::WellPtr well2(new Opm::Well("WELL2" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::OIL, timeMap, 0)); BOOST_CHECK_EQUAL(0U , group.numWells(2)); group.addWell( 3 , well1 ); diff --git a/opm/parser/eclipse/EclipseState/Schedule/tests/WellSetTests.cpp b/opm/parser/eclipse/EclipseState/Schedule/tests/WellSetTests.cpp index 29e848500..9ccd19f73 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/tests/WellSetTests.cpp +++ b/opm/parser/eclipse/EclipseState/Schedule/tests/WellSetTests.cpp @@ -53,8 +53,8 @@ BOOST_AUTO_TEST_CASE(AddAndDeleteWell) { Opm::WellSet wellSet; Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::WellPtr well(new Opm::Well("WELL1" , 0, 0, 0.0, Opm::Phase::OIL, timeMap , 0)); - Opm::WellPtr well2(new Opm::Well("WELL2" , 0, 0, 0.0, Opm::Phase::OIL, timeMap , 0)); + Opm::WellPtr well(new Opm::Well("WELL1" , 0, 0, Opm::Value("REF_DEPTH") , Opm::Phase::OIL, timeMap , 0)); + Opm::WellPtr well2(new Opm::Well("WELL2" , 0, 0, Opm::Value("REF_DEPTH") , Opm::Phase::OIL, timeMap , 0)); wellSet.addWell( well ); BOOST_CHECK_EQUAL(true , wellSet.hasWell("WELL1")); @@ -78,8 +78,8 @@ BOOST_AUTO_TEST_CASE(AddWellSameName) { Opm::WellSet wellSet; Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::WellPtr well1(new Opm::Well("WELL" , 0, 0, 0.0, Opm::Phase::OIL, timeMap , 0)); - Opm::WellPtr well2(new Opm::Well("WELL" , 0, 0, 0.0, Opm::Phase::OIL, timeMap , 0)); + Opm::WellPtr well1(new Opm::Well("WELL" , 0, 0,Opm::Value("REF_DEPTH"), Opm::Phase::OIL, timeMap , 0)); + Opm::WellPtr well2(new Opm::Well("WELL" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::OIL, timeMap , 0)); wellSet.addWell( well1 ); BOOST_CHECK_EQUAL(true , wellSet.hasWell("WELL")); diff --git a/opm/parser/eclipse/EclipseState/Schedule/tests/WellTests.cpp b/opm/parser/eclipse/EclipseState/Schedule/tests/WellTests.cpp index 9379f8308..b264619e5 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/tests/WellTests.cpp +++ b/opm/parser/eclipse/EclipseState/Schedule/tests/WellTests.cpp @@ -44,14 +44,14 @@ static Opm::TimeMapPtr createXDaysTimeMap(size_t numDays) { BOOST_AUTO_TEST_CASE(CreateWell_CorrectNameAndDefaultValues) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::OIL, timeMap , 0); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::OIL, timeMap , 0); BOOST_CHECK_EQUAL( "WELL1" , well.name() ); BOOST_CHECK_EQUAL(0.0 , well.getProductionPropertiesCopy(5).OilRate); } BOOST_AUTO_TEST_CASE(CreateWell_GetProductionPropertiesShouldReturnSameObject) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::OIL, timeMap , 0); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::OIL, timeMap , 0); BOOST_CHECK_EQUAL(&(well.getProductionProperties(5)), &(well.getProductionProperties(5))); BOOST_CHECK_EQUAL(&(well.getProductionProperties(8)), &(well.getProductionProperties(8))); @@ -60,7 +60,7 @@ BOOST_AUTO_TEST_CASE(CreateWell_GetProductionPropertiesShouldReturnSameObject) { BOOST_AUTO_TEST_CASE(CreateWell_GetInjectionPropertiesShouldReturnSameObject) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::WATER, timeMap , 0); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::WATER, timeMap , 0); BOOST_CHECK_EQUAL(&(well.getInjectionProperties(5)), &(well.getInjectionProperties(5))); BOOST_CHECK_EQUAL(&(well.getInjectionProperties(8)), &(well.getInjectionProperties(8))); @@ -69,7 +69,7 @@ BOOST_AUTO_TEST_CASE(CreateWell_GetInjectionPropertiesShouldReturnSameObject) { BOOST_AUTO_TEST_CASE(CreateWellCreateTimeStepOK) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::OIL, timeMap , 5); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::OIL, timeMap , 5); BOOST_CHECK_EQUAL( false , well.hasBeenDefined(0) ); BOOST_CHECK_EQUAL( false , well.hasBeenDefined(4) ); BOOST_CHECK_EQUAL( true , well.hasBeenDefined(5) ); @@ -80,7 +80,7 @@ BOOST_AUTO_TEST_CASE(CreateWellCreateTimeStepOK) { BOOST_AUTO_TEST_CASE(setWellProductionProperties_PropertiesSetCorrect) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::OIL, timeMap , 0); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::OIL, timeMap , 0); BOOST_CHECK_EQUAL(0.0 , well.getProductionPropertiesCopy( 5 ).OilRate); Opm::WellProductionProperties props; @@ -104,7 +104,7 @@ BOOST_AUTO_TEST_CASE(setWellProductionProperties_PropertiesSetCorrect) { BOOST_AUTO_TEST_CASE(setOilRate_RateSetCorrect) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::OIL, timeMap , 0); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::OIL, timeMap , 0); BOOST_CHECK_EQUAL(0.0 , well.getProductionPropertiesCopy(5).OilRate); Opm::WellProductionProperties props; @@ -116,7 +116,7 @@ BOOST_AUTO_TEST_CASE(setOilRate_RateSetCorrect) { BOOST_AUTO_TEST_CASE(seLiquidRate_RateSetCorrect) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::OIL, timeMap , 0); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::OIL, timeMap , 0); BOOST_CHECK_EQUAL(0.0 , well.getProductionPropertiesCopy(5).LiquidRate); Opm::WellProductionProperties props; @@ -129,7 +129,7 @@ BOOST_AUTO_TEST_CASE(seLiquidRate_RateSetCorrect) { BOOST_AUTO_TEST_CASE(setPredictionModeProduction_ModeSetCorrect) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::OIL, timeMap , 0); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::OIL, timeMap , 0); BOOST_CHECK_EQUAL( true, well.getProductionPropertiesCopy(5).predictionMode); Opm::WellProductionProperties props; @@ -143,7 +143,7 @@ BOOST_AUTO_TEST_CASE(setPredictionModeProduction_ModeSetCorrect) { BOOST_AUTO_TEST_CASE(setpredictionModeInjection_ModeSetCorrect) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::WATER, timeMap , 0); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::WATER, timeMap , 0); BOOST_CHECK_EQUAL( true, well.getInjectionPropertiesCopy(5).predictionMode); Opm::WellInjectionProperties props; @@ -157,7 +157,7 @@ BOOST_AUTO_TEST_CASE(setpredictionModeInjection_ModeSetCorrect) { BOOST_AUTO_TEST_CASE(NewWellZeroCompletions) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::OIL, timeMap , 0); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::OIL, timeMap , 0); Opm::CompletionSetConstPtr completions = well.getCompletions( 0 ); BOOST_CHECK_EQUAL( 0U , completions->size()); } @@ -165,7 +165,7 @@ BOOST_AUTO_TEST_CASE(NewWellZeroCompletions) { BOOST_AUTO_TEST_CASE(UpdateCompletions) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::OIL, timeMap , 0); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::OIL, timeMap , 0); Opm::CompletionSetConstPtr completions = well.getCompletions( 0 ); BOOST_CHECK_EQUAL( 0U , completions->size()); @@ -203,7 +203,7 @@ BOOST_AUTO_TEST_CASE(UpdateCompletions) { BOOST_AUTO_TEST_CASE(setGasRate_RateSetCorrect) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::GAS, timeMap , 0); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::GAS, timeMap , 0); BOOST_CHECK_EQUAL(0.0 , well.getProductionPropertiesCopy(5).GasRate); Opm::WellProductionProperties properties; @@ -217,7 +217,7 @@ BOOST_AUTO_TEST_CASE(setGasRate_RateSetCorrect) { BOOST_AUTO_TEST_CASE(setWaterRate_RateSetCorrect) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::WATER, timeMap , 0); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::WATER, timeMap , 0); BOOST_CHECK_EQUAL(0.0 , well.getProductionPropertiesCopy(5).WaterRate); Opm::WellProductionProperties properties; @@ -230,7 +230,7 @@ BOOST_AUTO_TEST_CASE(setWaterRate_RateSetCorrect) { BOOST_AUTO_TEST_CASE(setSurfaceInjectionRate_RateSetCorrect) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::WATER, timeMap , 0); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::WATER, timeMap , 0); BOOST_CHECK_EQUAL(0.0 , well.getInjectionPropertiesCopy(5).surfaceInjectionRate); Opm::WellInjectionProperties props(well.getInjectionPropertiesCopy(5)); @@ -243,7 +243,7 @@ BOOST_AUTO_TEST_CASE(setSurfaceInjectionRate_RateSetCorrect) { BOOST_AUTO_TEST_CASE(setReservoirInjectionRate_RateSetCorrect) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::WATER, timeMap , 0); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::WATER, timeMap , 0); BOOST_CHECK_EQUAL(0.0 , well.getInjectionPropertiesCopy(5).reservoirInjectionRate); Opm::WellInjectionProperties properties(well.getInjectionPropertiesCopy(5)); @@ -258,7 +258,7 @@ BOOST_AUTO_TEST_CASE(isProducerCorrectlySet) { // HACK: This test checks correctly setting of isProducer/isInjector. This property depends on which of // WellProductionProperties/WellInjectionProperties is set last, independent of actual values. Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::OIL, timeMap ,0); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::OIL, timeMap ,0); /* 1: Well is created as producer */ BOOST_CHECK_EQUAL( false , well.isInjector(0)); @@ -314,7 +314,7 @@ BOOST_AUTO_TEST_CASE(isProducerCorrectlySet) { BOOST_AUTO_TEST_CASE(GroupnameCorretlySet) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1" , 0, 0, 0.0, Opm::Phase::WATER, timeMap ,0); + Opm::Well well("WELL1" , 0, 0, Opm::Value("REF_DEPTH"), Opm::Phase::WATER, timeMap ,0); BOOST_CHECK_EQUAL("" , well.getGroupName(2)); @@ -328,7 +328,7 @@ BOOST_AUTO_TEST_CASE(GroupnameCorretlySet) { BOOST_AUTO_TEST_CASE(addWELSPECS_setData_dataSet) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1", 23, 42, 2334.32, Opm::Phase::WATER, timeMap, 3); + Opm::Well well("WELL1", 23, 42, Opm::Value("REF_DEPTH" , 2334.32) , Opm::Phase::WATER, timeMap, 3); BOOST_CHECK(!well.hasBeenDefined(2)); BOOST_CHECK(well.hasBeenDefined(3)); @@ -341,7 +341,7 @@ BOOST_AUTO_TEST_CASE(addWELSPECS_setData_dataSet) { BOOST_AUTO_TEST_CASE(XHPLimitDefault) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1", 1, 2, 2334.32, Opm::Phase::WATER, timeMap, 0); + Opm::Well well("WELL1", 1, 2, Opm::Value("REF_DEPTH" , 2334.32), Opm::Phase::WATER, timeMap, 0); Opm::WellProductionProperties productionProps(well.getProductionPropertiesCopy(1)); @@ -362,7 +362,7 @@ BOOST_AUTO_TEST_CASE(XHPLimitDefault) { BOOST_AUTO_TEST_CASE(InjectorType) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1", 1, 2, 2334.32, Opm::Phase::WATER, timeMap, 0); + Opm::Well well("WELL1", 1, 2, Opm::Value("REF_DEPTH" , 2334.32), Opm::Phase::WATER, timeMap, 0); Opm::WellInjectionProperties injectionProps(well.getInjectionPropertiesCopy(1)); injectionProps.injectorType = Opm::WellInjector::WATER; @@ -377,7 +377,7 @@ BOOST_AUTO_TEST_CASE(InjectorType) { BOOST_AUTO_TEST_CASE(WellStatus) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(10); - Opm::Well well("WELL1", 1, 2, 2334.32, Opm::Phase::WATER, timeMap, 0); + Opm::Well well("WELL1", 1, 2, Opm::Value("REF_DEPTH" , 2334.32), Opm::Phase::WATER, timeMap, 0); well.setStatus( 1 , Opm::WellCommon::OPEN ); BOOST_CHECK_EQUAL( Opm::WellCommon::OPEN , well.getStatus( 5 )); @@ -391,7 +391,7 @@ BOOST_AUTO_TEST_CASE(WellStatus) { BOOST_AUTO_TEST_CASE(WellHaveProductionControlLimit) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(20); - Opm::Well well("WELL1", 1, 2, 2334.32, Opm::Phase::OIL, timeMap, 0); + Opm::Well well("WELL1", 1, 2, Opm::Value("REF_DEPTH" , 2334.32), Opm::Phase::OIL, timeMap, 0); BOOST_CHECK( !well.getProductionPropertiesCopy(1).hasProductionControl( Opm::WellProducer::ORAT )); @@ -441,7 +441,7 @@ BOOST_AUTO_TEST_CASE(WellHaveProductionControlLimit) { BOOST_AUTO_TEST_CASE(WellHaveInjectionControlLimit) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(20); - Opm::Well well("WELL1", 1, 2, 2334.32, Opm::Phase::WATER, timeMap, 0); + Opm::Well well("WELL1", 1, 2, Opm::Value("REF_DEPTH" , 2334.32), Opm::Phase::WATER, timeMap, 0); BOOST_CHECK( !well.getInjectionPropertiesCopy(1).hasInjectionControl( Opm::WellInjector::RATE )); BOOST_CHECK( !well.getInjectionPropertiesCopy(1).hasInjectionControl( Opm::WellInjector::RESV )); @@ -485,7 +485,7 @@ BOOST_AUTO_TEST_CASE(WellHaveInjectionControlLimit) { BOOST_AUTO_TEST_CASE(WellSetAvailableForGroupControl_ControlSet) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(20); - Opm::Well well("WELL1", 1, 2, 2334.32, Opm::Phase::WATER, timeMap, 0); + Opm::Well well("WELL1", 1, 2, Opm::Value("REF_DEPTH" , 2334.32), Opm::Phase::WATER, timeMap, 0); BOOST_CHECK(well.isAvailableForGroupControl(10)); well.setAvailableForGroupControl(12, false); @@ -496,7 +496,7 @@ BOOST_AUTO_TEST_CASE(WellSetAvailableForGroupControl_ControlSet) { BOOST_AUTO_TEST_CASE(WellSetGuideRate_GuideRateSet) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(20); - Opm::Well well("WELL1", 1, 2, 2334.32, Opm::Phase::WATER, timeMap, 0); + Opm::Well well("WELL1", 1, 2, Opm::Value("REF_DEPTH" , 2334.32), Opm::Phase::WATER, timeMap, 0); BOOST_CHECK_LT(well.getGuideRate(0), 0); well.setGuideRate(1, 32.2); @@ -506,7 +506,7 @@ BOOST_AUTO_TEST_CASE(WellSetGuideRate_GuideRateSet) { BOOST_AUTO_TEST_CASE(WellGuideRatePhase_GuideRatePhaseSet) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(20); - Opm::Well well("WELL1", 1, 2, 2334.32, Opm::Phase::WATER, timeMap, 0); + Opm::Well well("WELL1", 1, 2, Opm::Value("REF_DEPTH" , 2334.32), Opm::Phase::WATER, timeMap, 0); BOOST_CHECK_EQUAL(Opm::GuideRate::UNDEFINED, well.getGuideRatePhase(0)); well.setGuideRatePhase(3, Opm::GuideRate::RAT); BOOST_CHECK_EQUAL(Opm::GuideRate::UNDEFINED, well.getGuideRatePhase(2)); @@ -516,7 +516,7 @@ BOOST_AUTO_TEST_CASE(WellGuideRatePhase_GuideRatePhaseSet) { BOOST_AUTO_TEST_CASE(WellSetScalingFactor_ScalingFactorSetSet) { Opm::TimeMapPtr timeMap = createXDaysTimeMap(20); - Opm::Well well("WELL1", 1, 2, 2334.32, Opm::Phase::WATER, timeMap, 0); + Opm::Well well("WELL1", 1, 2, Opm::Value("REF_DEPTH" , 2334.32), Opm::Phase::WATER, timeMap, 0); BOOST_CHECK_EQUAL(1.0, well.getGuideRateScalingFactor(0)); well.setGuideRateScalingFactor(4, 0.6); BOOST_CHECK_EQUAL(1.0, well.getGuideRateScalingFactor(3));