diff --git a/opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp b/opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp index f694203cd..81178d036 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp @@ -198,8 +198,12 @@ public: std::string name; UDAValue surfaceInjectionRate; UDAValue reservoirInjectionRate; - UDAValue BHPLimit; - UDAValue THPLimit; + UDAValue BHPTarget; + UDAValue THPTarget; + + double bhp_hist_limit; + double thp_hist_limit = 0; + double temperature; double BHPH; double THPH; @@ -219,7 +223,10 @@ public: const UDAValue& reservoirInjRate, const UDAValue& BHP, const UDAValue& THP, - double temp, double bhph, + double bhp_hist, + double thp_hist, + double temp, + double bhph, double thph, int vfpTableNum, bool predMode, @@ -227,7 +234,7 @@ public: Well::InjectorType injType, InjectorCMode ctrlMode); - void handleWELTARG(WELTARGCMode cmode, double newValue); + void handleWELTARG(WELTARGCMode cmode, double newValue, double SIFactorP); void handleWCONINJE(const DeckRecord& record, bool availableForGroupControl, const std::string& well_name); void handleWCONINJH(const DeckRecord& record, bool is_producer, const std::string& well_name); bool hasInjectionControl(InjectorCMode controlModeArg) const { @@ -250,7 +257,7 @@ public: } void resetDefaultHistoricalBHPLimit(); - + void resetBHPLimit(); void setBHPLimit(const double limit); InjectionControls controls(const UnitSystem& unit_system, const SummaryState& st, double udq_default) const; bool updateUDQActive(const UDQConfig& udq_config, UDQActive& active) const; @@ -296,9 +303,13 @@ public: UDAValue GasRate; UDAValue LiquidRate; UDAValue ResVRate; + UDAValue BHPTarget; + UDAValue THPTarget; + // BHP and THP limit - UDAValue BHPLimit; - UDAValue THPLimit; + double bhp_hist_limit; + double thp_hist_limit = 0; + // historical BHP and THP under historical mode double BHPH = 0.0; double THPH = 0.0; @@ -321,6 +332,8 @@ public: const UDAValue& resvRate, const UDAValue& BHP, const UDAValue& THP, + double bhp_hist, + double thp_hist, double bhph, double thph, int vfpTableNum, @@ -348,13 +361,14 @@ public: static bool effectiveHistoryProductionControl(ProducerCMode cmode); void handleWCONPROD( const std::string& well, const DeckRecord& record); void handleWCONHIST( const DeckRecord& record); - void handleWELTARG( WELTARGCMode cmode, double newValue); + void handleWELTARG( WELTARGCMode cmode, double newValue, double SiFactorP); void resetDefaultBHPLimit(); void clearControls(); ProductionControls controls(const SummaryState& st, double udq_default) const; bool updateUDQActive(const UDQConfig& udq_config, UDQActive& active) const; int getNumProductionControls() const; + void setBHPLimit(const double limit); private: int m_productionControls = 0; @@ -364,8 +378,6 @@ public: WellProductionProperties(const DeckRecord& record); - void setBHPLimit(const double limit); - double getBHPLimit() const; }; diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp index 7b0363946..84e791119 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp @@ -823,7 +823,7 @@ namespace { well2->updateProducer(true); auto inj_props = std::make_shared(well2->getInjectionProperties()); - inj_props->setBHPLimit(0); + inj_props->resetBHPLimit(); well2->updateInjection(inj_props); } @@ -1491,6 +1491,8 @@ namespace { const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors) { + Opm::UnitSystem unitSystem = section.unitSystem(); + const double SiFactorP = unitSystem.parse("Pressure").getSIScaling(); for( const auto& record : keyword ) { const std::string& wellNamePattern = record.getItem("WELL").getTrimmedString(0); @@ -1509,13 +1511,13 @@ namespace { bool update = false; if (well2->isProducer()) { auto prop = std::make_shared(well2->getProductionProperties()); - prop->handleWELTARG(cmode, newValue); + prop->handleWELTARG(cmode, newValue, SiFactorP); update = well2->updateProduction(prop); if (cmode == Well::WELTARGCMode::GUID) update |= well2->updateWellGuideRate(newValue); } else { auto inj = std::make_shared(well2->getInjectionProperties()); - inj->handleWELTARG(cmode, newValue); + inj->handleWELTARG(cmode, newValue, SiFactorP); update = well2->updateInjection(inj); if (cmode == Well::WELTARGCMode::GUID) update |= well2->updateWellGuideRate(newValue); diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp index b37bf6835..2e4ca5c0c 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp @@ -254,7 +254,7 @@ bool Well::updateEconLimits(std::shared_ptr econ_limit void Well::switchToProducer() { auto p = std::make_shared(this->getInjectionProperties()); - p->BHPLimit.reset( 0 ); + p->BHPTarget.reset(0); p->dropInjectionControl( Opm::Well::InjectorCMode::BHP ); this->updateInjection( p ); this->updateProducer(true); @@ -264,8 +264,7 @@ void Well::switchToProducer() { void Well::switchToInjector() { auto p = std::make_shared(getProductionProperties()); - p->BHPLimit.assert_numeric(); - p->BHPLimit.reset(0); + p->setBHPLimit(0); p->dropProductionControl( ProducerCMode::BHP ); this->updateProduction( p ); this->updateProducer( false ); diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.cpp index 538202085..b626652a2 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.cpp @@ -58,13 +58,15 @@ namespace Opm { injectionControls=0; } - Well::WellInjectionProperties::WellInjectionProperties(const std::string& wname, const UDAValue& surfaceInjRate, const UDAValue& reservoirInjRate, const UDAValue& BHP, const UDAValue& THP, - double temp, double bhph, + double bhp_hist, + double thp_hist, + double temp, + double bhph, double thph, int vfpTableNum, bool predMode, @@ -74,8 +76,10 @@ namespace Opm { : name(wname), surfaceInjectionRate(surfaceInjRate), reservoirInjectionRate(reservoirInjRate), - BHPLimit(BHP), - THPLimit(THP), + BHPTarget(BHP), + THPTarget(THP), + bhp_hist_limit(bhp_hist), + thp_hist_limit(thp_hist), temperature(temp), BHPH(bhph), THPH(thph), @@ -88,7 +92,6 @@ namespace Opm { } - void Well::WellInjectionProperties::handleWCONINJE(const DeckRecord& record, bool availableForGroupControl, const std::string& well_name) { this->injectorType = Well::InjectorTypeFromString( record.getItem("TYPE").getTrimmedString(0) ); this->predictionMode = true; @@ -108,7 +111,7 @@ namespace Opm { if (!record.getItem("THP").defaultApplied(0)) { - this->THPLimit = record.getItem("THP").get(0); + this->THPTarget = record.getItem("THP").get(0); this->addInjectionControl(InjectorCMode::THP); } else this->dropInjectionControl(InjectorCMode::THP); @@ -119,11 +122,10 @@ namespace Opm { There is a sensible default BHP limit defined, so the BHPLimit can be safely set unconditionally, and we make BHP limit as a constraint based on that default value. It is not easy to infer from the manual, while the - current behavoir agrees with the behovir of Eclipse when BHPLimit is not + current behavoir agrees with the behavior of Eclipse when BHPLimit is not specified while employed during group control. */ - this->setBHPLimit(record.getItem("BHP").get(0).getSI()); - // BHP control should always be there. + this->BHPTarget = record.getItem("BHP").get(0); this->addInjectionControl(InjectorCMode::BHP); if (availableForGroupControl) @@ -143,37 +145,47 @@ namespace Opm { - void Well::WellInjectionProperties::handleWELTARG(WELTARGCMode cmode, double newValue) { + void Well::WellInjectionProperties::handleWELTARG(WELTARGCMode cmode, double newValue, double SiFactorP) { if (cmode == Well::WELTARGCMode::BHP){ - this->BHPLimit.reset( newValue ); + if (this->predictionMode) { + this->BHPTarget.assert_numeric("Can not combine UDA and WELTARG"); + this->BHPTarget.reset( newValue ); + } else + this->bhp_hist_limit = newValue * SiFactorP; } else if (cmode == WELTARGCMode::ORAT){ if(this->injectorType == Well::InjectorType::OIL){ + this->surfaceInjectionRate.assert_numeric("Can not combine UDA and WELTARG"); this->surfaceInjectionRate.reset( newValue ); }else{ std::invalid_argument("Well type must be OIL to set the oil rate"); } } else if (cmode == WELTARGCMode::WRAT){ - if(this->injectorType == Well::InjectorType::WATER) + if (this->injectorType == Well::InjectorType::WATER) { + this->surfaceInjectionRate.assert_numeric("Can not combine UDA and WELTARG"); this->surfaceInjectionRate.reset( newValue ); + } else std::invalid_argument("Well type must be WATER to set the water rate"); } else if (cmode == WELTARGCMode::GRAT){ if(this->injectorType == Well::InjectorType::GAS){ + this->surfaceInjectionRate.assert_numeric("Can not combine UDA and WELTARG"); this->surfaceInjectionRate.reset( newValue ); }else{ std::invalid_argument("Well type must be GAS to set the gas rate"); } } else if (cmode == WELTARGCMode::THP){ - this->THPLimit.reset( newValue ); + this->THPTarget.assert_numeric("Can not combine UDA and WELTARG"); + this->THPTarget.reset( newValue ); } else if (cmode == WELTARGCMode::VFP){ this->VFPTableNumber = static_cast (newValue); } else if (cmode == WELTARGCMode::RESV){ + this->surfaceInjectionRate.assert_numeric("Can not combine UDA and WELTARG"); this->reservoirInjectionRate.reset( newValue ); } else if (cmode != WELTARGCMode::GUID){ @@ -210,7 +222,7 @@ namespace Opm { // when well is under BHP control, we use its historical BHP value as BHP limit if (newControlMode == InjectorCMode::BHP) { - this->setBHPLimit(this->BHPH); + this->bhp_hist_limit = this->BHPH; } else { const bool switching_from_producer = is_producer; const bool switching_from_prediction = this->predictionMode; @@ -238,10 +250,12 @@ namespace Opm { if ((surfaceInjectionRate == other.surfaceInjectionRate) && (reservoirInjectionRate == other.reservoirInjectionRate) && (temperature == other.temperature) && - (BHPLimit == other.BHPLimit) && - (THPLimit == other.THPLimit) && + (BHPTarget == other.BHPTarget) && + (THPTarget == other.THPTarget) && (BHPH == other.BHPH) && (THPH == other.THPH) && + (bhp_hist_limit == other.bhp_hist_limit) && + (thp_hist_limit == other.thp_hist_limit) && (VFPTableNumber == other.VFPTableNumber) && (predictionMode == other.predictionMode) && (injectionControls == other.injectionControls) && @@ -259,13 +273,14 @@ namespace Opm { void Well::WellInjectionProperties::resetDefaultHistoricalBHPLimit() { // this default BHP value is from simulation result, // without finding any related document - BHPLimit.reset( 6891.2 * unit::barsa ); + this->bhp_hist_limit = 6891.2 * unit::barsa; } - void Well::WellInjectionProperties::setBHPLimit(const double limit) { - BHPLimit.reset( limit ); + void Well::WellInjectionProperties::resetBHPLimit() { + this->bhp_hist_limit = 0; } + std::ostream& operator<<( std::ostream& stream, const Well::WellInjectionProperties& wp ) { return stream @@ -273,8 +288,8 @@ namespace Opm { << "surfacerate: " << wp.surfaceInjectionRate << ", " << "reservoir rate " << wp.reservoirInjectionRate << ", " << "temperature: " << wp.temperature << ", " - << "BHP limit: " << wp.BHPLimit << ", " - << "THP limit: " << wp.THPLimit << ", " + << "BHP target: " << wp.BHPTarget << ", " + << "THP target: " << wp.THPTarget << ", " << "BHPH: " << wp.BHPH << ", " << "THPH: " << wp.THPH << ", " << "VFP table: " << wp.VFPTableNumber << ", " @@ -285,14 +300,18 @@ namespace Opm { } -Well::InjectionControls Well::WellInjectionProperties::controls(const UnitSystem& unit_sys, const SummaryState& st, double udq_def) const { + Well::InjectionControls Well::WellInjectionProperties::controls(const UnitSystem& unit_sys, const SummaryState& st, double udq_def) const { InjectionControls controls(this->injectionControls); controls.surface_rate = UDA::eval_well_uda_rate(this->surfaceInjectionRate, this->name, st, udq_def, this->injectorType, unit_sys); controls.reservoir_rate = UDA::eval_well_uda(this->reservoirInjectionRate, this->name, st, udq_def); - controls.bhp_limit = UDA::eval_well_uda(this->BHPLimit, this->name, st, udq_def); - controls.thp_limit = UDA::eval_well_uda(this->THPLimit, this->name, st, udq_def); - + if (this->predictionMode) { + controls.bhp_limit = UDA::eval_well_uda(this->BHPTarget, this->name, st, udq_def); + controls.thp_limit = UDA::eval_well_uda(this->THPTarget, this->name, st, udq_def); + } else { + controls.bhp_limit = this->bhp_hist_limit; + controls.thp_limit = this->thp_hist_limit; + } controls.temperature = this->temperature; controls.injector_type = this->injectorType; controls.cmode = this->controlMode; @@ -307,8 +326,8 @@ Well::InjectionControls Well::WellInjectionProperties::controls(const UnitSystem update_count += active.update(udq_config, this->surfaceInjectionRate, this->name, UDAControl::WCONINJE_RATE); update_count += active.update(udq_config, this->reservoirInjectionRate, this->name, UDAControl::WCONINJE_RESV); - update_count += active.update(udq_config, this->BHPLimit, this->name, UDAControl::WCONINJE_BHP); - update_count += active.update(udq_config, this->THPLimit, this->name, UDAControl::WCONINJE_THP); + update_count += active.update(udq_config, this->BHPTarget, this->name, UDAControl::WCONINJE_BHP); + update_count += active.update(udq_config, this->THPTarget, this->name, UDAControl::WCONINJE_THP); return (update_count > 0); } diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.cpp index 3c44a3502..c080f1147 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.cpp @@ -46,6 +46,7 @@ namespace Opm { predictionMode( true ) {} + Well::WellProductionProperties::WellProductionProperties(const std::string& wname, const UDAValue& oilRate, const UDAValue& waterRate, @@ -54,6 +55,8 @@ namespace Opm { const UDAValue& resvRate, const UDAValue& BHP, const UDAValue& THP, + double bhp_hist, + double thp_hist, double bhph, double thph, int vfpTableNum, @@ -68,8 +71,10 @@ namespace Opm { GasRate(gasRate), LiquidRate(liquidRate), ResVRate(resvRate), - BHPLimit(BHP), - THPLimit(THP), + BHPTarget(BHP), + THPTarget(THP), + bhp_hist_limit(bhp_hist), + thp_hist_limit(thp_hist), BHPH(bhph), THPH(thph), VFPTableNumber(vfpTableNum), @@ -84,7 +89,6 @@ namespace Opm { - void Well::WellProductionProperties::init_rates( const DeckRecord& record ) { this->OilRate = record.getItem("ORAT").get(0); this->WaterRate = record.getItem("WRAT").get(0); @@ -95,8 +99,10 @@ namespace Opm { void Well::WellProductionProperties::init_history(const DeckRecord& record) { this->predictionMode = false; - // update LiquidRate - this->LiquidRate = UDAValue(this->WaterRate.getSI() + this->OilRate.getSI()); + // update LiquidRate. The funnny constrction with explicitly making a new + // UDAValue is to ensure that the UDAValue has the correct dimension. + this->LiquidRate = UDAValue(this->LiquidRate, this->OilRate.get_dim()); + this->LiquidRate.reset(this->WaterRate.get() + this->OilRate.get()); if ( record.getItem( "BHP" ).hasValue(0) ) this->BHPH = record.getItem("BHP").get(0).getSI(); @@ -152,8 +158,8 @@ namespace Opm { { this->predictionMode = true; - this->BHPLimit = record.getItem("BHP").get(0); - this->THPLimit = record.getItem("THP").get(0); + this->BHPTarget = record.getItem("BHP").get(0); + this->THPTarget = record.getItem("THP").get(0); this->ALQValue = record.getItem("ALQ").get< double >(0); //NOTE: Unit of ALQ is never touched this->VFPTableNumber = record.getItem("VFP_TABLE").get< int >(0); this->LiquidRate = record.getItem("LRAT").get(0); @@ -172,7 +178,7 @@ namespace Opm { if( !record.getItem( cmode.first ).defaultApplied( 0 ) ) { // a zero value THP limit will not be handled as a THP limit - if (cmode.first == "THP" && this->THPLimit.zero()) + if (cmode.first == "THP" && this->THPTarget.zero()) continue; this->addProductionControl( cmode.second ); @@ -220,7 +226,7 @@ namespace Opm { -void Well::WellProductionProperties::handleWELTARG(Well::WELTARGCMode cmode, double newValue) { + void Well::WellProductionProperties::handleWELTARG(Well::WELTARGCMode cmode, double newValue, double SiFactorP) { if (cmode == WELTARGCMode::ORAT){ this->OilRate.assert_numeric("Can not combine UDA and WELTARG"); this->OilRate.reset( newValue ); @@ -242,12 +248,15 @@ void Well::WellProductionProperties::handleWELTARG(Well::WELTARGCMode cmode, dou this->ResVRate.reset( newValue ); } else if (cmode == WELTARGCMode::BHP){ - this->BHPLimit.assert_numeric("Can not combine UDA and WELTARG"); - this->BHPLimit.reset( newValue ); + if (this->predictionMode) { + this->BHPTarget.assert_numeric("Can not combine UDA and WELTARG"); + this->BHPTarget.reset( newValue ); + } else + this->bhp_hist_limit = newValue * SiFactorP; } else if (cmode == WELTARGCMode::THP){ - this->THPLimit.assert_numeric("Can not combine UDA and WELTARG"); - this->THPLimit.reset(newValue ); + this->THPTarget.assert_numeric("Can not combine UDA and WELTARG"); + this->THPTarget.reset(newValue ); } else if (cmode == WELTARGCMode::VFP) this->VFPTableNumber = static_cast (newValue); @@ -263,8 +272,10 @@ void Well::WellProductionProperties::handleWELTARG(Well::WELTARGCMode cmode, dou && GasRate == other.GasRate && LiquidRate == other.LiquidRate && ResVRate == other.ResVRate - && BHPLimit == other.BHPLimit - && THPLimit == other.THPLimit + && BHPTarget == other.BHPTarget + && THPTarget == other.THPTarget + && bhp_hist_limit == other.bhp_hist_limit + && thp_hist_limit == other.thp_hist_limit && BHPH == other.BHPH && THPH == other.THPH && VFPTableNumber == other.VFPTableNumber @@ -288,8 +299,8 @@ void Well::WellProductionProperties::handleWELTARG(Well::WELTARGCMode cmode, dou << "gas rate: " << wp.GasRate << ", " << "liquid rate: " << wp.LiquidRate << ", " << "ResV rate: " << wp.ResVRate << ", " - << "BHP limit: " << wp.BHPLimit << ", " - << "THP limit: " << wp.THPLimit << ", " + << "BHP target: " << wp.BHPTarget << ", " + << "THP target: " << wp.THPTarget << ", " << "BHPH: " << wp.BHPH << ", " << "THPH: " << wp.THPH << ", " << "VFP table: " << wp.VFPTableNumber << ", " @@ -298,26 +309,23 @@ void Well::WellProductionProperties::handleWELTARG(Well::WELTARGCMode cmode, dou << "prediction: " << wp.predictionMode << " }"; } -bool Well::WellProductionProperties::effectiveHistoryProductionControl(const Well::ProducerCMode cmode) { + bool Well::WellProductionProperties::effectiveHistoryProductionControl(const Well::ProducerCMode cmode) { // Note, not handling CRAT for now return ( (cmode == ProducerCMode::LRAT || cmode == ProducerCMode::RESV || cmode == ProducerCMode::ORAT || cmode == ProducerCMode::WRAT || cmode == ProducerCMode::GRAT || cmode == ProducerCMode::BHP) ); } void Well::WellProductionProperties::resetDefaultBHPLimit() { - BHPLimit = UDAValue( 1. * unit::atm ); + double si_value = 1. * unit::atm; + this->setBHPLimit(si_value); } void Well::WellProductionProperties::clearControls() { m_productionControls = 0; } - void Well::WellProductionProperties::setBHPLimit(const double limit) { - BHPLimit = UDAValue( limit ); - } - - double Well::WellProductionProperties::getBHPLimit() const { - return BHPLimit.getSI(); + void Well::WellProductionProperties::setBHPLimit(const double si_limit) { + this->bhp_hist_limit = si_limit; } @@ -329,8 +337,14 @@ bool Well::WellProductionProperties::effectiveHistoryProductionControl(const Wel controls.gas_rate = UDA::eval_well_uda(this->GasRate, this->name, st, udq_undef); controls.liquid_rate = UDA::eval_well_uda(this->LiquidRate, this->name, st, udq_undef); controls.resv_rate = UDA::eval_well_uda(this->ResVRate, this->name, st, udq_undef); - controls.bhp_limit = UDA::eval_well_uda(this->BHPLimit, this->name, st, udq_undef); - controls.thp_limit= UDA::eval_well_uda(this->THPLimit, this->name, st, udq_undef); + + if (this->predictionMode) { + controls.bhp_limit = UDA::eval_well_uda(this->BHPTarget, this->name, st, udq_undef); + controls.thp_limit = UDA::eval_well_uda(this->THPTarget, this->name, st, udq_undef); + } else { + controls.bhp_limit = this->bhp_hist_limit; + controls.thp_limit = this->thp_hist_limit; + } controls.bhp_history = this->BHPH; controls.thp_history = this->THPH; @@ -349,8 +363,8 @@ bool Well::WellProductionProperties::effectiveHistoryProductionControl(const Wel update_count += active.update(udq_config, this->GasRate, this->name, UDAControl::WCONPROD_GRAT); update_count += active.update(udq_config, this->LiquidRate, this->name, UDAControl::WCONPROD_LRAT); update_count += active.update(udq_config, this->ResVRate, this->name, UDAControl::WCONPROD_RESV); - update_count += active.update(udq_config, this->BHPLimit, this->name, UDAControl::WCONPROD_BHP); - update_count += active.update(udq_config, this->THPLimit, this->name, UDAControl::WCONPROD_THP); + update_count += active.update(udq_config, this->BHPTarget, this->name, UDAControl::WCONPROD_BHP); + update_count += active.update(udq_config, this->THPTarget, this->name, UDAControl::WCONPROD_THP); return (update_count > 0); } diff --git a/tests/parser/GroupTests.cpp b/tests/parser/GroupTests.cpp index 349e08c49..b0b1bba34 100644 --- a/tests/parser/GroupTests.cpp +++ b/tests/parser/GroupTests.cpp @@ -424,9 +424,12 @@ BOOST_AUTO_TEST_CASE(TESTGCONSALE) { BOOST_CHECK(gconsale.has("G1")); BOOST_CHECK(!gconsale.has("G2")); const GConSale::GCONSALEGroup& group = gconsale.get("G1"); - BOOST_CHECK_EQUAL(group.sales_target.get(), 50000 * metric_to_si); - BOOST_CHECK_EQUAL(group.max_sales_rate.get(), 55000 * metric_to_si); - BOOST_CHECK_EQUAL(group.min_sales_rate.get(), 45000 * metric_to_si); + BOOST_CHECK_EQUAL(group.sales_target.get(), 50000); + BOOST_CHECK_EQUAL(group.max_sales_rate.get(), 55000); + BOOST_CHECK_EQUAL(group.min_sales_rate.get(), 45000); + BOOST_CHECK_EQUAL(group.sales_target.getSI(), 50000 * metric_to_si); + BOOST_CHECK_EQUAL(group.max_sales_rate.getSI(), 55000 * metric_to_si); + BOOST_CHECK_EQUAL(group.min_sales_rate.getSI(), 45000 * metric_to_si); BOOST_CHECK(group.max_proc == GConSale::MaxProcedure::WELL); const auto& gconsump = schedule.gConSump(0); @@ -434,8 +437,10 @@ BOOST_AUTO_TEST_CASE(TESTGCONSALE) { BOOST_CHECK(gconsump.has("G1")); BOOST_CHECK(gconsump.has("G2")); const GConSump::GCONSUMPGroup group1 = gconsump.get("G1"); - BOOST_CHECK_EQUAL(group1.consumption_rate.get(), 20 * metric_to_si); - BOOST_CHECK_EQUAL(group1.import_rate.get(), 50 * metric_to_si); + BOOST_CHECK_EQUAL(group1.consumption_rate.get(), 20); + BOOST_CHECK_EQUAL(group1.import_rate.get(), 50); + BOOST_CHECK_EQUAL(group1.consumption_rate.getSI(), 20 * metric_to_si); + BOOST_CHECK_EQUAL(group1.import_rate.getSI(), 50 * metric_to_si); BOOST_CHECK( group1.network_node == "a_node" ); const GConSump::GCONSUMPGroup group2 = gconsump.get("G2"); diff --git a/tests/parser/ScheduleTests.cpp b/tests/parser/ScheduleTests.cpp index cf9caa22d..bdcac78bd 100644 --- a/tests/parser/ScheduleTests.cpp +++ b/tests/parser/ScheduleTests.cpp @@ -1570,23 +1570,34 @@ BOOST_AUTO_TEST_CASE(changeBhpLimitInHistoryModeWithWeltarg) { FieldPropsManager fp( deck , grid, table); Runspec runspec (deck); Schedule sched(deck, grid , fp, eclipseProperties, runspec); + SummaryState st(std::chrono::system_clock::now()); + const auto& unit_system = deck.getActiveUnitSystem(); // The BHP limit should not be effected by WCONHIST - BOOST_CHECK_EQUAL(sched.getWell("P", 1).getProductionProperties().BHPLimit.getSI(), 50 * 1e5); // 1 - BOOST_CHECK_EQUAL(sched.getWell("P", 2).getProductionProperties().BHPLimit.getSI(), 50 * 1e5); // 2 - - - BOOST_CHECK_EQUAL(sched.getWell("I", 1).getInjectionProperties().BHPLimit.getSI(), 600 * 1e5); // 1 - BOOST_CHECK_EQUAL(sched.getWell("I", 2).getInjectionProperties().BHPLimit.getSI(), 600 * 1e5); // 2 - + { + const auto& c1 = sched.getWell("P",1).getProductionProperties().controls(st, 0); + const auto& c2 = sched.getWell("P",2).getProductionProperties().controls(st, 0); + BOOST_CHECK_EQUAL(c1.bhp_limit, 50 * 1e5); // 1 + BOOST_CHECK_EQUAL(c2.bhp_limit, 50 * 1e5); // 2 + } + { + const auto& c1 = sched.getWell("I",1).getInjectionProperties().controls(unit_system, st, 0); + const auto& c2 = sched.getWell("I",2).getInjectionProperties().controls(unit_system, st, 0); + BOOST_CHECK_EQUAL(c1.bhp_limit, 600 * 1e5); // 1 + BOOST_CHECK_EQUAL(c2.bhp_limit, 600 * 1e5); // 2 + } BOOST_CHECK_EQUAL(sched.getWell("I", 2).getInjectionProperties().hasInjectionControl(Opm::Well::InjectorCMode::BHP), true); - // The well is producer for timestep 3 and the injection properties BHPLimit should be set to zero. + // The well is producer for timestep 3 and the injection properties BHPTarget should be set to zero. BOOST_CHECK(sched.getWell("I", 3).isProducer()); - BOOST_CHECK_EQUAL(sched.getWell("I", 3).getInjectionProperties().BHPLimit.getSI(), 0); // 3 BOOST_CHECK_EQUAL(sched.getWell("I", 3).getProductionProperties().hasProductionControl(Opm::Well::ProducerCMode::BHP), true ); BOOST_CHECK_EQUAL(sched.getWell("I", 4).getInjectionProperties().hasInjectionControl(Opm::Well::InjectorCMode::BHP), true ); - BOOST_CHECK_EQUAL(sched.getWell("I", 4).getInjectionProperties().BHPLimit.getSI(), 6891.2 * 1e5); // 4 + { + const auto& c3 = sched.getWell("I",3).getInjectionProperties().controls(unit_system, st, 0); + const auto& c4 = sched.getWell("I",4).getInjectionProperties().controls(unit_system, st, 0); + BOOST_CHECK_EQUAL(c3.bhp_limit, 0); // 1 + BOOST_CHECK_EQUAL(c4.bhp_limit, 6891.2 * 1e5); // 2 + } } BOOST_AUTO_TEST_CASE(changeModeWithWHISTCTL) { diff --git a/tests/parser/WellTests.cpp b/tests/parser/WellTests.cpp index e3d5662ce..ba44a58bb 100644 --- a/tests/parser/WellTests.cpp +++ b/tests/parser/WellTests.cpp @@ -277,16 +277,16 @@ BOOST_AUTO_TEST_CASE(XHPLimitDefault) { auto productionProps = std::make_shared(well.getProductionProperties()); - productionProps->BHPLimit.reset(100); + productionProps->BHPTarget.reset(100); productionProps->addProductionControl(Opm::Well::ProducerCMode::BHP); well.updateProduction(productionProps); - BOOST_CHECK_EQUAL( 100 , well.getProductionProperties().BHPLimit.get()); + BOOST_CHECK_EQUAL( 100 , well.getProductionProperties().BHPTarget.get()); BOOST_CHECK_EQUAL( true, well.getProductionProperties().hasProductionControl( Opm::Well::ProducerCMode::BHP )); auto injProps = std::make_shared(well.getInjectionProperties()); - injProps->THPLimit.reset(200); + injProps->THPTarget.reset(200); well.updateInjection(injProps); - BOOST_CHECK_EQUAL( 200 , well.getInjectionProperties().THPLimit.get()); + BOOST_CHECK_EQUAL( 200 , well.getInjectionProperties().THPTarget.get()); BOOST_CHECK( !well.getInjectionProperties().hasInjectionControl( Opm::Well::InjectorCMode::THP )); } @@ -336,8 +336,8 @@ BOOST_AUTO_TEST_CASE(WellHaveProductionControlLimit) { properties3->GasRate.reset(100); properties3->LiquidRate.reset(100); properties3->ResVRate.reset(100); - properties3->BHPLimit.reset(100); - properties3->THPLimit.reset(100); + properties3->BHPTarget.reset(100); + properties3->THPTarget.reset(100); properties3->addProductionControl(Opm::Well::ProducerCMode::ORAT); properties3->addProductionControl(Opm::Well::ProducerCMode::LRAT); properties3->addProductionControl(Opm::Well::ProducerCMode::BHP); @@ -377,9 +377,9 @@ BOOST_AUTO_TEST_CASE(WellHaveInjectionControlLimit) { BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well::InjectorCMode::RESV )); auto injProps3 = std::make_shared(well.getInjectionProperties()); - injProps3->BHPLimit.reset(100); + injProps3->BHPTarget.reset(100); injProps3->addInjectionControl(Opm::Well::InjectorCMode::BHP); - injProps3->THPLimit.reset(100); + injProps3->THPTarget.reset(100); injProps3->addInjectionControl(Opm::Well::InjectorCMode::THP); well.updateInjection(injProps3); @@ -560,6 +560,7 @@ namespace { BOOST_AUTO_TEST_CASE(WCH_All_Specified_BHP_Defaulted) { + Opm::SummaryState st(std::chrono::system_clock::now()); const Opm::Well::WellProductionProperties& p = WCONHIST::properties(WCONHIST::all_specified()); @@ -572,11 +573,14 @@ BOOST_AUTO_TEST_CASE(WCH_All_Specified_BHP_Defaulted) BOOST_CHECK(p.controlMode == Opm::Well::ProducerCMode::ORAT); BOOST_CHECK(p.hasProductionControl(Opm::Well::ProducerCMode::BHP)); - BOOST_CHECK_EQUAL(p.BHPLimit.get(), 101325.); + + const auto& controls = p.controls(st, 0); + BOOST_CHECK_EQUAL(controls.bhp_limit, 101325.); } BOOST_AUTO_TEST_CASE(WCH_ORAT_Defaulted_BHP_Defaulted) { + Opm::SummaryState st(std::chrono::system_clock::now()); const Opm::Well::WellProductionProperties& p = WCONHIST::properties(WCONHIST::orat_defaulted()); @@ -588,11 +592,13 @@ BOOST_AUTO_TEST_CASE(WCH_ORAT_Defaulted_BHP_Defaulted) BOOST_CHECK(p.controlMode == Opm::Well::ProducerCMode::WRAT); BOOST_CHECK(p.hasProductionControl(Opm::Well::ProducerCMode::BHP)); - BOOST_CHECK_EQUAL(p.BHPLimit.get(), 101325.); + const auto& controls = p.controls(st, 0); + BOOST_CHECK_EQUAL(controls.bhp_limit, 101325.); } BOOST_AUTO_TEST_CASE(WCH_OWRAT_Defaulted_BHP_Defaulted) { + Opm::SummaryState st(std::chrono::system_clock::now()); const Opm::Well::WellProductionProperties& p = WCONHIST::properties(WCONHIST::owrat_defaulted()); @@ -604,11 +610,13 @@ BOOST_AUTO_TEST_CASE(WCH_OWRAT_Defaulted_BHP_Defaulted) BOOST_CHECK(p.controlMode == Opm::Well::ProducerCMode::GRAT); BOOST_CHECK(p.hasProductionControl(Opm::Well::ProducerCMode::BHP)); - BOOST_CHECK_EQUAL(p.BHPLimit.get(), 101325.); + const auto& controls = p.controls(st, 0); + BOOST_CHECK_EQUAL(controls.bhp_limit, 101325.); } BOOST_AUTO_TEST_CASE(WCH_Rates_Defaulted_BHP_Defaulted) { + Opm::SummaryState st(std::chrono::system_clock::now()); const Opm::Well::WellProductionProperties& p = WCONHIST::properties(WCONHIST::all_defaulted()); @@ -620,11 +628,13 @@ BOOST_AUTO_TEST_CASE(WCH_Rates_Defaulted_BHP_Defaulted) BOOST_CHECK(p.controlMode == Opm::Well::ProducerCMode::LRAT); BOOST_CHECK(p.hasProductionControl(Opm::Well::ProducerCMode::BHP)); - BOOST_CHECK_EQUAL(p.BHPLimit.get(), 101325.); + const auto& controls = p.controls(st, 0); + BOOST_CHECK_EQUAL(controls.bhp_limit, 101325.); } BOOST_AUTO_TEST_CASE(WCH_Rates_Defaulted_BHP_Specified) { + Opm::SummaryState st(std::chrono::system_clock::now()); const Opm::Well::WellProductionProperties& p = WCONHIST::properties(WCONHIST::all_defaulted_with_bhp()); @@ -637,11 +647,13 @@ BOOST_AUTO_TEST_CASE(WCH_Rates_Defaulted_BHP_Specified) BOOST_CHECK(p.controlMode == Opm::Well::ProducerCMode::RESV); BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::Well::ProducerCMode::BHP)); - BOOST_CHECK_EQUAL(p.BHPLimit.get(), 101325.); + const auto& controls = p.controls(st, 0); + BOOST_CHECK_EQUAL(controls.bhp_limit, 101325.); } BOOST_AUTO_TEST_CASE(WCH_Rates_NON_Defaulted_VFP) { + Opm::SummaryState st(std::chrono::system_clock::now()); const Opm::Well::WellProductionProperties& p = WCONHIST::properties(WCONHIST::all_defaulted_with_bhp_vfp_table()); @@ -656,11 +668,13 @@ BOOST_AUTO_TEST_CASE(WCH_Rates_NON_Defaulted_VFP) BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::Well::ProducerCMode::BHP)); BOOST_CHECK_EQUAL(p.VFPTableNumber, 3); BOOST_CHECK_EQUAL(p.ALQValue, 10.); - BOOST_CHECK_EQUAL(p.BHPLimit.get(), 101325.); + const auto& controls = p.controls(st, 0); + BOOST_CHECK_EQUAL(controls.bhp_limit, 101325.); } BOOST_AUTO_TEST_CASE(WCH_BHP_Specified) { + Opm::SummaryState st(std::chrono::system_clock::now()); const Opm::Well::WellProductionProperties& p = WCONHIST::properties(WCONHIST::bhp_defaulted()); @@ -673,8 +687,8 @@ BOOST_AUTO_TEST_CASE(WCH_BHP_Specified) BOOST_CHECK(p.controlMode == Opm::Well::ProducerCMode::BHP); BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::Well::ProducerCMode::BHP)); - - BOOST_CHECK_EQUAL(p.BHPLimit.get(), 5.e7); // 500 barsa + const auto& controls = p.controls(st, 0); + BOOST_CHECK_EQUAL(controls.bhp_limit, 5e7); } BOOST_AUTO_TEST_CASE(WCONPROD_ORAT_CMode) @@ -714,8 +728,8 @@ BOOST_AUTO_TEST_CASE(WCONPROD_THP_CMode) BOOST_CHECK_EQUAL(p.VFPTableNumber, 8); BOOST_CHECK_EQUAL(p.ALQValue, 13.); - BOOST_CHECK_EQUAL(p.THPLimit.get(), 1000000.); // 10 barsa - BOOST_CHECK_EQUAL(p.BHPLimit.get(), 101325.); // 1 atm. + BOOST_CHECK_EQUAL(p.THPTarget.getSI(), 1000000.); // 10 barsa + BOOST_CHECK_EQUAL(p.BHPTarget.getSI(), 101325.); // 1 atm. } BOOST_AUTO_TEST_CASE(WCONPROD_BHP_CMode) @@ -736,8 +750,10 @@ BOOST_AUTO_TEST_CASE(WCONPROD_BHP_CMode) BOOST_CHECK_EQUAL(p.VFPTableNumber, 8); BOOST_CHECK_EQUAL(p.ALQValue, 13.); - BOOST_CHECK_EQUAL(p.THPLimit.get(), 1000000.); // 10 barsa - BOOST_CHECK_EQUAL(p.BHPLimit.get(), 2000000.); // 20 barsa + BOOST_CHECK_EQUAL(p.THPTarget.get(), 10.); // 10 barsa + BOOST_CHECK_EQUAL(p.BHPTarget.get(), 20.); // 20 barsa + BOOST_CHECK_EQUAL(p.THPTarget.getSI(), 1000000.); // 10 barsa + BOOST_CHECK_EQUAL(p.BHPTarget.getSI(), 2000000.); // 20 barsa } diff --git a/tests/parser/integration/ScheduleCreateFromDeck.cpp b/tests/parser/integration/ScheduleCreateFromDeck.cpp index 67897b10f..a2406ce8a 100644 --- a/tests/parser/integration/ScheduleCreateFromDeck.cpp +++ b/tests/parser/integration/ScheduleCreateFromDeck.cpp @@ -146,7 +146,8 @@ BOOST_AUTO_TEST_CASE(WellTesting) { BOOST_CHECK(sched.hasWell("W_2")); BOOST_CHECK(sched.hasWell("W_3")); - BOOST_CHECK_CLOSE( 777/Metric::Time , sched.getWell("W_2", 7).getProductionProperties().ResVRate.get() , 0.0001); + BOOST_CHECK_CLOSE( 777/Metric::Time , sched.getWell("W_2", 7).getProductionProperties().ResVRate.getSI() , 0.0001); + BOOST_CHECK_CLOSE( 777 , sched.getWell("W_2", 7).getProductionProperties().ResVRate.get() , 0.0001); BOOST_CHECK_EQUAL( 0 , sched.getWell("W_2", 8).getProductionProperties().ResVRate.get()); BOOST_CHECK( Well::Status::SHUT == sched.getWell("W_2", 3).getStatus()); @@ -171,41 +172,75 @@ BOOST_AUTO_TEST_CASE(WellTesting) { BOOST_CHECK( Well::Status::AUTO == sched.getWell("W_3", 3).getStatus()); { const auto& prop7 = sched.getWell("W_3", 7).getProductionProperties(); - BOOST_CHECK_CLOSE( 999/Metric::Time , prop7.LiquidRate.get() , 0.001); + BOOST_CHECK_CLOSE( 999/Metric::Time , prop7.LiquidRate.getSI() , 0.001); + BOOST_CHECK_CLOSE( 999 , prop7.LiquidRate.get() , 0.001); BOOST_CHECK( Well::ProducerCMode::RESV == prop7.controlMode); } - BOOST_CHECK_CLOSE( 8000./Metric::Time , sched.getWell("W_3", 3).getProductionProperties().LiquidRate.get(), 1.e-12); - BOOST_CHECK_CLOSE( 18000./Metric::Time, sched.getWell("W_3", 8).getProductionProperties().LiquidRate.get(), 1.e-12); + BOOST_CHECK_CLOSE( 8000/Metric::Time , sched.getWell("W_3", 3).getProductionProperties().LiquidRate.getSI(), 1.e-12); + BOOST_CHECK_CLOSE( 18000/Metric::Time, sched.getWell("W_3", 8).getProductionProperties().LiquidRate.getSI(), 1.e-12); + BOOST_CHECK_CLOSE( 8000 , sched.getWell("W_3", 3).getProductionProperties().LiquidRate.get(), 1.e-12); + BOOST_CHECK_CLOSE( 18000, sched.getWell("W_3", 8).getProductionProperties().LiquidRate.get(), 1.e-12); { BOOST_CHECK_EQUAL(sched.getWell("W_1", 3).getProductionProperties().predictionMode, false); - BOOST_CHECK_CLOSE(sched.getWell("W_1", 3).getProductionProperties().WaterRate.get() , 4/Metric::Time, 0.001); - BOOST_CHECK_CLOSE(sched.getWell("W_1", 3).getProductionProperties().GasRate.get() , 12345/Metric::Time, 0.001); - BOOST_CHECK_CLOSE(sched.getWell("W_1", 3).getProductionProperties().OilRate.get() , 4000/Metric::Time, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 3).getProductionProperties().WaterRate.get() , 4, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 3).getProductionProperties().GasRate.get() , 12345, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 3).getProductionProperties().OilRate.get() , 4000, 0.001); - BOOST_CHECK_CLOSE(sched.getWell("W_1", 4).getProductionProperties().OilRate.get() , 4000/Metric::Time, 0.001); - BOOST_CHECK_CLOSE(sched.getWell("W_1", 4).getProductionProperties().WaterRate.get() , 4/Metric::Time, 0.001); - BOOST_CHECK_CLOSE(sched.getWell("W_1", 4).getProductionProperties().GasRate.get() , 12345/Metric::Time,0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 4).getProductionProperties().OilRate.get() , 4000, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 4).getProductionProperties().WaterRate.get() , 4, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 4).getProductionProperties().GasRate.get() , 12345,0.001); - BOOST_CHECK_CLOSE(sched.getWell("W_1", 5).getProductionProperties().WaterRate.get(), 4/Metric::Time, 0.001); - BOOST_CHECK_CLOSE(sched.getWell("W_1", 5).getProductionProperties().GasRate.get() , 12345/Metric::Time, 0.001); - BOOST_CHECK_CLOSE(sched.getWell("W_1", 5).getProductionProperties().OilRate.get() , 4000/Metric::Time, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 5).getProductionProperties().WaterRate.get(), 4, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 5).getProductionProperties().GasRate.get() , 12345, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 5).getProductionProperties().OilRate.get() , 4000, 0.001); BOOST_CHECK_EQUAL(sched.getWell("W_1", 6).getProductionProperties().predictionMode, false); - BOOST_CHECK_CLOSE(sched.getWell("W_1", 6).getProductionProperties().OilRate.get() , 14000/Metric::Time, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 6).getProductionProperties().OilRate.get() , 14000, 0.001); BOOST_CHECK_EQUAL(sched.getWell("W_1", 7).getProductionProperties().predictionMode, true); - BOOST_CHECK_CLOSE(sched.getWell("W_1", 7).getProductionProperties().OilRate.get() , 11000/Metric::Time, 0.001); - BOOST_CHECK_CLOSE(sched.getWell("W_1", 7).getProductionProperties().WaterRate.get() , 44/Metric::Time, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 7).getProductionProperties().OilRate.get() , 11000, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 7).getProductionProperties().WaterRate.get() , 44, 0.001); BOOST_CHECK_EQUAL(sched.getWell("W_1", 8).getProductionProperties().predictionMode, false); - BOOST_CHECK_CLOSE(sched.getWell("W_1", 8).getProductionProperties().OilRate.get() , 13000/Metric::Time , 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 8).getProductionProperties().OilRate.get() , 13000, 0.001); + + BOOST_CHECK_CLOSE(sched.getWell("W_1", 10).getInjectionProperties().BHPTarget.get(), 123.00 , 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 10).getInjectionProperties().THPTarget.get(), 678.00 , 0.001); + + //---- + + BOOST_CHECK_EQUAL(sched.getWell("W_1", 3).getProductionProperties().predictionMode, false); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 3).getProductionProperties().WaterRate.getSI() , 4/Metric::Time, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 3).getProductionProperties().GasRate.getSI() , 12345/Metric::Time, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 3).getProductionProperties().OilRate.getSI() , 4000/Metric::Time, 0.001); + + BOOST_CHECK_CLOSE(sched.getWell("W_1", 4).getProductionProperties().OilRate.getSI() , 4000/Metric::Time, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 4).getProductionProperties().WaterRate.getSI() , 4/Metric::Time, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 4).getProductionProperties().GasRate.getSI() , 12345/Metric::Time,0.001); + + BOOST_CHECK_CLOSE(sched.getWell("W_1", 5).getProductionProperties().WaterRate.getSI(), 4/Metric::Time, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 5).getProductionProperties().GasRate.getSI() , 12345/Metric::Time, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 5).getProductionProperties().OilRate.getSI() , 4000/Metric::Time, 0.001); + + + BOOST_CHECK_EQUAL(sched.getWell("W_1", 6).getProductionProperties().predictionMode, false); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 6).getProductionProperties().OilRate.getSI() , 14000/Metric::Time, 0.001); + + BOOST_CHECK_EQUAL(sched.getWell("W_1", 7).getProductionProperties().predictionMode, true); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 7).getProductionProperties().OilRate.getSI() , 11000/Metric::Time, 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 7).getProductionProperties().WaterRate.getSI() , 44/Metric::Time, 0.001); + + + BOOST_CHECK_EQUAL(sched.getWell("W_1", 8).getProductionProperties().predictionMode, false); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 8).getProductionProperties().OilRate.getSI() , 13000/Metric::Time , 0.001); + + BOOST_CHECK_CLOSE(sched.getWell("W_1", 10).getInjectionProperties().BHPTarget.getSI(), 123.00 * Metric::Pressure , 0.001); + BOOST_CHECK_CLOSE(sched.getWell("W_1", 10).getInjectionProperties().THPTarget.getSI(), 678.00 * Metric::Pressure , 0.001); - BOOST_CHECK_CLOSE(sched.getWell("W_1", 10).getInjectionProperties().BHPLimit.get(), 123.00 * Metric::Pressure , 0.001); - BOOST_CHECK_CLOSE(sched.getWell("W_1", 10).getInjectionProperties().THPLimit.get(), 678.00 * Metric::Pressure , 0.001); @@ -270,7 +305,8 @@ BOOST_AUTO_TEST_CASE(WellTestCOMPDAT) { BOOST_CHECK(sched.hasWell("W_2")); BOOST_CHECK(sched.hasWell("W_3")); { - BOOST_CHECK_CLOSE(13000/Metric::Time , sched.getWell("W_1", 8).getProductionProperties().OilRate.get() , 0.0001); + BOOST_CHECK_CLOSE(13000/Metric::Time , sched.getWell("W_1", 8).getProductionProperties().OilRate.getSI() , 0.0001); + BOOST_CHECK_CLOSE(13000 , sched.getWell("W_1", 8).getProductionProperties().OilRate.get() , 0.0001); { const auto& connections = sched.getWell("W_1", 3).getConnections(); BOOST_CHECK_EQUAL(4U, connections.size());