Added status flag as well property.
This commit is contained in:
@@ -37,6 +37,7 @@ namespace Opm {
|
||||
m_THPLimit(new DynamicState<double>(timeMap , 0.0)),
|
||||
m_injectorType(new DynamicState<WellInjector::TypeEnum>(timeMap, WellInjector::WATER)),
|
||||
m_injectorControlMode(new DynamicState<WellInjector::ControlModeEnum>(timeMap, WellInjector::RATE)),
|
||||
m_status(new DynamicState<WellCommon::StatusEnum>(timeMap, WellCommon::OPEN)),
|
||||
m_inPredictionMode(new DynamicState<bool>(timeMap, true)),
|
||||
m_isProducer(new DynamicState<bool>(timeMap, true)) ,
|
||||
m_completions( new DynamicState<CompletionSetConstPtr>( timeMap , CompletionSetConstPtr( new CompletionSet()) )),
|
||||
@@ -61,6 +62,14 @@ namespace Opm {
|
||||
return true;
|
||||
}
|
||||
|
||||
WellCommon::StatusEnum Well::getStatus(size_t timeStep) const {
|
||||
return m_status->get( timeStep );
|
||||
}
|
||||
|
||||
void Well::setStatus(size_t timeStep, WellCommon::StatusEnum status) {
|
||||
m_status->add( timeStep , status );
|
||||
}
|
||||
|
||||
|
||||
double Well::getBHPLimit(size_t timeStep) const {
|
||||
return m_BHPLimit->get(timeStep);
|
||||
|
||||
@@ -58,7 +58,9 @@ namespace Opm {
|
||||
void setInjectorType(size_t timeStep, WellInjector::TypeEnum injectorType);
|
||||
WellInjector::ControlModeEnum getInjectorControlMode(size_t timeStep) const;
|
||||
void setInjectorControlMode(size_t timeStep, WellInjector::ControlModeEnum injectorControlMode);
|
||||
|
||||
WellCommon::StatusEnum getStatus(size_t timeStep) const;
|
||||
void setStatus(size_t timeStep, WellCommon::StatusEnum Status);
|
||||
|
||||
|
||||
int getHeadI() const;
|
||||
int getHeadJ() const;
|
||||
@@ -87,6 +89,7 @@ namespace Opm {
|
||||
std::shared_ptr<DynamicState<double> > m_THPLimit;
|
||||
std::shared_ptr<DynamicState<WellInjector::TypeEnum> > m_injectorType;
|
||||
std::shared_ptr<DynamicState<WellInjector::ControlModeEnum> > m_injectorControlMode;
|
||||
std::shared_ptr<DynamicState<WellCommon::StatusEnum> > m_status;
|
||||
|
||||
std::shared_ptr<DynamicState<bool> > m_inPredictionMode;
|
||||
std::shared_ptr<DynamicState<bool> > m_isProducer;
|
||||
|
||||
@@ -273,3 +273,13 @@ BOOST_AUTO_TEST_CASE(InjectorControlMode) {
|
||||
BOOST_CHECK_EQUAL( Opm::WellInjector::RESV , well.getInjectorControlMode( 5 ));
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WellStatus) {
|
||||
Opm::TimeMapPtr timeMap = createXDaysTimeMap(10);
|
||||
Opm::Well well("WELL1", 1, 2, 2334.32, timeMap, 0);
|
||||
|
||||
well.setStatus( 1 , Opm::WellCommon::OPEN );
|
||||
BOOST_CHECK_EQUAL( Opm::WellCommon::OPEN , well.getStatus( 5 ));
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user