Merge pull request #96 from joakim-hove/well-reservoir-rate
Well injection: differentiate between surface rate and reservoir rate
This commit is contained in:
@@ -188,9 +188,11 @@ namespace Opm {
|
||||
DeckRecordConstPtr record = keyword->getRecord(recordNr);
|
||||
const std::string& wellName = record->getItem("WELL")->getString(0);
|
||||
WellPtr well = getWell(wellName);
|
||||
double injectionRate = record->getItem("SURFACE_FLOW_TARGET")->getSIDouble(0);
|
||||
double surfaceInjectionRate = record->getItem("SURFACE_FLOW_TARGET")->getSIDouble(0);
|
||||
double reservoirInjectionRate = record->getItem("RESV_FLOW_TARGET")->getSIDouble(0);
|
||||
|
||||
well->setInjectionRate( currentStep , injectionRate );
|
||||
well->setSurfaceInjectionRate( currentStep , surfaceInjectionRate );
|
||||
well->setReservoirInjectionRate( currentStep , reservoirInjectionRate );
|
||||
well->setInPredictionMode(currentStep, true);
|
||||
}
|
||||
}
|
||||
@@ -202,7 +204,7 @@ namespace Opm {
|
||||
WellPtr well = getWell(wellName);
|
||||
double injectionRate = record->getItem("RATE")->getSIDouble(0);
|
||||
|
||||
well->setInjectionRate( currentStep , injectionRate );
|
||||
well->setSurfaceInjectionRate( currentStep , injectionRate );
|
||||
well->setInPredictionMode(currentStep, false );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,7 +31,8 @@ namespace Opm {
|
||||
: m_oilRate( new DynamicState<double>( timeMap , 0.0)) ,
|
||||
m_gasRate(new DynamicState<double>(timeMap, 0.0)),
|
||||
m_waterRate(new DynamicState<double>(timeMap, 0.0)),
|
||||
m_injectionRate(new DynamicState<double>(timeMap, 0.0)),
|
||||
m_surfaceInjectionRate(new DynamicState<double>(timeMap, 0.0)),
|
||||
m_reservoirInjectionRate(new DynamicState<double>(timeMap, 0.0)),
|
||||
m_inPredictionMode(new DynamicState<bool>(timeMap, true)),
|
||||
m_isProducer(new DynamicState<bool>(timeMap, true)) ,
|
||||
m_completions( new DynamicState<CompletionSetConstPtr>( timeMap , CompletionSetConstPtr( new CompletionSet()) )),
|
||||
@@ -85,15 +86,25 @@ namespace Opm {
|
||||
switch2Producer( timeStep );
|
||||
}
|
||||
|
||||
double Well::getInjectionRate(size_t timeStep) const {
|
||||
return m_injectionRate->get(timeStep);
|
||||
double Well::getSurfaceInjectionRate(size_t timeStep) const {
|
||||
return m_surfaceInjectionRate->get(timeStep);
|
||||
}
|
||||
|
||||
void Well::setInjectionRate(size_t timeStep, double injectionRate) {
|
||||
m_injectionRate->add(timeStep, injectionRate);
|
||||
void Well::setSurfaceInjectionRate(size_t timeStep, double injectionRate) {
|
||||
m_surfaceInjectionRate->add(timeStep, injectionRate);
|
||||
switch2Injector( timeStep );
|
||||
}
|
||||
|
||||
double Well::getReservoirInjectionRate(size_t timeStep) const {
|
||||
return m_reservoirInjectionRate->get(timeStep);
|
||||
}
|
||||
|
||||
void Well::setReservoirInjectionRate(size_t timeStep, double injectionRate) {
|
||||
m_reservoirInjectionRate->add(timeStep, injectionRate);
|
||||
switch2Injector( timeStep );
|
||||
}
|
||||
|
||||
|
||||
bool Well::isProducer(size_t timeStep) const {
|
||||
return m_isProducer->get(timeStep);
|
||||
}
|
||||
@@ -104,7 +115,8 @@ namespace Opm {
|
||||
|
||||
void Well::switch2Producer(size_t timeStep ) {
|
||||
m_isProducer->add(timeStep , true);
|
||||
m_injectionRate->add(timeStep, 0);
|
||||
m_surfaceInjectionRate->add(timeStep, 0);
|
||||
m_reservoirInjectionRate->add(timeStep , 0);
|
||||
}
|
||||
|
||||
void Well::switch2Injector(size_t timeStep ) {
|
||||
|
||||
@@ -46,8 +46,10 @@ namespace Opm {
|
||||
void setGasRate(size_t timeStep, double gasRate);
|
||||
double getWaterRate(size_t timeStep) const;
|
||||
void setWaterRate(size_t timeStep, double waterRate);
|
||||
double getInjectionRate(size_t timeStep) const;
|
||||
void setInjectionRate(size_t timeStep, double injectionRate);
|
||||
double getSurfaceInjectionRate(size_t timeStep) const;
|
||||
void setSurfaceInjectionRate(size_t timeStep, double injectionRate);
|
||||
double getReservoirInjectionRate(size_t timeStep) const;
|
||||
void setReservoirInjectionRate(size_t timeStep, double injectionRate);
|
||||
|
||||
int getHeadI() const;
|
||||
int getHeadJ() const;
|
||||
@@ -70,7 +72,8 @@ namespace Opm {
|
||||
std::shared_ptr<DynamicState<double> > m_oilRate;
|
||||
std::shared_ptr<DynamicState<double> > m_gasRate;
|
||||
std::shared_ptr<DynamicState<double> > m_waterRate;
|
||||
std::shared_ptr<DynamicState<double> > m_injectionRate;
|
||||
std::shared_ptr<DynamicState<double> > m_surfaceInjectionRate;
|
||||
std::shared_ptr<DynamicState<double> > m_reservoirInjectionRate;
|
||||
|
||||
std::shared_ptr<DynamicState<bool> > m_inPredictionMode;
|
||||
std::shared_ptr<DynamicState<bool> > m_isProducer;
|
||||
|
||||
@@ -149,14 +149,25 @@ BOOST_AUTO_TEST_CASE(setWaterRate_RateSetCorrect) {
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(setInjectionRate_RateSetCorrect) {
|
||||
BOOST_AUTO_TEST_CASE(setSurfaceInjectionRate_RateSetCorrect) {
|
||||
Opm::TimeMapPtr timeMap = createXDaysTimeMap(10);
|
||||
Opm::Well well("WELL1" , 0, 0, 0.0, timeMap , 0);
|
||||
|
||||
BOOST_CHECK_EQUAL(0.0 , well.getInjectionRate( 5 ));
|
||||
well.setInjectionRate( 5 , 108 );
|
||||
BOOST_CHECK_EQUAL(108 , well.getInjectionRate( 5 ));
|
||||
BOOST_CHECK_EQUAL(108 , well.getInjectionRate( 8 ));
|
||||
BOOST_CHECK_EQUAL(0.0 , well.getSurfaceInjectionRate( 5 ));
|
||||
well.setSurfaceInjectionRate( 5 , 108 );
|
||||
BOOST_CHECK_EQUAL(108 , well.getSurfaceInjectionRate( 5 ));
|
||||
BOOST_CHECK_EQUAL(108 , well.getSurfaceInjectionRate( 8 ));
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(setReservoirInjectionRate_RateSetCorrect) {
|
||||
Opm::TimeMapPtr timeMap = createXDaysTimeMap(10);
|
||||
Opm::Well well("WELL1" , 0, 0, 0.0, timeMap , 0);
|
||||
|
||||
BOOST_CHECK_EQUAL(0.0 , well.getReservoirInjectionRate( 5 ));
|
||||
well.setReservoirInjectionRate( 5 , 108 );
|
||||
BOOST_CHECK_EQUAL(108 , well.getReservoirInjectionRate( 5 ));
|
||||
BOOST_CHECK_EQUAL(108 , well.getReservoirInjectionRate( 8 ));
|
||||
}
|
||||
|
||||
|
||||
@@ -168,11 +179,18 @@ BOOST_AUTO_TEST_CASE(isProducerCorrectlySet) {
|
||||
BOOST_CHECK_EQUAL( false , well.isInjector(0));
|
||||
BOOST_CHECK_EQUAL( true , well.isProducer(0));
|
||||
|
||||
/* Set an injection rate => Well becomes an Injector */
|
||||
well.setInjectionRate(3 , 100);
|
||||
/* Set a surface injection rate => Well becomes an Injector */
|
||||
well.setSurfaceInjectionRate(3 , 100);
|
||||
BOOST_CHECK_EQUAL( true , well.isInjector(3));
|
||||
BOOST_CHECK_EQUAL( false , well.isProducer(3));
|
||||
BOOST_CHECK_EQUAL( 100 , well.getInjectionRate(3));
|
||||
BOOST_CHECK_EQUAL( 100 , well.getSurfaceInjectionRate(3));
|
||||
|
||||
/* Set a reservoir injection rate => Well becomes an Injector */
|
||||
well.setReservoirInjectionRate(4 , 200);
|
||||
BOOST_CHECK_EQUAL( true , well.isInjector(4));
|
||||
BOOST_CHECK_EQUAL( false , well.isProducer(4));
|
||||
BOOST_CHECK_EQUAL( 200 , well.getReservoirInjectionRate(4));
|
||||
|
||||
|
||||
/* Set rates => Well becomes a producer; injection rate should be set to 0. */
|
||||
well.setOilRate(4 , 100 );
|
||||
@@ -181,16 +199,17 @@ BOOST_AUTO_TEST_CASE(isProducerCorrectlySet) {
|
||||
|
||||
BOOST_CHECK_EQUAL( false , well.isInjector(4));
|
||||
BOOST_CHECK_EQUAL( true , well.isProducer(4));
|
||||
BOOST_CHECK_EQUAL( 0 , well.getInjectionRate(4));
|
||||
BOOST_CHECK_EQUAL( 0 , well.getSurfaceInjectionRate(4));
|
||||
BOOST_CHECK_EQUAL( 0 , well.getReservoirInjectionRate(4));
|
||||
BOOST_CHECK_EQUAL( 100 , well.getOilRate(4));
|
||||
BOOST_CHECK_EQUAL( 200 , well.getGasRate(4));
|
||||
BOOST_CHECK_EQUAL( 300 , well.getWaterRate(4));
|
||||
|
||||
/* Set injection rate => Well becomes injector - all produced rates -> 0 */
|
||||
well.setInjectionRate( 6 , 50 );
|
||||
well.setReservoirInjectionRate( 6 , 50 );
|
||||
BOOST_CHECK_EQUAL( true , well.isInjector(6));
|
||||
BOOST_CHECK_EQUAL( false , well.isProducer(6));
|
||||
BOOST_CHECK_EQUAL( 50 , well.getInjectionRate(6));
|
||||
BOOST_CHECK_EQUAL( 50 , well.getReservoirInjectionRate(6));
|
||||
BOOST_CHECK_EQUAL( 0 , well.getOilRate(6));
|
||||
BOOST_CHECK_EQUAL( 0 , well.getGasRate(6));
|
||||
BOOST_CHECK_EQUAL( 0 , well.getWaterRate(6));
|
||||
|
||||
@@ -102,8 +102,10 @@ BOOST_AUTO_TEST_CASE(WellTesting) {
|
||||
BOOST_CHECK_CLOSE(13000/Metric::Time , well1->getOilRate(8) , 0.001);
|
||||
|
||||
BOOST_CHECK( well1->isInjector(9));
|
||||
BOOST_CHECK_CLOSE(20000/Metric::Time , well1->getInjectionRate(9) , 0.001);
|
||||
BOOST_CHECK_CLOSE(5000/Metric::Time , well1->getInjectionRate(10) , 0.001);
|
||||
BOOST_CHECK_CLOSE(20000/Metric::Time , well1->getSurfaceInjectionRate(9) , 0.001);
|
||||
BOOST_CHECK_CLOSE(5000/Metric::Time , well1->getSurfaceInjectionRate(10) , 0.001);
|
||||
|
||||
BOOST_CHECK_CLOSE(200000/Metric::Time , well1->getReservoirInjectionRate(9) , 0.001);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ DATES -- 9
|
||||
/
|
||||
|
||||
WCONINJE
|
||||
'W_1' 'WATER' 1* 'RATE' 20000.000 5* /
|
||||
'W_1' 'WATER' 1* 'RATE' 20000.000 200000.000 5* /
|
||||
/
|
||||
|
||||
DATES -- 10
|
||||
@@ -90,7 +90,7 @@ DATES -- 10
|
||||
/
|
||||
|
||||
WCONINJH
|
||||
'W_1' 'WATER' 1* 5000.000 /
|
||||
'W_1' 'WATER' 1* 5000.000 50000.000 /
|
||||
/
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user