Merge pull request #1367 from akva2/noecl_flush
More serialization preparation
This commit is contained in:
@@ -72,6 +72,8 @@ namespace Opm {
|
||||
Defaulted,
|
||||
};
|
||||
|
||||
|
||||
Connection();
|
||||
Connection(int i, int j , int k ,
|
||||
int complnum,
|
||||
double depth,
|
||||
@@ -89,6 +91,25 @@ namespace Opm {
|
||||
const double segDistEnd,
|
||||
const bool defaultSatTabId);
|
||||
|
||||
Connection(Direction dir,
|
||||
double depth,
|
||||
State state,
|
||||
int satTableId,
|
||||
int complnum,
|
||||
double CF,
|
||||
double Kh,
|
||||
double rw,
|
||||
double r0,
|
||||
double skinFactor,
|
||||
const std::array<int,3>& IJK,
|
||||
std::size_t seqIndex,
|
||||
double segDistStart,
|
||||
double segDistEnd,
|
||||
bool defaultSatTabId,
|
||||
std::size_t compSegSeqIndex,
|
||||
int segment,
|
||||
double wellPi);
|
||||
|
||||
|
||||
bool attachedToSegment() const;
|
||||
bool sameCoordinate(const int i, const int j, const int k) const;
|
||||
|
||||
@@ -156,6 +156,13 @@ public:
|
||||
double guide_rate;
|
||||
GuideRateTarget guide_phase;
|
||||
double scale_factor;
|
||||
|
||||
bool operator==(const WellGuideRate& data) const {
|
||||
return available == data.available &&
|
||||
guide_rate == data.guide_rate &&
|
||||
guide_phase == data.guide_phase &&
|
||||
scale_factor == data.scale_factor;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -205,7 +212,21 @@ public:
|
||||
bool operator==(const WellInjectionProperties& other) const;
|
||||
bool operator!=(const WellInjectionProperties& other) const;
|
||||
|
||||
WellInjectionProperties();
|
||||
WellInjectionProperties(const std::string& wname);
|
||||
WellInjectionProperties(const std::string& wname,
|
||||
const UDAValue& surfaceInjRate,
|
||||
const UDAValue& reservoirInjRate,
|
||||
const UDAValue& BHP,
|
||||
const UDAValue& THP,
|
||||
double temp, double bhph,
|
||||
double thph,
|
||||
int vfpTableNum,
|
||||
bool predMode,
|
||||
int injControls,
|
||||
Well::InjectorType injType,
|
||||
InjectorCMode ctrlMode);
|
||||
|
||||
void handleWELTARG(WELTARGCMode cmode, double newValue, double siFactorG, double siFactorL, double siFactorP);
|
||||
void handleWCONINJE(const DeckRecord& record, bool availableForGroupControl, const std::string& well_name);
|
||||
void handleWCONINJH(const DeckRecord& record, bool is_producer, const std::string& well_name);
|
||||
@@ -289,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;
|
||||
@@ -314,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 );
|
||||
|
||||
@@ -33,7 +33,12 @@ namespace Opm {
|
||||
public:
|
||||
|
||||
|
||||
WellConnections();
|
||||
WellConnections(int headI, int headJ);
|
||||
WellConnections(int headI, int headJ,
|
||||
size_t numRemoved,
|
||||
const std::vector<Connection>& connections);
|
||||
|
||||
// cppcheck-suppress noExplicitConstructor
|
||||
WellConnections(const WellConnections& src, const EclipseGrid& grid);
|
||||
void addConnection(int i, int j , int k ,
|
||||
@@ -85,6 +90,11 @@ namespace Opm {
|
||||
bool operator==( const WellConnections& ) const;
|
||||
bool operator!=( const WellConnections& ) const;
|
||||
|
||||
int getHeadI() const;
|
||||
int getHeadJ() const;
|
||||
size_t getNumRemoved() const;
|
||||
const std::vector<Connection>& getConnections() const;
|
||||
|
||||
private:
|
||||
void addConnection(int i, int j , int k ,
|
||||
int complnum,
|
||||
|
||||
@@ -55,6 +55,17 @@ namespace Opm {
|
||||
|
||||
explicit WellEconProductionLimits(const DeckRecord& record);
|
||||
WellEconProductionLimits();
|
||||
WellEconProductionLimits(double minOilRate, double minGasRate,
|
||||
double maxWaterCut, double maxGasOilRatio,
|
||||
double maxWaterGasRatio,
|
||||
EconWorkover workover, bool endRun,
|
||||
const std::string& followonWell,
|
||||
QuantityLimit quantityLimit,
|
||||
double secondaryMaxWaterCut,
|
||||
EconWorkover workoverSecondary,
|
||||
double maxGasLiquidRatio,
|
||||
double minLiquidRate, double maxTemperature,
|
||||
double minReservoirFluidRate);
|
||||
|
||||
// TODO: not handling things related to m_secondary_max_water_cut
|
||||
// for the moment.
|
||||
|
||||
@@ -29,6 +29,7 @@ struct WellFoamProperties
|
||||
{
|
||||
double m_foamConcentration = 0.0;
|
||||
void handleWFOAM(const DeckRecord& rec);
|
||||
bool operator==(const WellFoamProperties& other) const;
|
||||
bool operator!=(const WellFoamProperties& other) const;
|
||||
};
|
||||
|
||||
|
||||
@@ -32,6 +32,12 @@ namespace Opm {
|
||||
int m_skprwattable;
|
||||
int m_skprpolytable;
|
||||
|
||||
WellPolymerProperties(double polymerConcentration,
|
||||
double saltConcentration,
|
||||
int plymwinjtable,
|
||||
int skprwattable,
|
||||
int skprpolytable);
|
||||
|
||||
bool operator==(const WellPolymerProperties& other) const;
|
||||
bool operator!=(const WellPolymerProperties& other) const;
|
||||
WellPolymerProperties();
|
||||
|
||||
@@ -28,7 +28,9 @@ namespace Opm {
|
||||
class WellTracerProperties {
|
||||
|
||||
public:
|
||||
using ConcentrationMap = std::map<std::string,double>;
|
||||
WellTracerProperties();
|
||||
WellTracerProperties(const std::map<std::string,double>& concentrations);
|
||||
|
||||
void setConcentration(const std::string& name, const double& concentration);
|
||||
double getConcentration(const std::string& name) const;
|
||||
@@ -36,8 +38,10 @@ namespace Opm {
|
||||
bool operator==(const WellTracerProperties& other) const;
|
||||
bool operator!=(const WellTracerProperties& other) const;
|
||||
|
||||
const ConcentrationMap& getConcentrations() const;
|
||||
|
||||
private:
|
||||
std::map< std::string, double > m_tracerConcentrations;
|
||||
ConcentrationMap m_tracerConcentrations;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -72,6 +72,38 @@ namespace Opm {
|
||||
m_defaultSatTabId(defaultSatTabId)
|
||||
{}
|
||||
|
||||
Connection::Connection(Direction dir, double depth, State state,
|
||||
int satTableId, int complnum, double CF,
|
||||
double Kh, double rw, double r0, double skinFactor,
|
||||
const std::array<int,3>& IJK, std::size_t seqIndex,
|
||||
double segDistStart, double segDistEnd,
|
||||
bool defaultSatTabId, std::size_t compSegSeqIndex,
|
||||
int segment, double wellPi)
|
||||
: direction(dir)
|
||||
, center_depth(depth)
|
||||
, open_state(state)
|
||||
, sat_tableId(satTableId)
|
||||
, m_complnum(complnum)
|
||||
, m_CF(CF)
|
||||
, m_Kh(Kh)
|
||||
, m_rw(rw)
|
||||
, m_r0(r0)
|
||||
, m_skin_factor(skinFactor)
|
||||
, ijk(IJK)
|
||||
, m_seqIndex(seqIndex)
|
||||
, m_segDistStart(segDistStart)
|
||||
, m_segDistEnd(segDistEnd)
|
||||
, m_defaultSatTabId(defaultSatTabId)
|
||||
, m_compSeg_seqIndex(compSegSeqIndex)
|
||||
, segment_number(segment)
|
||||
, wPi(wellPi)
|
||||
{}
|
||||
|
||||
Connection::Connection()
|
||||
: Connection(Direction::X, 1.0, State::SHUT,
|
||||
0, 0, 0.0, 0.0, 0.0, 0.0, 0.0,
|
||||
{0,0,0}, 0, 0.0, 0.0, false, 0, 0, 0.0)
|
||||
{}
|
||||
|
||||
bool Connection::sameCoordinate(const int i, const int j, const int k) const {
|
||||
if ((ijk[0] == i) && (ijk[1] == j) && (ijk[2] == k)) {
|
||||
|
||||
@@ -115,6 +115,11 @@ inline std::array< size_t, 3> directionIndices(const Opm::Connection::Direction
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
WellConnections::WellConnections() :
|
||||
headI(0), headJ(0), num_removed(0)
|
||||
{
|
||||
}
|
||||
|
||||
WellConnections::WellConnections(int headIArg, int headJArg) :
|
||||
headI(headIArg),
|
||||
headJ(headJArg)
|
||||
@@ -122,6 +127,17 @@ inline std::array< size_t, 3> directionIndices(const Opm::Connection::Direction
|
||||
}
|
||||
|
||||
|
||||
WellConnections::WellConnections(int headIArg, int headJArg,
|
||||
size_t numRemoved,
|
||||
const std::vector<Connection>& connections) :
|
||||
headI(headIArg),
|
||||
headJ(headJArg),
|
||||
num_removed(numRemoved),
|
||||
m_connections(connections)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
WellConnections::WellConnections(const WellConnections& src, const EclipseGrid& grid) :
|
||||
headI(src.headI),
|
||||
@@ -505,4 +521,24 @@ inline std::array< size_t, 3> directionIndices(const Opm::Connection::Direction
|
||||
this->num_removed += std::distance(new_end, m_connections.end());
|
||||
m_connections.erase(new_end, m_connections.end());
|
||||
}
|
||||
|
||||
|
||||
int WellConnections::getHeadI() const {
|
||||
return headI;
|
||||
}
|
||||
|
||||
|
||||
int WellConnections::getHeadJ() const {
|
||||
return headJ;
|
||||
}
|
||||
|
||||
|
||||
size_t WellConnections::getNumRemoved() const {
|
||||
return num_removed;
|
||||
}
|
||||
|
||||
|
||||
const std::vector<Connection>& WellConnections::getConnections() const {
|
||||
return m_connections;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,6 +47,39 @@ namespace Opm {
|
||||
{
|
||||
}
|
||||
|
||||
WellEconProductionLimits::WellEconProductionLimits(double minOilRate,
|
||||
double minGasRate,
|
||||
double maxWaterCut,
|
||||
double maxGasOilRatio,
|
||||
double maxWaterGasRatio,
|
||||
EconWorkover workover,
|
||||
bool endRun,
|
||||
const std::string& followonWell,
|
||||
QuantityLimit quantityLimit,
|
||||
double secondaryMaxWaterCut,
|
||||
EconWorkover workoverSecondary,
|
||||
double maxGasLiquidRatio,
|
||||
double minLiquidRate,
|
||||
double maxTemperature,
|
||||
double minReservoirFluidRate)
|
||||
: m_min_oil_rate(minOilRate)
|
||||
, m_min_gas_rate(minGasRate)
|
||||
, m_max_water_cut(maxWaterCut)
|
||||
, m_max_gas_oil_ratio(maxGasOilRatio)
|
||||
, m_max_water_gas_ratio(maxWaterGasRatio)
|
||||
, m_workover(workover)
|
||||
, m_end_run(endRun)
|
||||
, m_followon_well(followonWell)
|
||||
, m_quantity_limit(quantityLimit)
|
||||
, m_secondary_max_water_cut(secondaryMaxWaterCut)
|
||||
, m_workover_secondary(workoverSecondary)
|
||||
, m_max_gas_liquid_ratio(maxGasLiquidRatio)
|
||||
, m_min_liquid_rate(minLiquidRate)
|
||||
, m_max_temperature(maxTemperature)
|
||||
, m_min_reservoir_fluid_rate(minReservoirFluidRate)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
WellEconProductionLimits::WellEconProductionLimits(const DeckRecord& record)
|
||||
|
||||
@@ -27,6 +27,11 @@ void Opm::WellFoamProperties::handleWFOAM(const DeckRecord& rec)
|
||||
this->m_foamConcentration = rec.getItem("FOAM_CONCENTRATION").get<UDAValue>(0).get<double>();
|
||||
}
|
||||
|
||||
bool Opm::WellFoamProperties::operator==(const WellFoamProperties& other) const
|
||||
{
|
||||
return this->m_foamConcentration == other.m_foamConcentration;
|
||||
}
|
||||
|
||||
bool Opm::WellFoamProperties::operator!=(const WellFoamProperties& other) const
|
||||
{
|
||||
return this->m_foamConcentration != other.m_foamConcentration;
|
||||
|
||||
@@ -35,6 +35,14 @@
|
||||
namespace Opm {
|
||||
|
||||
|
||||
Well::WellInjectionProperties::WellInjectionProperties()
|
||||
: temperature(0.0), BHPH(0.0), THPH(0.0), VFPTableNumber(0),
|
||||
predictionMode(false), injectionControls(0),
|
||||
injectorType(Well::InjectorType::WATER),
|
||||
controlMode(Well::InjectorCMode::CMODE_UNDEFINED)
|
||||
{
|
||||
}
|
||||
|
||||
Well::WellInjectionProperties::WellInjectionProperties(const std::string& wname)
|
||||
: name(wname),
|
||||
injectorType(InjectorType::WATER),
|
||||
@@ -51,6 +59,36 @@ namespace Opm {
|
||||
}
|
||||
|
||||
|
||||
Well::WellInjectionProperties::WellInjectionProperties(const std::string& wname,
|
||||
const UDAValue& surfaceInjRate,
|
||||
const UDAValue& reservoirInjRate,
|
||||
const UDAValue& BHP,
|
||||
const UDAValue& THP,
|
||||
double temp, double bhph,
|
||||
double thph,
|
||||
int vfpTableNum,
|
||||
bool predMode,
|
||||
int injControls,
|
||||
Well::InjectorType injType,
|
||||
InjectorCMode ctrlMode)
|
||||
: name(wname),
|
||||
surfaceInjectionRate(surfaceInjRate),
|
||||
reservoirInjectionRate(reservoirInjRate),
|
||||
BHPLimit(BHP),
|
||||
THPLimit(THP),
|
||||
temperature(temp),
|
||||
BHPH(bhph),
|
||||
THPH(thph),
|
||||
VFPTableNumber(vfpTableNum),
|
||||
predictionMode(predMode),
|
||||
injectionControls(injControls),
|
||||
injectorType(injType),
|
||||
controlMode(ctrlMode)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
|
||||
void Well::WellInjectionProperties::handleWCONINJE(const DeckRecord& record, bool availableForGroupControl, const std::string& well_name) {
|
||||
this->injectorType = Well::InjectorTypeFromString( record.getItem("TYPE").getTrimmedString(0) );
|
||||
this->predictionMode = true;
|
||||
|
||||
@@ -34,6 +34,18 @@ namespace Opm {
|
||||
m_skprpolytable = -1;
|
||||
}
|
||||
|
||||
WellPolymerProperties::WellPolymerProperties(double polymerConcentration,
|
||||
double saltConcentration,
|
||||
int plymwinjtable,
|
||||
int skprwattable,
|
||||
int skprpolytable)
|
||||
: m_polymerConcentration(polymerConcentration)
|
||||
, m_saltConcentration(saltConcentration)
|
||||
, m_plymwinjtable(plymwinjtable)
|
||||
, m_skprwattable(skprwattable)
|
||||
, m_skprpolytable(skprpolytable)
|
||||
{ }
|
||||
|
||||
bool WellPolymerProperties::operator==(const WellPolymerProperties& other) const {
|
||||
if ((m_polymerConcentration == other.m_polymerConcentration) &&
|
||||
(m_saltConcentration == other.m_saltConcentration) &&
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -27,6 +27,11 @@ namespace Opm {
|
||||
WellTracerProperties::WellTracerProperties() {
|
||||
}
|
||||
|
||||
WellTracerProperties::WellTracerProperties(const ConcentrationMap& concentrations)
|
||||
: m_tracerConcentrations(concentrations)
|
||||
{ }
|
||||
|
||||
|
||||
bool WellTracerProperties::operator==(const WellTracerProperties& other) const {
|
||||
if (m_tracerConcentrations == other.m_tracerConcentrations)
|
||||
return true;
|
||||
@@ -49,4 +54,8 @@ namespace Opm {
|
||||
bool WellTracerProperties::operator!=(const WellTracerProperties& other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
const WellTracerProperties::ConcentrationMap& WellTracerProperties::getConcentrations() const {
|
||||
return m_tracerConcentrations;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user