diff --git a/lib/eclipse/EclipseState/Schedule/Schedule.cpp b/lib/eclipse/EclipseState/Schedule/Schedule.cpp index e776b8ff0..31e2486d9 100644 --- a/lib/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/lib/eclipse/EclipseState/Schedule/Schedule.cpp @@ -740,6 +740,13 @@ namespace Opm { } properties.predictionMode = false; + properties.BHP = record.getItem( "BHP" ).hasValue(0) + ? record.getItem("BHP").getSIDouble(0) + : 0.0; + properties.THP = record.getItem( "THP" ).hasValue(0) + ? record.getItem("THP").getSIDouble(0) + : 0.0; + if (well.setInjectionProperties(currentStep, properties)) m_events.addEvent( ScheduleEvents::INJECTION_UPDATE , currentStep ); diff --git a/lib/eclipse/EclipseState/Schedule/WellInjectionProperties.cpp b/lib/eclipse/EclipseState/Schedule/WellInjectionProperties.cpp index e069979e5..d839ed8cb 100644 --- a/lib/eclipse/EclipseState/Schedule/WellInjectionProperties.cpp +++ b/lib/eclipse/EclipseState/Schedule/WellInjectionProperties.cpp @@ -29,6 +29,8 @@ namespace Opm { reservoirInjectionRate=0.0; BHPLimit=0.0; THPLimit=0.0; + BHP=0.0; + THP=0.0; VFPTableNumber=0; predictionMode=true; injectionControls=0; @@ -42,6 +44,8 @@ namespace Opm { (reservoirInjectionRate == other.reservoirInjectionRate) && (BHPLimit == other.BHPLimit) && (THPLimit == other.THPLimit) && + (BHP == other.BHP) && + (THP == other.THP) && (VFPTableNumber == other.VFPTableNumber) && (predictionMode == other.predictionMode) && (injectionControls == other.injectionControls) && @@ -64,6 +68,8 @@ namespace Opm { << "reservoir rate " << wp.reservoirInjectionRate << ", " << "BHP limit: " << wp.BHPLimit << ", " << "THP limit: " << wp.THPLimit << ", " + << "BHP: " << wp.BHP << ", " + << "THP: " << wp.THP << ", " << "VFP table: " << wp.VFPTableNumber << ", " << "prediction mode: " << wp.predictionMode << ", " << "injection ctrl: " << wp.injectionControls << ", " diff --git a/lib/eclipse/EclipseState/Schedule/WellProductionProperties.cpp b/lib/eclipse/EclipseState/Schedule/WellProductionProperties.cpp index 1f963fbc4..56524eb7f 100644 --- a/lib/eclipse/EclipseState/Schedule/WellProductionProperties.cpp +++ b/lib/eclipse/EclipseState/Schedule/WellProductionProperties.cpp @@ -86,6 +86,9 @@ namespace Opm { throw std::invalid_argument("Setting CMODE to unspecified control"); } + p.BHP = record.getItem("BHP").getSIDouble(0); + p.THP = record.getItem("THP").getSIDouble(0); + return p; } @@ -146,6 +149,8 @@ namespace Opm { && ResVRate == other.ResVRate && BHPLimit == other.BHPLimit && THPLimit == other.THPLimit + && BHP == other.BHP + && THP == other.THP && VFPTableNumber == other.VFPTableNumber && controlMode == other.controlMode && m_productionControls == other.m_productionControls @@ -168,6 +173,8 @@ namespace Opm { << "ResV rate: " << wp.ResVRate << ", " << "BHP limit: " << wp.BHPLimit << ", " << "THP limit: " << wp.THPLimit << ", " + << "BHP: " << wp.BHP << ", " + << "THP: " << wp.THP << ", " << "VFP table: " << wp.VFPTableNumber << ", " << "ALQ: " << wp.ALQValue << ", " << "prediction: " << wp.predictionMode << " }"; diff --git a/lib/eclipse/include/opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.hpp b/lib/eclipse/include/opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.hpp index a263befbd..d972b795f 100644 --- a/lib/eclipse/include/opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.hpp +++ b/lib/eclipse/include/opm/parser/eclipse/EclipseState/Schedule/WellInjectionProperties.hpp @@ -31,6 +31,8 @@ namespace Opm { double reservoirInjectionRate; double BHPLimit; double THPLimit; + double BHP; + double THP; int VFPTableNumber; bool predictionMode; int injectionControls; diff --git a/lib/eclipse/include/opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp b/lib/eclipse/include/opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp index be856dc47..2bc157701 100644 --- a/lib/eclipse/include/opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp +++ b/lib/eclipse/include/opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp @@ -39,6 +39,8 @@ namespace Opm { double ResVRate = 0.0; double BHPLimit = 0.0; double THPLimit = 0.0; + double BHP = 0.0; + double THP = 0.0; int VFPTableNumber = 0; double ALQValue = 0.0; bool predictionMode = false; diff --git a/lib/eclipse/tests/ScheduleTests.cpp b/lib/eclipse/tests/ScheduleTests.cpp index 168c295e6..0cda71ab5 100644 --- a/lib/eclipse/tests/ScheduleTests.cpp +++ b/lib/eclipse/tests/ScheduleTests.cpp @@ -2178,3 +2178,40 @@ BOOST_AUTO_TEST_CASE(handleWEFAC) { BOOST_CHECK_EQUAL(well_i->getEfficiencyFactor(3), 0.9); } + +BOOST_AUTO_TEST_CASE(historic_BHP_and_THP) { + Opm::Parser parser; + std::string input = + "START -- 0 \n" + "19 JUN 2007 / \n" + "SCHEDULE\n" + "DATES -- 1\n" + " 10 OKT 2008 / \n" + "/\n" + "WELSPECS\n" + " 'P' 'OP' 9 9 1* 'OIL' 1* / \n" + " 'I' 'OP' 9 9 1* 'WATER' 1* / \n" + "/\n" + "WCONHIST\n" + " P SHUT ORAT 6 500 0 0 0 1.2 1.1 / \n" + "/\n" + "WCONINJH\n" + " I WATER STOP 100 2.1 2.2 / \n" + "/\n" + ; + + ParseContext parseContext; + auto deck = parser.parseString(input, parseContext); + EclipseGrid grid(10,10,10); + TableManager table ( deck ); + Eclipse3DProperties eclipseProperties ( deck , table, grid); + Schedule schedule( deck, grid, eclipseProperties, Phases( true, true, true ) ,parseContext); + + const auto& prod = schedule.getWell("P")->getProductionProperties(1); + const auto& inje = schedule.getWell("I")->getInjectionProperties(1); + + BOOST_CHECK_CLOSE( 1.1 * 1e5, prod.BHP, 1e-5 ); + BOOST_CHECK_CLOSE( 1.2 * 1e5, prod.THP, 1e-5 ); + BOOST_CHECK_CLOSE( 2.1 * 1e5, inje.BHP, 1e-5 ); + BOOST_CHECK_CLOSE( 2.2 * 1e5, inje.THP, 1e-5 ); +}