diff --git a/CMakeLists_files.cmake b/CMakeLists_files.cmake index 7376bc3bb..c1f107a13 100644 --- a/CMakeLists_files.cmake +++ b/CMakeLists_files.cmake @@ -513,14 +513,12 @@ if(ENABLE_ECL_INPUT) opm/parser/eclipse/EclipseState/Schedule/Well/Connection.hpp opm/parser/eclipse/EclipseState/Schedule/Well/ProductionControls.hpp opm/parser/eclipse/EclipseState/Schedule/Well/InjectionControls.hpp - opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp opm/parser/eclipse/EclipseState/Schedule/Well/WList.hpp opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.hpp opm/parser/eclipse/EclipseState/Schedule/Well/WellEconProductionLimits.hpp opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.hpp opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.hpp - opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp opm/parser/eclipse/EclipseState/Schedule/Well/WellTestConfig.hpp opm/parser/eclipse/EclipseState/Schedule/Well/WellTestState.hpp opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.hpp diff --git a/opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp b/opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp index 3a5f04e92..0886e1290 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp @@ -31,8 +31,6 @@ #include #include #include -#include -#include #include #include @@ -42,6 +40,8 @@ namespace Opm { class DeckRecord; class EclipseGrid; class DeckKeyword; +class WellInjectionProperties; +class WellProductionProperties; struct WellGuideRate { bool available; diff --git a/src/opm/output/eclipse/AggregateWellData.cpp b/src/opm/output/eclipse/AggregateWellData.cpp index 0cd049eb0..14f94742d 100644 --- a/src/opm/output/eclipse/AggregateWellData.cpp +++ b/src/opm/output/eclipse/AggregateWellData.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -39,6 +40,8 @@ #include #include + + namespace VI = Opm::RestartIO::Helpers::VectorItems; // ##################################################################### @@ -133,8 +136,8 @@ namespace { int wellType(const Opm::Well2& well, const std::size_t sim_step) { - using WTypeVal = ::Opm::RestartIO::Helpers:: - VectorItems::IWell::Value::WellType; + using WTypeVal = ::Opm::RestartIO::Helpers::VectorItems::IWell::Value::WellType; + Opm::SummaryState summaryState; if (well.isProducer()) { return WTypeVal::Producer; @@ -142,8 +145,7 @@ namespace { using IType = ::Opm::WellInjector::TypeEnum; - const auto itype = well - .getInjectionProperties().injectorType; + const auto itype = well.injectionControls(summaryState).injector_type; switch (itype) { case IType::OIL: return WTypeVal::OilInj; @@ -156,25 +158,24 @@ namespace { int wellVFPTab(const Opm::Well2& well, const std::size_t sim_step) { + Opm::SummaryState summaryState; if (well.isInjector()) { - return well.getInjectionProperties().VFPTableNumber; + return well.injectionControls(summaryState).vfp_table_number; } - - return well.getProductionProperties().VFPTableNumber; + return well.productionControls(summaryState).vfp_table_number; } int ctrlMode(const Opm::Well2& well, const std::size_t sim_step) { - using WMCtrlVal = ::Opm::RestartIO::Helpers:: - VectorItems::IWell::Value::WellCtrlMode; + using WMCtrlVal = ::Opm::RestartIO::Helpers::VectorItems::IWell::Value::WellCtrlMode; + Opm::SummaryState summaryState; if (well.isInjector()) { - const auto& prop = well - .getInjectionProperties(); + const auto& controls = well.injectionControls(summaryState); - const auto wmctl = prop.controlMode; - const auto wtype = prop.injectorType; + const auto wmctl = controls.cmode; + const auto wtype = controls.injector_type; using CMode = ::Opm::WellInjector::ControlModeEnum; using WType = ::Opm::WellInjector::TypeEnum; @@ -209,12 +210,11 @@ namespace { } } else if (well.isProducer()) { - const auto& prop = well - .getProductionProperties(); + const auto& controls = well.productionControls(summaryState); using CMode = ::Opm::WellProducer::ControlModeEnum; - switch (prop.controlMode) { + switch (controls.cmode) { case CMode::ORAT: return WMCtrlVal::OilRate; case CMode::WRAT: return WMCtrlVal::WatRate; case CMode::GRAT: return WMCtrlVal::GasRate; @@ -312,14 +312,7 @@ namespace { // control mode in the simulator. iWell[Ix::ActWCtrl] = ctrlMode(well, sim_step); - const auto isPred = - (well.isProducer() && - well.getProductionProperties().predictionMode) - || - (well.isInjector() && - well.getInjectionProperties().predictionMode); - - if (isPred) { + if (well.predictionMode()) { // Well in prediction mode (WCONPROD, WCONINJE). Assign // requested control mode for prediction. iWell[Ix::PredReqWCtrl] = iWell[Ix::ActWCtrl]; @@ -474,38 +467,38 @@ namespace { assignDefaultSWell(sWell); if (well.isProducer()) { - const auto& pp = well.getProductionProperties(); - const auto& predMode = pp.predictionMode; + const auto& pc = well.productionControls(smry); + const auto& predMode = well.predictionMode(); - if ((pp.OilRate != 0.0) || (!predMode)) { + if ((pc.oil_rate != 0.0) || (!predMode)) { sWell[Ix::OilRateTarget] = - swprop(M::liquid_surface_rate, pp.OilRate); + swprop(M::liquid_surface_rate, pc.oil_rate); } - if ((pp.WaterRate != 0.0) || (!predMode)) { + if ((pc.water_rate != 0.0) || (!predMode)) { sWell[Ix::WatRateTarget] = - swprop(M::liquid_surface_rate, pp.WaterRate); + swprop(M::liquid_surface_rate, pc.water_rate); } - if ((pp.GasRate != 0.0) || (!predMode)) { + if ((pc.gas_rate != 0.0) || (!predMode)) { sWell[Ix::GasRateTarget] = - swprop(M::gas_surface_rate, pp.GasRate); + swprop(M::gas_surface_rate, pc.gas_rate); sWell[Ix::HistGasRateTarget] = sWell[Ix::GasRateTarget]; } - if (pp.LiquidRate != 0.0 || (!predMode)) { + if (pc.liquid_rate != 0.0 || (!predMode)) { sWell[Ix::LiqRateTarget] = - swprop(M::liquid_surface_rate, pp.LiquidRate); + swprop(M::liquid_surface_rate, pc.liquid_rate); sWell[Ix::HistLiqRateTarget] = sWell[Ix::LiqRateTarget]; } else { sWell[Ix::LiqRateTarget] = - swprop(M::liquid_surface_rate, pp.OilRate + pp.WaterRate); + swprop(M::liquid_surface_rate, pc.oil_rate + pc.water_rate); } - if (pp.ResVRate != 0.0) { + if (pc.resv_rate != 0.0) { sWell[Ix::ResVRateTarget] = - swprop(M::rate, pp.ResVRate); + swprop(M::rate, pc.resv_rate); } else if ((smry.has("WVPR:" + well.name())) && (!predMode)) { // Write out summary voidage production rate if @@ -516,49 +509,49 @@ namespace { } } - sWell[Ix::THPTarget] = pp.THPLimit != 0.0 - ? swprop(M::pressure, pp.THPLimit) + sWell[Ix::THPTarget] = pc.thp_limit != 0.0 + ? swprop(M::pressure, pc.thp_limit) : 0.0; - sWell[Ix::BHPTarget] = pp.BHPLimit != 0.0 - ? swprop(M::pressure, pp.BHPLimit) + sWell[Ix::BHPTarget] = pc.bhp_limit != 0.0 + ? swprop(M::pressure, pc.bhp_limit) : swprop(M::pressure, 1.0*::Opm::unit::atm); sWell[Ix::HistBHPTarget] = sWell[Ix::BHPTarget]; } else if (well.isInjector()) { - const auto& ip = well.getInjectionProperties(); + const auto& ic = well.injectionControls(smry); using IP = ::Opm::WellInjector::ControlModeEnum; using IT = ::Opm::WellInjector::TypeEnum; - if (ip.hasInjectionControl(IP::RATE)) { - if (ip.injectorType == IT::OIL) { + if (ic.hasControl(IP::RATE)) { + if (ic.injector_type == IT::OIL) { sWell[Ix::OilRateTarget] = - swprop(M::liquid_surface_rate, ip.surfaceInjectionRate); + swprop(M::liquid_surface_rate, ic.surface_rate); } - if (ip.injectorType == IT::WATER) { + if (ic.injector_type == IT::WATER) { sWell[Ix::WatRateTarget] = - swprop(M::liquid_surface_rate, ip.surfaceInjectionRate); + swprop(M::liquid_surface_rate, ic.surface_rate); sWell[Ix::HistLiqRateTarget] = sWell[Ix::WatRateTarget]; } - if (ip.injectorType == IT::GAS) { + if (ic.injector_type == IT::GAS) { sWell[Ix::GasRateTarget] = - swprop(M::gas_surface_rate, ip.surfaceInjectionRate); + swprop(M::gas_surface_rate, ic.surface_rate); sWell[Ix::HistGasRateTarget] = sWell[Ix::GasRateTarget]; } } - if (ip.hasInjectionControl(IP::RESV)) { + if (ic.hasControl(IP::RESV)) { sWell[Ix::ResVRateTarget] = - swprop(M::rate, ip.reservoirInjectionRate); + swprop(M::rate, ic.reservoir_rate); } - if (ip.hasInjectionControl(IP::THP)) { - sWell[Ix::THPTarget] = swprop(M::pressure, ip.THPLimit); + if (ic.hasControl(IP::THP)) { + sWell[Ix::THPTarget] = swprop(M::pressure, ic.thp_limit); } - sWell[Ix::BHPTarget] = ip.hasInjectionControl(IP::BHP) - ? swprop(M::pressure, ip.BHPLimit) + sWell[Ix::BHPTarget] = ic.hasControl(IP::BHP) + ? swprop(M::pressure, ic.bhp_limit) : swprop(M::pressure, 1.0E05*::Opm::unit::psia); sWell[Ix::HistBHPTarget] = sWell[Ix::BHPTarget]; } @@ -595,10 +588,11 @@ namespace { { using M = ::Opm::UnitSystem::measure; using Ix = ::Opm::RestartIO::Helpers::VectorItems::XWell::index; + Opm::SummaryState summaryState; const auto bhpTarget = well.isInjector() - ? well.getInjectionProperties ().BHPLimit - : well.getProductionProperties().BHPLimit; + ? well.injectionControls(summaryState).bhp_limit + : well.productionControls(summaryState).bhp_limit; xWell[Ix::BHPTarget] = units.from_si(M::pressure, bhpTarget); } @@ -731,9 +725,7 @@ namespace { } else if (well.isInjector()) { using IType = ::Opm::WellInjector::TypeEnum; - - const auto itype = well - .getInjectionProperties().injectorType; + const auto itype = well.injectionControls(smry).injector_type; switch (itype) { case IType::OIL: diff --git a/src/opm/output/eclipse/Summary.cpp b/src/opm/output/eclipse/Summary.cpp index f016e2338..bd224dd6a 100644 --- a/src/opm/output/eclipse/Summary.cpp +++ b/src/opm/output/eclipse/Summary.cpp @@ -40,7 +40,6 @@ #include #include #include -#include #include #include #include @@ -48,6 +47,9 @@ #include #include +#include "src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp" +#include "src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp" + namespace { struct SegmentResultDescriptor { diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp index 32656c80f..1e075bca4 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp @@ -55,9 +55,7 @@ #include #include #include -#include #include -#include #include #include #include @@ -65,6 +63,8 @@ #include #include "injection.hpp" +#include "Well/WellProductionProperties.hpp" +#include "Well/WellInjectionProperties.hpp" namespace Opm { diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well2.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well2.cpp index c301e3c7a..f4c3bb3f3 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well2.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Well/Well2.cpp @@ -23,6 +23,8 @@ #include #include +#include "WellProductionProperties.hpp" +#include "WellInjectionProperties.hpp" namespace Opm { diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.cpp index 3d69c9083..3f3332655 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.cpp @@ -24,8 +24,8 @@ #include #include #include -#include +#include "WellInjectionProperties.hpp" #include "../injection.hpp" namespace Opm { diff --git a/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp b/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp similarity index 100% rename from opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp rename to src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp diff --git a/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.cpp b/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.cpp index df8c1397b..657c0b5a5 100644 --- a/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.cpp +++ b/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.cpp @@ -25,7 +25,8 @@ #include #include #include -#include + +#include "WellProductionProperties.hpp" namespace Opm { diff --git a/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp b/src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp similarity index 100% rename from opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp rename to src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp diff --git a/tests/parser/GroupTests.cpp b/tests/parser/GroupTests.cpp index 72913a8a8..2d460d728 100644 --- a/tests/parser/GroupTests.cpp +++ b/tests/parser/GroupTests.cpp @@ -34,6 +34,9 @@ #include #include +#include "src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp" +#include "src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp" + using namespace Opm; static TimeMap createXDaysTimeMap(size_t numDays) { diff --git a/tests/parser/ScheduleTests.cpp b/tests/parser/ScheduleTests.cpp index 830152509..1d74063c9 100644 --- a/tests/parser/ScheduleTests.cpp +++ b/tests/parser/ScheduleTests.cpp @@ -47,6 +47,9 @@ #include #include +#include "src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp" +#include "src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp" + using namespace Opm; static Deck createDeck() { diff --git a/tests/parser/WellTests.cpp b/tests/parser/WellTests.cpp index a15b17417..21f88a398 100644 --- a/tests/parser/WellTests.cpp +++ b/tests/parser/WellTests.cpp @@ -37,11 +37,13 @@ #include #include #include -#include #include #include #include +#include "src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp" +#include "src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp" + using namespace Opm; diff --git a/tests/parser/integration/ParseKEYWORD.cpp b/tests/parser/integration/ParseKEYWORD.cpp index fcc31985d..2e9551805 100644 --- a/tests/parser/integration/ParseKEYWORD.cpp +++ b/tests/parser/integration/ParseKEYWORD.cpp @@ -32,6 +32,9 @@ #include #include +#include "src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp" +#include "src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp" + using namespace Opm; inline std::string pathprefix() { diff --git a/tests/parser/integration/ScheduleCreateFromDeck.cpp b/tests/parser/integration/ScheduleCreateFromDeck.cpp index 1f6c61e06..8a0e42923 100644 --- a/tests/parser/integration/ScheduleCreateFromDeck.cpp +++ b/tests/parser/integration/ScheduleCreateFromDeck.cpp @@ -36,6 +36,9 @@ #include #include +#include "src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp" +#include "src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp" + using namespace Opm; diff --git a/tests/test_writenumwells.cpp b/tests/test_writenumwells.cpp index 071d6bce9..2b921cc82 100644 --- a/tests/test_writenumwells.cpp +++ b/tests/test_writenumwells.cpp @@ -32,6 +32,9 @@ #include #include +#include "src/opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp" +#include "src/opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp" + // ERT stuff #include #include