make WellProductionProperties constructible from variables

also make it default constructible and add an accessor
This commit is contained in:
Arne Morten Kvarving
2019-12-10 14:05:39 +01:00
parent 69f4b72b3a
commit a060cb2d17
2 changed files with 70 additions and 0 deletions

View File

@@ -310,7 +310,25 @@ public:
bool operator==(const WellProductionProperties& other) const;
bool operator!=(const WellProductionProperties& other) const;
WellProductionProperties();
WellProductionProperties(const std::string& name_arg);
WellProductionProperties(const std::string& wname,
const UDAValue& oilRate,
const UDAValue& waterRate,
const UDAValue& gasRate,
const UDAValue& liquidRate,
const UDAValue& resvRate,
const UDAValue& BHP,
const UDAValue& THP,
double bhph,
double thph,
int vfpTableNum,
double alqValue,
bool predMode,
ProducerCMode ctrlMode,
ProducerCMode whistctlMode,
int prodCtrls);
bool hasProductionControl(ProducerCMode controlModeArg) const {
return (m_productionControls & static_cast<int>(controlModeArg)) != 0;
@@ -335,6 +353,9 @@ public:
void clearControls();
ProductionControls controls(const SummaryState& st, double udq_default) const;
bool updateUDQActive(const UDQConfig& udq_config, UDQActive& active) const;
int getNumProductionControls() const;
private:
int m_productionControls = 0;
void init_rates( const DeckRecord& record );

View File

@@ -33,11 +33,57 @@
namespace Opm {
Well::WellProductionProperties::WellProductionProperties()
: BHPH(0.0), THPH(0.0), VFPTableNumber(0),
ALQValue(0.0), predictionMode(false),
controlMode(ProducerCMode::NONE),
whistctl_cmode(ProducerCMode::NONE),
m_productionControls(0)
{}
Well::WellProductionProperties::WellProductionProperties(const std::string& name_arg) :
name(name_arg),
predictionMode( true )
{}
Well::WellProductionProperties::WellProductionProperties(const std::string& wname,
const UDAValue& oilRate,
const UDAValue& waterRate,
const UDAValue& gasRate,
const UDAValue& liquidRate,
const UDAValue& resvRate,
const UDAValue& BHP,
const UDAValue& THP,
double bhph,
double thph,
int vfpTableNum,
double alqValue,
bool predMode,
ProducerCMode ctrlMode,
ProducerCMode whistctlMode,
int prodCtrls)
: name(wname),
OilRate(oilRate),
WaterRate(waterRate),
GasRate(gasRate),
LiquidRate(liquidRate),
ResVRate(resvRate),
BHPLimit(BHP),
THPLimit(THP),
BHPH(bhph),
THPH(thph),
VFPTableNumber(vfpTableNum),
ALQValue(alqValue),
predictionMode(predMode),
controlMode(ctrlMode),
whistctl_cmode(whistctlMode),
m_productionControls(prodCtrls)
{
}
void Well::WellProductionProperties::init_rates( const DeckRecord& record ) {
this->OilRate = record.getItem("ORAT").get<UDAValue>(0);
@@ -308,5 +354,8 @@ bool Well::WellProductionProperties::effectiveHistoryProductionControl(const Wel
return (update_count > 0);
}
int Well::WellProductionProperties::getNumProductionControls() const {
return m_productionControls;
}
} // namespace Opm