Moved has/drop/addProductionControl to WellProductionProperties. The same for WellInjectionProperties.
This commit is contained in:
@@ -185,6 +185,7 @@ namespace Opm {
|
||||
well->setProducerControlMode( currentStep , control );
|
||||
}
|
||||
well->setStatus( currentStep , status );
|
||||
WellProductionProperties properties = well->getProductionProperties(currentStep);
|
||||
{
|
||||
double liquidRate = 0;
|
||||
double resVRate = 0;
|
||||
@@ -198,7 +199,6 @@ namespace Opm {
|
||||
resVRate = record->getItem("RESV")->getSIDouble(0);
|
||||
}
|
||||
|
||||
WellProductionProperties properties = well->getProductionProperties(currentStep);
|
||||
properties.PredictionMode = isPredictionMode;
|
||||
properties.OilRate = orat;
|
||||
properties.WaterRate = wrat;
|
||||
@@ -207,42 +207,42 @@ namespace Opm {
|
||||
properties.ResVRate = resVRate;
|
||||
properties.BHPLimit = BHPLimit;
|
||||
properties.THPLimit = THPLimit;
|
||||
well->setProductionProperties(currentStep, properties);
|
||||
|
||||
if (isPredictionMode) {
|
||||
if (record->getItem("LRAT")->defaultApplied())
|
||||
well->dropProductionControl( currentStep , WellProducer::LRAT );
|
||||
properties.dropProductionControl(WellProducer::LRAT);
|
||||
|
||||
if (record->getItem("RESV")->defaultApplied())
|
||||
well->dropProductionControl( currentStep , WellProducer::RESV );
|
||||
properties.dropProductionControl(WellProducer::RESV);
|
||||
|
||||
if (record->getItem("BHP")->defaultApplied())
|
||||
well->dropProductionControl( currentStep , WellProducer::BHP );
|
||||
properties.dropProductionControl(WellProducer::BHP);
|
||||
|
||||
if (record->getItem("THP")->defaultApplied())
|
||||
well->dropProductionControl( currentStep , WellProducer::THP );
|
||||
properties.dropProductionControl(WellProducer::THP);
|
||||
} else {
|
||||
well->dropProductionControl( currentStep , WellProducer::LRAT );
|
||||
well->dropProductionControl( currentStep , WellProducer::RESV );
|
||||
well->dropProductionControl( currentStep , WellProducer::BHP );
|
||||
well->dropProductionControl( currentStep , WellProducer::THP );
|
||||
properties.dropProductionControl(WellProducer::LRAT);
|
||||
properties.dropProductionControl(WellProducer::RESV);
|
||||
properties.dropProductionControl(WellProducer::BHP);
|
||||
properties.dropProductionControl(WellProducer::THP);
|
||||
}
|
||||
}
|
||||
|
||||
if (record->getItem("ORAT")->defaultApplied())
|
||||
well->dropProductionControl( currentStep , WellProducer::ORAT );
|
||||
properties.dropProductionControl(WellProducer::ORAT);
|
||||
|
||||
if (record->getItem("GRAT")->defaultApplied()) {
|
||||
well->dropProductionControl( currentStep , WellProducer::GRAT );
|
||||
properties.dropProductionControl(WellProducer::GRAT);
|
||||
}
|
||||
|
||||
if (record->getItem("WRAT")->defaultApplied())
|
||||
well->dropProductionControl( currentStep , WellProducer::WRAT );
|
||||
if (record->getItem("WRAT")->defaultApplied()) {
|
||||
properties.dropProductionControl(WellProducer::WRAT);
|
||||
}
|
||||
|
||||
if (status != WellCommon::SHUT) {
|
||||
const std::string& cmodeString = record->getItem("CMODE")->getString(0);
|
||||
WellProducer::ControlModeEnum control = WellProducer::ControlModeFromString( cmodeString );
|
||||
if (well->hasProductionControl( currentStep , control))
|
||||
if (properties.hasProductionControl( control))
|
||||
well->setProducerControlMode( currentStep , control );
|
||||
else {
|
||||
/*
|
||||
@@ -265,6 +265,7 @@ namespace Opm {
|
||||
throw std::invalid_argument("Tried to set invalid control: " + cmodeString + " for well: " + wellName);
|
||||
}
|
||||
}
|
||||
well->setProductionProperties(currentStep, properties);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -303,30 +304,29 @@ namespace Opm {
|
||||
properties.THPLimit = THPLimit;
|
||||
properties.InjectorType = injectorType;
|
||||
properties.PredictionMode = true;
|
||||
well->setInjectionProperties(currentStep, properties);
|
||||
well->setInjectorControlMode(currentStep , controlMode );
|
||||
|
||||
if (record->getItem("RATE")->defaultApplied())
|
||||
well->dropInjectionControl( currentStep , WellInjector::RATE );
|
||||
properties.dropInjectionControl(WellInjector::RATE);
|
||||
|
||||
if (record->getItem("RESV")->defaultApplied())
|
||||
well->dropInjectionControl( currentStep , WellInjector::RESV );
|
||||
properties.dropInjectionControl(WellInjector::RESV);
|
||||
|
||||
if (record->getItem("THP")->defaultApplied())
|
||||
well->dropInjectionControl( currentStep , WellInjector::THP );
|
||||
properties.dropInjectionControl(WellInjector::THP);
|
||||
|
||||
if (record->getItem("BHP")->defaultApplied())
|
||||
well->dropInjectionControl( currentStep , WellInjector::BHP );
|
||||
properties.dropInjectionControl(WellInjector::BHP);
|
||||
|
||||
{
|
||||
const std::string& cmodeString = record->getItem("CMODE")->getString(0);
|
||||
WellInjector::ControlModeEnum controlMode = WellInjector::ControlModeFromString( cmodeString );
|
||||
if (well->hasInjectionControl( currentStep , controlMode))
|
||||
if (properties.hasInjectionControl( controlMode))
|
||||
well->setInjectorControlMode( currentStep , controlMode );
|
||||
else {
|
||||
throw std::invalid_argument("Tried to set invalid control: " + cmodeString + " for well: " + wellName);
|
||||
}
|
||||
}
|
||||
well->setInjectionProperties(currentStep, properties);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -31,8 +31,7 @@ namespace Opm {
|
||||
: m_injectorControlMode(new DynamicState<WellInjector::ControlModeEnum>(timeMap, WellInjector::RATE)),
|
||||
m_producerControlMode(new DynamicState<WellProducer::ControlModeEnum>(timeMap, WellProducer::ORAT)),
|
||||
m_status(new DynamicState<WellCommon::StatusEnum>(timeMap, WellCommon::OPEN)),
|
||||
//m_injectionControls(new DynamicState<int>(timeMap, 0)),
|
||||
m_isProducer(new DynamicState<bool>(timeMap, true)),
|
||||
m_isProducer(new DynamicState<bool>(timeMap, true)) ,
|
||||
m_isAvailableForGroupControl(new DynamicState<bool>(timeMap, true)),
|
||||
m_guideRate(new DynamicState<double>(timeMap, -1.0)),
|
||||
m_guideRatePhase(new DynamicState<GuideRate::GuideRatePhaseEnum>(timeMap, GuideRate::UNDEFINED)),
|
||||
@@ -59,19 +58,27 @@ namespace Opm {
|
||||
m_productionProperties->add(timeStep, newProperties);
|
||||
}
|
||||
|
||||
WellProductionProperties Well::getProductionProperties(size_t timeStep) const {
|
||||
WellProductionProperties Well::getProductionPropertiesCopy(size_t timeStep) const {
|
||||
return m_productionProperties->get(timeStep);
|
||||
}
|
||||
|
||||
const WellProductionProperties& Well::getProductionProperties(size_t timeStep) const {
|
||||
return m_productionProperties->at(timeStep);
|
||||
}
|
||||
|
||||
void Well::setInjectionProperties(size_t timeStep , const WellInjectionProperties newProperties) {
|
||||
m_isProducer->add(timeStep , false);
|
||||
m_injectionProperties->add(timeStep, newProperties);
|
||||
}
|
||||
|
||||
WellInjectionProperties Well::getInjectionProperties(size_t timeStep) const {
|
||||
WellInjectionProperties Well::getInjectionPropertiesCopy(size_t timeStep) const {
|
||||
return m_injectionProperties->get(timeStep);
|
||||
}
|
||||
|
||||
const WellInjectionProperties& Well::getInjectionProperties(size_t timeStep) const {
|
||||
return m_injectionProperties->at(timeStep);
|
||||
}
|
||||
|
||||
bool Well::hasBeenDefined(size_t timeStep) const {
|
||||
if (timeStep < m_creationTimeStep)
|
||||
return false;
|
||||
@@ -112,11 +119,11 @@ namespace Opm {
|
||||
bool Well::isInjector(size_t timeStep) const {
|
||||
return !isProducer(timeStep);
|
||||
}
|
||||
|
||||
|
||||
bool Well::isAvailableForGroupControl(size_t timeStep) const {
|
||||
return m_isAvailableForGroupControl->get(timeStep);
|
||||
}
|
||||
|
||||
|
||||
void Well::setAvailableForGroupControl(size_t timeStep, bool isAvailableForGroupControl) {
|
||||
m_isAvailableForGroupControl->add(timeStep, isAvailableForGroupControl);
|
||||
}
|
||||
@@ -145,78 +152,8 @@ namespace Opm {
|
||||
m_guideRateScalingFactor->add(timeStep, scalingFactor);
|
||||
}
|
||||
|
||||
|
||||
void Well::switch2Producer(size_t timeStep ) {
|
||||
m_isProducer->add(timeStep , true);
|
||||
// m_surfaceInjectionRate->add(timeStep, 0);
|
||||
// m_reservoirInjectionRate->add(timeStep , 0);
|
||||
}
|
||||
|
||||
void Well::switch2Injector(size_t timeStep ) {
|
||||
m_isProducer->add(timeStep , false);
|
||||
// m_oilRate->add(timeStep, 0);
|
||||
// m_gasRate->add(timeStep, 0);
|
||||
// m_waterRate->add(timeStep, 0);
|
||||
}
|
||||
|
||||
/*****************************************************************/
|
||||
|
||||
bool Well::hasProductionControl(size_t timeStep , WellProducer::ControlModeEnum controlMode) const {
|
||||
WellProductionProperties properties = getProductionProperties(timeStep);
|
||||
if (properties.ProductionControls & controlMode)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Well::addProductionControl(size_t timeStep , WellProducer::ControlModeEnum controlMode) {
|
||||
WellProductionProperties properties = getProductionProperties(timeStep);
|
||||
if ((properties.ProductionControls & controlMode) == 0) {
|
||||
properties.ProductionControls += controlMode;
|
||||
setProductionProperties(timeStep, properties);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Well::dropProductionControl(size_t timeStep , WellProducer::ControlModeEnum controlMode) {
|
||||
WellProductionProperties properties = getProductionProperties(timeStep);
|
||||
if ((properties.ProductionControls & controlMode) != 0) {
|
||||
properties.ProductionControls -= controlMode;
|
||||
setProductionProperties(timeStep, properties);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Well::hasInjectionControl(size_t timeStep , WellInjector::ControlModeEnum controlMode) const {
|
||||
WellInjectionProperties properties = getInjectionProperties(timeStep);
|
||||
if (properties.InjectionControls & controlMode)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
void Well::addInjectionControl(size_t timeStep , WellInjector::ControlModeEnum controlMode) {
|
||||
WellInjectionProperties properties = getInjectionProperties(timeStep);
|
||||
if ((properties.InjectionControls & controlMode) == 0) {
|
||||
properties.InjectionControls += controlMode;
|
||||
setInjectionProperties(timeStep, properties);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void Well::dropInjectionControl(size_t timeStep , WellInjector::ControlModeEnum controlMode) {
|
||||
WellInjectionProperties properties = getInjectionProperties(timeStep);
|
||||
if ((properties.InjectionControls & controlMode) != 0) {
|
||||
properties.InjectionControls -= controlMode;
|
||||
setInjectionProperties(timeStep, properties);
|
||||
}
|
||||
}
|
||||
|
||||
/*****************************************************************/
|
||||
|
||||
|
||||
// WELSPECS
|
||||
|
||||
int Well::getHeadI() const {
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/CompletionSet.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Completion.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
||||
|
||||
#include <boost/optional.hpp>
|
||||
|
||||
@@ -46,15 +45,31 @@ namespace Opm {
|
||||
bool PredictionMode;
|
||||
int ProductionControls;
|
||||
|
||||
WellProductionProperties()
|
||||
{OilRate=0.0; GasRate=0.0; WaterRate=0.0; LiquidRate=0.0; ResVRate=0.0;
|
||||
BHPLimit=0.0; THPLimit=0.0; PredictionMode=true; ProductionControls=0;}
|
||||
WellProductionProperties(const WellProductionProperties& props)
|
||||
{OilRate=props.OilRate; GasRate=props.GasRate; WaterRate=props.WaterRate;
|
||||
LiquidRate=props.LiquidRate; ResVRate=props.ResVRate;
|
||||
BHPLimit=props.BHPLimit; THPLimit=props.THPLimit; PredictionMode=props.PredictionMode;
|
||||
ProductionControls=props.ProductionControls;}
|
||||
} WellProductionProperties;
|
||||
WellProductionProperties() {
|
||||
OilRate=0.0; GasRate=0.0; WaterRate=0.0; LiquidRate=0.0; ResVRate=0.0;
|
||||
BHPLimit=0.0; THPLimit=0.0; PredictionMode=true; ProductionControls=0;
|
||||
}
|
||||
|
||||
bool hasProductionControl(WellProducer::ControlModeEnum controlMode) const {
|
||||
if (ProductionControls & controlMode)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
void dropProductionControl(WellProducer::ControlModeEnum controlMode) {
|
||||
if ((ProductionControls & controlMode) != 0) {
|
||||
ProductionControls -= controlMode;
|
||||
}
|
||||
}
|
||||
|
||||
void addProductionControl(WellProducer::ControlModeEnum controlMode) {
|
||||
if ((ProductionControls & controlMode) == 0) {
|
||||
ProductionControls += controlMode;
|
||||
}
|
||||
}
|
||||
|
||||
} WellProductionProperties;
|
||||
|
||||
typedef struct WellInjectionProperties {
|
||||
double SurfaceInjectionRate;
|
||||
@@ -65,16 +80,32 @@ namespace Opm {
|
||||
WellInjector::TypeEnum InjectorType;
|
||||
int InjectionControls;
|
||||
|
||||
WellInjectionProperties()
|
||||
{SurfaceInjectionRate=0.0; ReservoirInjectionRate=0.0;
|
||||
BHPLimit=0.0; THPLimit=0.0; PredictionMode=true;
|
||||
InjectorType=WellInjector::WATER, InjectionControls=0;}
|
||||
WellInjectionProperties(const WellInjectionProperties& props)
|
||||
{SurfaceInjectionRate=props.SurfaceInjectionRate;
|
||||
ReservoirInjectionRate=props.ReservoirInjectionRate;
|
||||
BHPLimit=props.BHPLimit; THPLimit=props.THPLimit; PredictionMode=props.PredictionMode;
|
||||
InjectorType=props.InjectorType; InjectionControls=props.InjectionControls;}
|
||||
} WellInjectionProperties;
|
||||
WellInjectionProperties() {
|
||||
SurfaceInjectionRate=0.0; ReservoirInjectionRate=0.0;
|
||||
BHPLimit=0.0; THPLimit=0.0; PredictionMode=true;
|
||||
InjectorType=WellInjector::WATER, InjectionControls=0;
|
||||
}
|
||||
|
||||
bool hasInjectionControl(WellInjector::ControlModeEnum controlMode) const {
|
||||
if (InjectionControls & controlMode)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
void dropInjectionControl(WellInjector::ControlModeEnum controlMode) {
|
||||
if ((InjectionControls & controlMode) != 0) {
|
||||
InjectionControls -= controlMode;
|
||||
}
|
||||
}
|
||||
|
||||
void addInjectionControl(WellInjector::ControlModeEnum controlMode) {
|
||||
if ((InjectionControls & controlMode) == 0) {
|
||||
InjectionControls += controlMode;
|
||||
}
|
||||
}
|
||||
|
||||
} WellInjectionProperties;
|
||||
|
||||
class Well {
|
||||
public:
|
||||
@@ -92,20 +123,10 @@ namespace Opm {
|
||||
WellCommon::StatusEnum getStatus(size_t timeStep) const;
|
||||
void setStatus(size_t timeStep, WellCommon::StatusEnum Status);
|
||||
|
||||
bool hasProductionControl(size_t timeStep , WellProducer::ControlModeEnum controlMode) const;
|
||||
void dropProductionControl(size_t timeStep , WellProducer::ControlModeEnum controlMode);
|
||||
|
||||
bool hasInjectionControl(size_t timeStep , WellInjector::ControlModeEnum controlMode) const;
|
||||
void dropInjectionControl(size_t timeStep , WellInjector::ControlModeEnum controlMode);
|
||||
|
||||
|
||||
int getHeadI() const;
|
||||
int getHeadJ() const;
|
||||
double getRefDepth() const;
|
||||
|
||||
bool isProducer(size_t timeStep) const;
|
||||
bool isInjector(size_t timeStep) const;
|
||||
|
||||
bool isAvailableForGroupControl(size_t timeStep) const;
|
||||
void setAvailableForGroupControl(size_t timeStep, bool isAvailableForGroupControl);
|
||||
double getGuideRate(size_t timeStep) const;
|
||||
@@ -115,18 +136,19 @@ namespace Opm {
|
||||
double getGuideRateScalingFactor(size_t timeStep) const;
|
||||
void setGuideRateScalingFactor(size_t timeStep, double scalingFactor);
|
||||
|
||||
bool isProducer(size_t timeStep) const;
|
||||
bool isInjector(size_t timeStep) const;
|
||||
void addWELSPECS(DeckRecordConstPtr deckRecord);
|
||||
void addCompletions(size_t time_step , const std::vector<CompletionConstPtr>& newCompletions);
|
||||
CompletionSetConstPtr getCompletions(size_t timeStep) const;
|
||||
void setProductionProperties(size_t timeStep , const WellProductionProperties properties);
|
||||
WellProductionProperties getProductionProperties(size_t timeStep) const;
|
||||
WellProductionProperties getProductionPropertiesCopy(size_t timeStep) const;
|
||||
const WellProductionProperties& getProductionProperties(size_t timeStep) const;
|
||||
void setInjectionProperties(size_t timeStep , const WellInjectionProperties properties);
|
||||
WellInjectionProperties getInjectionProperties(size_t timeStep) const;
|
||||
WellInjectionProperties getInjectionPropertiesCopy(size_t timeStep) const;
|
||||
const WellInjectionProperties& getInjectionProperties(size_t timeStep) const;
|
||||
|
||||
private:
|
||||
void addInjectionControl(size_t timeStep , WellInjector::ControlModeEnum controlMode);
|
||||
void addProductionControl(size_t timeStep , WellProducer::ControlModeEnum controlMode);
|
||||
|
||||
size_t m_creationTimeStep;
|
||||
std::string m_name;
|
||||
|
||||
@@ -134,12 +156,12 @@ namespace Opm {
|
||||
std::shared_ptr<DynamicState<WellProducer::ControlModeEnum> > m_producerControlMode;
|
||||
std::shared_ptr<DynamicState<WellCommon::StatusEnum> > m_status;
|
||||
|
||||
std::shared_ptr<DynamicState<bool> > m_isProducer;
|
||||
std::shared_ptr<DynamicState<bool> > m_isAvailableForGroupControl;
|
||||
std::shared_ptr<DynamicState<double> > m_guideRate;
|
||||
std::shared_ptr<DynamicState<GuideRate::GuideRatePhaseEnum> > m_guideRatePhase;
|
||||
std::shared_ptr<DynamicState<double> > m_guideRateScalingFactor;
|
||||
|
||||
std::shared_ptr<DynamicState<bool> > m_isProducer;
|
||||
std::shared_ptr<DynamicState<CompletionSetConstPtr> > m_completions;
|
||||
std::shared_ptr<DynamicState<WellProductionProperties> > m_productionProperties;
|
||||
std::shared_ptr<DynamicState<WellInjectionProperties> > m_injectionProperties;
|
||||
|
||||
@@ -372,92 +372,93 @@ BOOST_AUTO_TEST_CASE(WellStatus) {
|
||||
/*****************************************************************/
|
||||
|
||||
|
||||
//BOOST_AUTO_TEST_CASE(WellHaveProductionControlLimit) {
|
||||
/*
|
||||
BOOST_AUTO_TEST_CASE(WellHaveProductionControlLimit) {
|
||||
|
||||
// Opm::TimeMapPtr timeMap = createXDaysTimeMap(20);
|
||||
// Opm::Well well("WELL1", 1, 2, 2334.32, timeMap, 0);
|
||||
Opm::TimeMapPtr timeMap = createXDaysTimeMap(20);
|
||||
Opm::Well well("WELL1", 1, 2, 2334.32, timeMap, 0);
|
||||
|
||||
|
||||
// BOOST_CHECK( !well.hasProductionControl( 1 , Opm::WellProducer::ORAT ));
|
||||
// BOOST_CHECK( !well.hasProductionControl( 1 , Opm::WellProducer::RESV ));
|
||||
BOOST_CHECK( !well.hasProductionControl( 1 , Opm::WellProducer::ORAT ));
|
||||
BOOST_CHECK( !well.hasProductionControl( 1 , Opm::WellProducer::RESV ));
|
||||
|
||||
// Opm::WellProductionProperties properties(well.getProductionProperties(1));
|
||||
// properties.OilRate = 100;
|
||||
// well.setProductionProperties(2, properties);
|
||||
// BOOST_CHECK( well.hasProductionControl( 2, Opm::WellProducer::ORAT ));
|
||||
// BOOST_CHECK( !well.hasProductionControl( 2, Opm::WellProducer::RESV ));
|
||||
Opm::WellProductionProperties properties(well.getProductionProperties(1));
|
||||
properties.OilRate = 100;
|
||||
well.setProductionProperties(2, properties);
|
||||
BOOST_CHECK( well.hasProductionControl( 2, Opm::WellProducer::ORAT ));
|
||||
BOOST_CHECK( !well.hasProductionControl( 2, Opm::WellProducer::RESV ));
|
||||
|
||||
// Opm::WellProductionProperties properties2(well.getProductionProperties(2));
|
||||
// properties2.ResVRate = 100;
|
||||
// well.setProductionProperties(2, properties2);
|
||||
// BOOST_CHECK( well.hasProductionControl( 2, Opm::WellProducer::RESV ));
|
||||
Opm::WellProductionProperties properties2(well.getProductionProperties(2));
|
||||
properties2.ResVRate = 100;
|
||||
well.setProductionProperties(2, properties2);
|
||||
BOOST_CHECK( well.hasProductionControl( 2, Opm::WellProducer::RESV ));
|
||||
|
||||
// Opm::WellProductionProperties properties3(well.getProductionProperties(2));
|
||||
// properties3.OilRate = 100;
|
||||
// properties3.WaterRate = 100;
|
||||
// properties3.GasRate = 100;
|
||||
// properties3.LiquidRate = 100;
|
||||
// properties3.ResVRate = 100;
|
||||
// well.setBHPLimit( 10 , 100 , true);
|
||||
// well.setTHPLimit( 10 , 100 , true);
|
||||
Opm::WellProductionProperties properties3(well.getProductionProperties(2));
|
||||
properties3.OilRate = 100;
|
||||
properties3.WaterRate = 100;
|
||||
properties3.GasRate = 100;
|
||||
properties3.LiquidRate = 100;
|
||||
properties3.ResVRate = 100;
|
||||
well.setBHPLimit( 10 , 100 , true);
|
||||
well.setTHPLimit( 10 , 100 , true);
|
||||
|
||||
// BOOST_CHECK( well.hasProductionControl( 10 , Opm::WellProducer::ORAT ));
|
||||
// BOOST_CHECK( well.hasProductionControl( 10 , Opm::WellProducer::WRAT ));
|
||||
// BOOST_CHECK( well.hasProductionControl( 10 , Opm::WellProducer::GRAT ));
|
||||
// BOOST_CHECK( well.hasProductionControl( 10 , Opm::WellProducer::LRAT ));
|
||||
// BOOST_CHECK( well.hasProductionControl( 10 , Opm::WellProducer::RESV ));
|
||||
// BOOST_CHECK( well.hasProductionControl( 10 , Opm::WellProducer::BHP ));
|
||||
// BOOST_CHECK( well.hasProductionControl( 10 , Opm::WellProducer::THP ));
|
||||
BOOST_CHECK( well.hasProductionControl( 10 , Opm::WellProducer::ORAT ));
|
||||
BOOST_CHECK( well.hasProductionControl( 10 , Opm::WellProducer::WRAT ));
|
||||
BOOST_CHECK( well.hasProductionControl( 10 , Opm::WellProducer::GRAT ));
|
||||
BOOST_CHECK( well.hasProductionControl( 10 , Opm::WellProducer::LRAT ));
|
||||
BOOST_CHECK( well.hasProductionControl( 10 , Opm::WellProducer::RESV ));
|
||||
BOOST_CHECK( well.hasProductionControl( 10 , Opm::WellProducer::BHP ));
|
||||
BOOST_CHECK( well.hasProductionControl( 10 , Opm::WellProducer::THP ));
|
||||
|
||||
// well.dropProductionControl( 11 , Opm::WellProducer::RESV );
|
||||
well.dropProductionControl( 11 , Opm::WellProducer::RESV );
|
||||
|
||||
// BOOST_CHECK( well.hasProductionControl( 11 , Opm::WellProducer::ORAT ));
|
||||
// BOOST_CHECK( well.hasProductionControl( 11 , Opm::WellProducer::WRAT ));
|
||||
// BOOST_CHECK( well.hasProductionControl( 11 , Opm::WellProducer::GRAT ));
|
||||
// BOOST_CHECK( well.hasProductionControl( 11 , Opm::WellProducer::LRAT ));
|
||||
// BOOST_CHECK( !well.hasProductionControl( 11 , Opm::WellProducer::RESV ));
|
||||
// BOOST_CHECK( well.hasProductionControl( 11 , Opm::WellProducer::BHP ));
|
||||
// BOOST_CHECK( well.hasProductionControl( 11 , Opm::WellProducer::THP ));
|
||||
//}
|
||||
BOOST_CHECK( well.hasProductionControl( 11 , Opm::WellProducer::ORAT ));
|
||||
BOOST_CHECK( well.hasProductionControl( 11 , Opm::WellProducer::WRAT ));
|
||||
BOOST_CHECK( well.hasProductionControl( 11 , Opm::WellProducer::GRAT ));
|
||||
BOOST_CHECK( well.hasProductionControl( 11 , Opm::WellProducer::LRAT ));
|
||||
BOOST_CHECK( !well.hasProductionControl( 11 , Opm::WellProducer::RESV ));
|
||||
BOOST_CHECK( well.hasProductionControl( 11 , Opm::WellProducer::BHP ));
|
||||
BOOST_CHECK( well.hasProductionControl( 11 , Opm::WellProducer::THP ));
|
||||
}
|
||||
|
||||
|
||||
|
||||
//BOOST_AUTO_TEST_CASE(WellHaveInjectionControlLimit) {
|
||||
BOOST_AUTO_TEST_CASE(WellHaveInjectionControlLimit) {
|
||||
|
||||
// Opm::TimeMapPtr timeMap = createXDaysTimeMap(20);
|
||||
// Opm::Well well("WELL1", 1, 2, 2334.32, timeMap, 0);
|
||||
Opm::TimeMapPtr timeMap = createXDaysTimeMap(20);
|
||||
Opm::Well well("WELL1", 1, 2, 2334.32, timeMap, 0);
|
||||
|
||||
|
||||
// BOOST_CHECK( !well.hasInjectionControl( 1 , Opm::WellInjector::RATE ));
|
||||
// BOOST_CHECK( !well.hasInjectionControl( 1 , Opm::WellInjector::RESV ));
|
||||
BOOST_CHECK( !well.hasInjectionControl( 1 , Opm::WellInjector::RATE ));
|
||||
BOOST_CHECK( !well.hasInjectionControl( 1 , Opm::WellInjector::RESV ));
|
||||
|
||||
// Opm::WellInjectionProperties injectorProperties1(well.getInjectionProperties(2));
|
||||
// injectorProperties1.SurfaceInjectionRate = 100;
|
||||
// well.setInjectionProperties(2, injectorProperties1);
|
||||
// BOOST_CHECK( well.hasInjectionControl( 2, Opm::WellInjector::RATE ));
|
||||
// BOOST_CHECK( !well.hasInjectionControl( 2 , Opm::WellInjector::RESV ));
|
||||
Opm::WellInjectionProperties injectorProperties1(well.getInjectionProperties(2));
|
||||
injectorProperties1.SurfaceInjectionRate = 100;
|
||||
well.setInjectionProperties(2, injectorProperties1);
|
||||
BOOST_CHECK( well.hasInjectionControl( 2, Opm::WellInjector::RATE ));
|
||||
BOOST_CHECK( !well.hasInjectionControl( 2 , Opm::WellInjector::RESV ));
|
||||
|
||||
// Opm::WellInjectionProperties injectorProperties2(well.getInjectionProperties(2));
|
||||
// injectorProperties2.ReservoirInjectionRate = 100;
|
||||
// well.setInjectionProperties(2, injectorProperties2);
|
||||
// BOOST_CHECK( well.hasInjectionControl( 2 , Opm::WellInjector::RESV ));
|
||||
Opm::WellInjectionProperties injectorProperties2(well.getInjectionProperties(2));
|
||||
injectorProperties2.ReservoirInjectionRate = 100;
|
||||
well.setInjectionProperties(2, injectorProperties2);
|
||||
BOOST_CHECK( well.hasInjectionControl( 2 , Opm::WellInjector::RESV ));
|
||||
|
||||
// well.setBHPLimit( 10 , 100 , false);
|
||||
// well.setTHPLimit( 10 , 100 , false);
|
||||
well.setBHPLimit( 10 , 100 , false);
|
||||
well.setTHPLimit( 10 , 100 , false);
|
||||
|
||||
// BOOST_CHECK( well.hasInjectionControl( 10 , Opm::WellInjector::RATE ));
|
||||
// BOOST_CHECK( well.hasInjectionControl( 10 , Opm::WellInjector::RESV ));
|
||||
// BOOST_CHECK( well.hasInjectionControl( 10 , Opm::WellInjector::THP ));
|
||||
// BOOST_CHECK( well.hasInjectionControl( 10 , Opm::WellInjector::BHP ));
|
||||
BOOST_CHECK( well.hasInjectionControl( 10 , Opm::WellInjector::RATE ));
|
||||
BOOST_CHECK( well.hasInjectionControl( 10 , Opm::WellInjector::RESV ));
|
||||
BOOST_CHECK( well.hasInjectionControl( 10 , Opm::WellInjector::THP ));
|
||||
BOOST_CHECK( well.hasInjectionControl( 10 , Opm::WellInjector::BHP ));
|
||||
|
||||
well.dropInjectionControl( 11 , Opm::WellInjector::RESV );
|
||||
|
||||
// well.dropInjectionControl( 11 , Opm::WellInjector::RESV );
|
||||
|
||||
BOOST_CHECK( well.hasInjectionControl( 11 , Opm::WellInjector::RATE ));
|
||||
BOOST_CHECK( !well.hasInjectionControl( 11 , Opm::WellInjector::RESV ));
|
||||
BOOST_CHECK( well.hasInjectionControl( 11 , Opm::WellInjector::THP ));
|
||||
BOOST_CHECK( well.hasInjectionControl( 11 , Opm::WellInjector::BHP ));
|
||||
}
|
||||
|
||||
*/
|
||||
/*********************************************************************/
|
||||
|
||||
|
||||
|
||||
@@ -100,9 +100,9 @@ BOOST_AUTO_TEST_CASE(WellTesting) {
|
||||
BOOST_CHECK_EQUAL( WellCommon::SHUT , well2->getStatus(3));
|
||||
|
||||
BOOST_CHECK_EQUAL( WellProducer::ORAT , well2->getProducerControlMode( 3 ));
|
||||
// BOOST_CHECK( well2->hasProductionControl( 3 , WellProducer::ORAT ));
|
||||
// BOOST_CHECK( well2->hasProductionControl( 3 , WellProducer::GRAT ));
|
||||
BOOST_CHECK( !well2->hasProductionControl( 8 , WellProducer::GRAT ));
|
||||
// BOOST_CHECK( well2->getProductionProperties(3).hasProductionControl(WellProducer::ORAT));
|
||||
// BOOST_CHECK( well2->getProductionProperties(3).hasProductionControl(WellProducer::GRAT));
|
||||
BOOST_CHECK( !well2->getProductionProperties(8).hasProductionControl(WellProducer::GRAT));
|
||||
}
|
||||
|
||||
|
||||
@@ -165,15 +165,15 @@ BOOST_AUTO_TEST_CASE(WellTesting) {
|
||||
BOOST_CHECK_EQUAL( WellCommon::OPEN , well1->getStatus( 11 ));
|
||||
BOOST_CHECK_EQUAL( WellCommon::SHUT , well1->getStatus( 12 ));
|
||||
|
||||
// BOOST_CHECK( well1->hasInjectionControl( 9 , WellInjector::RATE ));
|
||||
// BOOST_CHECK( well1->hasInjectionControl( 9 , WellInjector::RESV ));
|
||||
BOOST_CHECK( !well1->hasInjectionControl( 9 , WellInjector::THP ));
|
||||
BOOST_CHECK( !well1->hasInjectionControl( 9 , WellInjector::BHP ));
|
||||
// BOOST_CHECK( well1->getInjectionProperties(9).hasInjectionControl(WellInjector::RATE ));
|
||||
// BOOST_CHECK( well1->getInjectionProperties(9).hasInjectionControl(WellInjector::RESV ));
|
||||
BOOST_CHECK( !well1->getInjectionProperties(9).hasInjectionControl(WellInjector::THP));
|
||||
BOOST_CHECK( !well1->getInjectionProperties(9).hasInjectionControl(WellInjector::BHP));
|
||||
|
||||
// BOOST_CHECK( well1->hasInjectionControl( 12 , WellInjector::RATE ));
|
||||
BOOST_CHECK( !well1->hasInjectionControl( 12 , WellInjector::RESV ));
|
||||
// BOOST_CHECK( well1->hasInjectionControl( 12 , WellInjector::THP ));
|
||||
// BOOST_CHECK( well1->hasInjectionControl( 12 , WellInjector::BHP ));
|
||||
// BOOST_CHECK( well1->getInjectionProperties(12).hasInjectionControl(WellInjector::RATE ));
|
||||
BOOST_CHECK( !well1->getInjectionProperties(12).hasInjectionControl(WellInjector::RESV));
|
||||
// BOOST_CHECK( well1->getInjectionProperties(12).hasInjectionControl(WellInjector::THP ));
|
||||
// BOOST_CHECK( well1->getInjectionProperties(12).hasInjectionControl(WellInjector::BHP ));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user