assigning BHP limit for WCONHIST and WCONINJH keywords

This commit is contained in:
Kai Bao
2018-12-18 14:42:25 +01:00
parent f6136e69fe
commit 0dc80689c0
3 changed files with 37 additions and 16 deletions

View File

@@ -60,6 +60,7 @@
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
#include <opm/parser/eclipse/Units/Dimension.hpp>
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
#include <opm/parser/eclipse/Units/Units.hpp>
namespace Opm {
@@ -986,20 +987,34 @@ namespace Opm {
properties.injectorType = injectorType;
const std::string& cmodeString = record.getItem("CMODE").getTrimmedString(0);
WellInjector::ControlModeEnum controlMode = WellInjector::ControlModeFromString( cmodeString );
if (!record.getItem("RATE").defaultApplied(0)) {
properties.surfaceInjectionRate = injectionRate;
properties.addInjectionControl(controlMode);
properties.controlMode = controlMode;
}
properties.predictionMode = false;
if ( record.getItem( "BHP" ).hasValue(0) )
properties.BHPH = record.getItem("BHP").getSIDouble(0);
if ( record.getItem( "THP" ).hasValue(0) )
properties.THPH = record.getItem("THP").getSIDouble(0);
const std::string& cmodeString = record.getItem("CMODE").getTrimmedString(0);
WellInjector::ControlModeEnum controlMode = WellInjector::ControlModeFromString( cmodeString );
if (controlMode == WellInjector::BHP) {
properties.BHPLimit = properties.BHPH;
} else {
if (properties.predictionMode || properties.controlMode == WellInjector::RATE) {
// there is no document about what value the default BHP limit should be
// we use the one from WCONINJE for now
properties.BHPLimit = 6895. * unit::barsa;
}
// otherwise, the BHPLimit stays the same
}
properties.addInjectionControl(WellInjector::BHP);
properties.addInjectionControl(controlMode);
properties.controlMode = controlMode;
properties.predictionMode = false;
const int VFPTableNumber = record.getItem("VFP_TABLE").get< int >(0);
if (VFPTableNumber > 0) {
properties.VFPTableNumber = VFPTableNumber;

View File

@@ -25,6 +25,7 @@
#include <opm/parser/eclipse/Deck/DeckRecord.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
#include <opm/parser/eclipse/EclipseState/Schedule/WellProductionProperties.hpp>
#include <opm/parser/eclipse/Units/Units.hpp>
namespace Opm {
@@ -75,11 +76,16 @@ namespace Opm {
if ( !p.hasProductionControl( wp::BHP ) )
p.addProductionControl( wp::BHP );
if (cmode == wp::BHP)
if (cmode == wp::BHP) {
p.BHPLimit = record.getItem( "BHP" ).getSIDouble( 0 );
else
p.BHPLimit = prev_properties.BHPLimit;
} else {
if (!prev_properties.predictionMode) {
p.BHPLimit = prev_properties.BHPLimit;
} else {
// by default the BHP limit is 1 atm
p.BHPLimit = 1. * unit::atm;
}
}
}
if ( record.getItem( "BHP" ).hasValue(0) )

View File

@@ -850,7 +850,7 @@ BOOST_AUTO_TEST_CASE(WCH_All_Specified_BHP_Defaulted)
BOOST_CHECK(p.hasProductionControl(Opm::WellProducer::BHP));
BOOST_CHECK_EQUAL(p.VFPTableNumber, 12);
BOOST_CHECK_EQUAL(p.ALQValue, 18.);
BOOST_CHECK_EQUAL(p.BHPLimit, 100.);
BOOST_CHECK_EQUAL(p.BHPLimit, 101325.);
}
BOOST_AUTO_TEST_CASE(WCH_ORAT_Defaulted_BHP_Defaulted)
@@ -868,7 +868,7 @@ BOOST_AUTO_TEST_CASE(WCH_ORAT_Defaulted_BHP_Defaulted)
BOOST_CHECK(p.hasProductionControl(Opm::WellProducer::BHP));
BOOST_CHECK_EQUAL(p.VFPTableNumber, 12);
BOOST_CHECK_EQUAL(p.ALQValue, 18.);
BOOST_CHECK_EQUAL(p.BHPLimit, 100.);
BOOST_CHECK_EQUAL(p.BHPLimit, 101325.);
}
BOOST_AUTO_TEST_CASE(WCH_OWRAT_Defaulted_BHP_Defaulted)
@@ -886,7 +886,7 @@ BOOST_AUTO_TEST_CASE(WCH_OWRAT_Defaulted_BHP_Defaulted)
BOOST_CHECK(p.hasProductionControl(Opm::WellProducer::BHP));
BOOST_CHECK_EQUAL(p.VFPTableNumber, 12);
BOOST_CHECK_EQUAL(p.ALQValue, 18.);
BOOST_CHECK_EQUAL(p.BHPLimit, 100.);
BOOST_CHECK_EQUAL(p.BHPLimit, 101325.);
}
BOOST_AUTO_TEST_CASE(WCH_Rates_Defaulted_BHP_Defaulted)
@@ -904,7 +904,7 @@ BOOST_AUTO_TEST_CASE(WCH_Rates_Defaulted_BHP_Defaulted)
BOOST_CHECK(p.hasProductionControl(Opm::WellProducer::BHP));
BOOST_CHECK_EQUAL(p.VFPTableNumber, 12);
BOOST_CHECK_EQUAL(p.ALQValue, 18.);
BOOST_CHECK_EQUAL(p.BHPLimit, 100.);
BOOST_CHECK_EQUAL(p.BHPLimit, 101325.);
}
BOOST_AUTO_TEST_CASE(WCH_Rates_Defaulted_BHP_Specified)
@@ -923,7 +923,7 @@ BOOST_AUTO_TEST_CASE(WCH_Rates_Defaulted_BHP_Specified)
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::WellProducer::BHP));
BOOST_CHECK_EQUAL(p.VFPTableNumber, 12);
BOOST_CHECK_EQUAL(p.ALQValue, 18.);
BOOST_CHECK_EQUAL(p.BHPLimit, 100.);
BOOST_CHECK_EQUAL(p.BHPLimit, 101325.);
}
BOOST_AUTO_TEST_CASE(WCH_Rates_NON_Defaulted_VFP)
@@ -942,7 +942,7 @@ BOOST_AUTO_TEST_CASE(WCH_Rates_NON_Defaulted_VFP)
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::WellProducer::BHP));
BOOST_CHECK_EQUAL(p.VFPTableNumber, 3);
BOOST_CHECK_EQUAL(p.ALQValue, 10.);
BOOST_CHECK_EQUAL(p.BHPLimit, 100.);
BOOST_CHECK_EQUAL(p.BHPLimit, 101325.);
}
BOOST_AUTO_TEST_CASE(WCH_Whistctl)
@@ -963,7 +963,7 @@ BOOST_AUTO_TEST_CASE(WCH_Whistctl)
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::WellProducer::BHP));
BOOST_CHECK_EQUAL(p.VFPTableNumber, 3);
BOOST_CHECK_EQUAL(p.ALQValue, 10.);
BOOST_CHECK_EQUAL(p.BHPLimit, 100.);
BOOST_CHECK_EQUAL(p.BHPLimit, 101325.);
}
BOOST_AUTO_TEST_CASE(WCH_BHP_Specified)