Rename Well2 -> Well and Group2 -> Group
This commit is contained in:
@@ -95,7 +95,7 @@ if(ENABLE_ECL_INPUT)
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Action/Condition.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Events.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/Group2.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/Group.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.cpp
|
||||
@@ -116,7 +116,7 @@ if(ENABLE_ECL_INPUT)
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Tuning.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/Connection.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/eval_uda.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/Well2.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/Well.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WList.cpp
|
||||
src/opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.cpp
|
||||
@@ -605,7 +605,7 @@ if(ENABLE_ECL_INPUT)
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/Connection.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/ProductionControls.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/InjectionControls.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WList.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WListManager.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Well/WellEconProductionLimits.hpp
|
||||
@@ -623,7 +623,7 @@ if(ENABLE_ECL_INPUT)
|
||||
opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/GConSale.hpp
|
||||
opm/parser/eclipse/EclipseState/Schedule/Group/GConSump.hpp
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
namespace Opm {
|
||||
class Schedule;
|
||||
class SummaryState;
|
||||
class Group2;
|
||||
class Group;
|
||||
} // Opm
|
||||
|
||||
namespace Opm { namespace RestartIO { namespace Helpers {
|
||||
|
||||
@@ -19,8 +19,8 @@
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
|
||||
#ifndef GROUPTREE2
|
||||
#define GROUPTREE2
|
||||
@@ -29,25 +29,25 @@ namespace Opm {
|
||||
|
||||
class GTNode {
|
||||
public:
|
||||
GTNode(const Group2& group, const GTNode* parent);
|
||||
GTNode(const Group& group, const GTNode* parent);
|
||||
|
||||
void add_group(const GTNode& child_group);
|
||||
void add_well(const Well2& well);
|
||||
void add_well(const Well& well);
|
||||
|
||||
const std::vector<Well2>& wells() const;
|
||||
const std::vector<Well>& wells() const;
|
||||
const std::vector<GTNode>& groups() const;
|
||||
const std::string& name() const;
|
||||
const GTNode& parent() const;
|
||||
const Group2& group() const;
|
||||
const Group& group() const;
|
||||
private:
|
||||
const Group2 m_group;
|
||||
const Group m_group;
|
||||
const GTNode * m_parent;
|
||||
/*
|
||||
Class T with a stl container <T> - supposedly undefined behavior before
|
||||
C++17 - but it compiles without warnings.
|
||||
*/
|
||||
std::vector<GTNode> m_child_groups;
|
||||
std::vector<Well2> m_wells;
|
||||
std::vector<Well> m_wells;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
namespace Opm {
|
||||
|
||||
class SummaryState;
|
||||
class Group2 {
|
||||
class Group {
|
||||
public:
|
||||
|
||||
// A group can have both injection controls and production controls set at
|
||||
@@ -161,7 +161,7 @@ struct ProductionControls {
|
||||
};
|
||||
|
||||
|
||||
Group2(const std::string& group_name, std::size_t insert_index_arg, std::size_t init_step_arg, double udq_undefined_arg, const UnitSystem& unit_system);
|
||||
Group(const std::string& group_name, std::size_t insert_index_arg, std::size_t init_step_arg, double udq_undefined_arg, const UnitSystem& unit_system);
|
||||
|
||||
bool defined(std::size_t timeStep) const;
|
||||
std::size_t insert_index() const;
|
||||
@@ -223,8 +223,8 @@ private:
|
||||
GroupProductionProperties production_properties{};
|
||||
};
|
||||
|
||||
Group2::GroupType operator |(Group2::GroupType lhs, Group2::GroupType rhs);
|
||||
Group2::GroupType operator &(Group2::GroupType lhs, Group2::GroupType rhs);
|
||||
Group::GroupType operator |(Group::GroupType lhs, Group::GroupType rhs);
|
||||
Group::GroupType operator &(Group::GroupType lhs, Group::GroupType rhs);
|
||||
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
#include <ctime>
|
||||
#include <unordered_map>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@@ -65,8 +65,8 @@ struct Potential {
|
||||
{}
|
||||
|
||||
|
||||
double eval(Group2::GuideRateTarget target) const;
|
||||
double eval(Well2::GuideRateTarget target) const;
|
||||
double eval(Group::GuideRateTarget target) const;
|
||||
double eval(Well::GuideRateTarget target) const;
|
||||
|
||||
|
||||
double oil_pot;
|
||||
@@ -77,8 +77,8 @@ struct Potential {
|
||||
public:
|
||||
GuideRate(const Schedule& schedule);
|
||||
void compute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot);
|
||||
double get(const std::string& well, Well2::GuideRateTarget target) const;
|
||||
double get(const std::string& group, Group2::GuideRateTarget target) const;
|
||||
double get(const std::string& well, Well::GuideRateTarget target) const;
|
||||
double get(const std::string& group, Group::GuideRateTarget target) const;
|
||||
private:
|
||||
void well_compute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot);
|
||||
void group_compute(const std::string& wgname, size_t report_step, double sim_time, double oil_pot, double gas_pot, double wat_pot);
|
||||
|
||||
@@ -25,8 +25,8 @@
|
||||
#include <memory>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@@ -34,30 +34,30 @@ namespace Opm {
|
||||
class GuideRateConfig {
|
||||
public:
|
||||
|
||||
struct Well {
|
||||
struct WellTarget {
|
||||
double guide_rate;
|
||||
Well2::GuideRateTarget target;
|
||||
Well::GuideRateTarget target;
|
||||
double scaling_factor;
|
||||
};
|
||||
|
||||
struct Group {
|
||||
struct GroupTarget {
|
||||
double guide_rate;
|
||||
Group2::GuideRateTarget target;
|
||||
Group::GuideRateTarget target;
|
||||
};
|
||||
|
||||
const GuideRateModel& model() const;
|
||||
bool has_model() const;
|
||||
bool update_model(const GuideRateModel& model);
|
||||
void update_well(const Well2& well);
|
||||
void update_group(const Group2& group);
|
||||
const Well& well(const std::string& well) const;
|
||||
const Group& group(const std::string& group) const;
|
||||
void update_well(const Well& well);
|
||||
void update_group(const Group& group);
|
||||
const WellTarget& well(const std::string& well) const;
|
||||
const GroupTarget& group(const std::string& group) const;
|
||||
bool has_well(const std::string& well) const;
|
||||
bool has_group(const std::string& group) const;
|
||||
private:
|
||||
std::shared_ptr<GuideRateModel> m_model;
|
||||
std::unordered_map<std::string, Well> wells;
|
||||
std::unordered_map<std::string, Group> groups;
|
||||
std::unordered_map<std::string, WellTarget> wells;
|
||||
std::unordered_map<std::string, GroupTarget> groups;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -21,8 +21,8 @@
|
||||
#define GUIDE_RATE_MODEL_HPP
|
||||
|
||||
#include <opm/parser/eclipse/Deck/UDAValue.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@@ -63,8 +63,8 @@ public:
|
||||
bool operator!=(const GuideRateModel& other) const;
|
||||
Target target() const;
|
||||
|
||||
static Target convert_target(Group2::GuideRateTarget group_target);
|
||||
static Target convert_target(Well2::GuideRateTarget well_target);
|
||||
static Target convert_target(Group::GuideRateTarget group_target);
|
||||
static Target convert_target(Well::GuideRateTarget well_target);
|
||||
static double pot(Target target, double oil_pot, double gas_pot, double wat_pot);
|
||||
private:
|
||||
double pot(double oil_pot, double gas_pot, double wat_pot) const;
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicVector.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GConSale.hpp>
|
||||
@@ -41,7 +41,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/RFTConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/VFPInjTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellTestConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Action/Actions.hpp>
|
||||
|
||||
@@ -70,14 +70,14 @@
|
||||
3. The DynamicState<T> has an awareness of the total length of the time
|
||||
axis, trying to access values beyound that is illegal.
|
||||
|
||||
For many of the non-trival objects like eg Well2 and Group2 the DynamicState<>
|
||||
For many of the non-trival objects like eg Well and Group the DynamicState<>
|
||||
contains a shared pointer to an underlying object, that way the fill operation
|
||||
when the vector is resized is quite fast. The following pattern is quite
|
||||
common for the Schedule implementation:
|
||||
|
||||
|
||||
// Create a new well object.
|
||||
std::shared_ptr<Well> new_well = this->getWell2( well_name, time_step );
|
||||
std::shared_ptr<Well> new_well = this->getWell( well_name, time_step );
|
||||
|
||||
// Update the new well object with new settings from the deck, the
|
||||
// updateXXXX() method will return true if the well object was actually
|
||||
@@ -170,14 +170,14 @@ namespace Opm
|
||||
std::vector<std::string> groupNames(const std::string& pattern) const;
|
||||
std::vector<std::string> groupNames() const;
|
||||
|
||||
void updateWell(std::shared_ptr<Well2> well, size_t reportStep);
|
||||
const Well2& getWell2(const std::string& wellName, size_t timeStep) const;
|
||||
const Well2& getWell2atEnd(const std::string& well_name) const;
|
||||
std::vector<Well2> getWells2(size_t timeStep) const;
|
||||
std::vector<Well2> getWells2atEnd() const;
|
||||
void updateWell(std::shared_ptr<Well> well, size_t reportStep);
|
||||
const Well& getWell(const std::string& wellName, size_t timeStep) const;
|
||||
const Well& getWellatEnd(const std::string& well_name) const;
|
||||
std::vector<Well> getWells(size_t timeStep) const;
|
||||
std::vector<Well> getWellsatEnd() const;
|
||||
|
||||
std::vector<const Group2*> getChildGroups2(const std::string& group_name, size_t timeStep) const;
|
||||
std::vector<Well2> getChildWells2(const std::string& group_name, size_t timeStep) const;
|
||||
std::vector<const Group*> getChildGroups2(const std::string& group_name, size_t timeStep) const;
|
||||
std::vector<Well> getChildWells2(const std::string& group_name, size_t timeStep) const;
|
||||
const OilVaporizationProperties& getOilVaporizationProperties(size_t timestep) const;
|
||||
|
||||
const UDQActive& udqActive(size_t timeStep) const;
|
||||
@@ -195,7 +195,7 @@ namespace Opm
|
||||
size_t numGroups(size_t timeStep) const;
|
||||
bool hasGroup(const std::string& groupName) const;
|
||||
bool hasGroup(const std::string& groupName, std::size_t timeStep) const;
|
||||
const Group2& getGroup2(const std::string& groupName, size_t timeStep) const;
|
||||
const Group& getGroup(const std::string& groupName, size_t timeStep) const;
|
||||
|
||||
const Tuning& getTuning() const;
|
||||
const MessageLimits& getMessageLimits() const;
|
||||
@@ -223,8 +223,8 @@ namespace Opm
|
||||
int getNupcol(size_t reportStep) const;
|
||||
private:
|
||||
TimeMap m_timeMap;
|
||||
OrderedMap< std::string, DynamicState<std::shared_ptr<Well2>>> wells_static;
|
||||
OrderedMap< std::string, DynamicState<std::shared_ptr<Group2>>> groups;
|
||||
OrderedMap< std::string, DynamicState<std::shared_ptr<Well>>> wells_static;
|
||||
OrderedMap< std::string, DynamicState<std::shared_ptr<Group>>> groups;
|
||||
DynamicState< OilVaporizationProperties > m_oilvaporizationproperties;
|
||||
Events m_events;
|
||||
DynamicVector< Deck > m_modifierDeck;
|
||||
@@ -240,7 +240,7 @@ namespace Opm
|
||||
DynamicState<std::shared_ptr<GuideRateConfig>> guide_rate_config;
|
||||
DynamicState<std::shared_ptr<GConSale>> gconsale;
|
||||
DynamicState<std::shared_ptr<GConSump>> gconsump;
|
||||
DynamicState<Well2::ProducerCMode> global_whistctl_mode;
|
||||
DynamicState<Well::ProducerCMode> global_whistctl_mode;
|
||||
DynamicState<std::shared_ptr<Action::Actions>> m_actions;
|
||||
RFTConfig rft_config;
|
||||
DynamicState<int> m_nupcol;
|
||||
@@ -249,16 +249,16 @@ namespace Opm
|
||||
std::map<std::string,Events> well_events;
|
||||
|
||||
GTNode groupTree(const std::string& root_node, std::size_t report_step, const GTNode * parent) const;
|
||||
void updateGroup(std::shared_ptr<Group2> group, size_t reportStep);
|
||||
void updateGroup(std::shared_ptr<Group> group, size_t reportStep);
|
||||
bool checkGroups(const ParseContext& parseContext, ErrorGuard& errors);
|
||||
void updateUDQActive( std::size_t timeStep, std::shared_ptr<UDQActive> udq );
|
||||
bool updateWellStatus( const std::string& well, size_t reportStep , Well2::Status status);
|
||||
bool updateWellStatus( const std::string& well, size_t reportStep , Well::Status status);
|
||||
void addWellToGroup( const std::string& group_name, const std::string& well_name , size_t timeStep);
|
||||
void iterateScheduleSection(const ParseContext& parseContext , ErrorGuard& errors, const SCHEDULESection& , const EclipseGrid& grid,
|
||||
const Eclipse3DProperties& eclipseProperties);
|
||||
void addACTIONX(const Action::ActionX& action, std::size_t currentStep);
|
||||
void addGroupToGroup( const std::string& parent_group, const std::string& child_group, size_t timeStep);
|
||||
void addGroupToGroup( const std::string& parent_group, const Group2& child_group, size_t timeStep);
|
||||
void addGroupToGroup( const std::string& parent_group, const Group& child_group, size_t timeStep);
|
||||
void addGroup(const std::string& groupName , size_t timeStep, const UnitSystem& unit_system);
|
||||
void addWell(const std::string& wellName, const DeckRecord& record, size_t timeStep, Connection::Order connection_order, const UnitSystem& unit_system);
|
||||
void handleUDQ(const DeckKeyword& keyword, size_t currentStep);
|
||||
|
||||
@@ -47,7 +47,7 @@ class UDQActive;
|
||||
class UDQConfig;
|
||||
|
||||
|
||||
class Well2 {
|
||||
class Well {
|
||||
public:
|
||||
|
||||
enum class Status {
|
||||
@@ -198,7 +198,7 @@ public:
|
||||
int VFPTableNumber;
|
||||
bool predictionMode;
|
||||
int injectionControls;
|
||||
Well2::InjectorType injectorType;
|
||||
Well::InjectorType injectorType;
|
||||
InjectorCMode controlMode;
|
||||
|
||||
bool operator==(const WellInjectionProperties& other) const;
|
||||
@@ -327,7 +327,7 @@ public:
|
||||
};
|
||||
|
||||
|
||||
Well2(const std::string& wname,
|
||||
Well(const std::string& wname,
|
||||
const std::string& gname,
|
||||
std::size_t init_step,
|
||||
std::size_t insert_index,
|
||||
@@ -470,7 +470,7 @@ private:
|
||||
std::shared_ptr<const WellSegments> segments;
|
||||
};
|
||||
|
||||
std::ostream& operator<<( std::ostream&, const Well2::WellInjectionProperties& );
|
||||
std::ostream& operator<<( std::ostream&, const Well::WellInjectionProperties& );
|
||||
std::ostream& operator<<( std::ostream&, const WellProductionProperties& );
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellTestConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
|
||||
namespace Opm {
|
||||
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
the openiing attempts, and also set the time for the last attempt to open.
|
||||
*/
|
||||
std::vector<std::pair<std::string, WellTestConfig::Reason>> updateWells(const WellTestConfig& config,
|
||||
const std::vector<Well2>& wells_ecl,
|
||||
const std::vector<Well>& wells_ecl,
|
||||
double sim_time);
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,24 +1,24 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
|
||||
#include <pybind11/stl.h>
|
||||
#include "export.hpp"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
const std::vector<std::string> wellnames( const Group2& g ) {
|
||||
const std::vector<std::string> wellnames( const Group& g ) {
|
||||
return g.wells( );
|
||||
}
|
||||
|
||||
int get_vfp_table_nr( const Group2& g ) {
|
||||
int get_vfp_table_nr( const Group& g ) {
|
||||
return g.getGroupNetVFPTable();
|
||||
}
|
||||
}
|
||||
|
||||
void python::common::export_Group(py::module& module) {
|
||||
|
||||
py::class_< Group2 >( module, "Group")
|
||||
.def_property_readonly( "name", &Group2::name)
|
||||
.def_property_readonly( "num_wells", &Group2::numWells)
|
||||
py::class_< Group >( module, "Group")
|
||||
.def_property_readonly( "name", &Group::name)
|
||||
.def_property_readonly( "num_wells", &Group::numWells)
|
||||
.def( "_vfp_table_nr", &get_vfp_table_nr )
|
||||
.def_property_readonly( "well_names", &wellnames );
|
||||
|
||||
|
||||
@@ -48,8 +48,8 @@ namespace {
|
||||
return system_clock::from_time_t(local_time);
|
||||
}
|
||||
|
||||
const Well2& get_well( const Schedule& sch, const std::string& name, const size_t& timestep ) try {
|
||||
return sch.getWell2( name, timestep );
|
||||
const Well& get_well( const Schedule& sch, const std::string& name, const size_t& timestep ) try {
|
||||
return sch.getWell( name, timestep );
|
||||
} catch( const std::invalid_argument& e ) {
|
||||
throw py::key_error( name );
|
||||
}
|
||||
@@ -73,10 +73,10 @@ namespace {
|
||||
return v;
|
||||
}
|
||||
|
||||
std::vector<Group2> get_groups( const Schedule& sch, size_t timestep ) {
|
||||
std::vector< Group2 > groups;
|
||||
std::vector<Group> get_groups( const Schedule& sch, size_t timestep ) {
|
||||
std::vector< Group > groups;
|
||||
for( const auto& group_name : sch.groupNames())
|
||||
groups.push_back( sch.getGroup2(group_name, timestep) );
|
||||
groups.push_back( sch.getGroup(group_name, timestep) );
|
||||
|
||||
return groups;
|
||||
}
|
||||
@@ -96,9 +96,9 @@ void python::common::export_Schedule(py::module& module) {
|
||||
.def_property_readonly( "start", &get_start_time )
|
||||
.def_property_readonly( "end", &get_end_time )
|
||||
.def_property_readonly( "timesteps", &get_timesteps )
|
||||
.def( "get_wells", &Schedule::getWells2)
|
||||
.def( "get_wells", &Schedule::getWells)
|
||||
.def( "get_well", &get_well)
|
||||
.def( "__contains__", &has_well )
|
||||
.def( "group", &Schedule::getGroup2, ref_internal);
|
||||
.def( "group", &Schedule::getGroup, ref_internal);
|
||||
|
||||
}
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
#include <tuple>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
#include <pybind11/stl.h>
|
||||
#include "export.hpp"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
std::vector<Connection> connections( const Well2& w ) {
|
||||
std::vector<Connection> connections( const Well& w ) {
|
||||
const auto& well_connections = w.getConnections();
|
||||
return std::vector<Connection>(well_connections.begin(), well_connections.end());
|
||||
}
|
||||
|
||||
std::string status( const Well2& w ) {
|
||||
return Well2::Status2String( w.getStatus() );
|
||||
std::string status( const Well& w ) {
|
||||
return Well::Status2String( w.getStatus() );
|
||||
}
|
||||
|
||||
std::string preferred_phase( const Well2& w ) {
|
||||
std::string preferred_phase( const Well& w ) {
|
||||
switch( w.getPreferredPhase() ) {
|
||||
case Phase::OIL: return "OIL";
|
||||
case Phase::GAS: return "GAS";
|
||||
@@ -25,7 +25,7 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
std::tuple<int, int, double> get_pos( const Well2& w ) {
|
||||
std::tuple<int, int, double> get_pos( const Well& w ) {
|
||||
return std::make_tuple(w.getHeadI(), w.getHeadJ(), w.getRefDepth());
|
||||
}
|
||||
|
||||
@@ -33,17 +33,17 @@ namespace {
|
||||
|
||||
void python::common::export_Well(py::module& module) {
|
||||
|
||||
py::class_< Well2 >( module, "Well")
|
||||
.def_property_readonly( "name", &Well2::name )
|
||||
py::class_< Well >( module, "Well")
|
||||
.def_property_readonly( "name", &Well::name )
|
||||
.def_property_readonly( "preferred_phase", &preferred_phase )
|
||||
.def( "pos", &get_pos )
|
||||
.def( "status", &status )
|
||||
.def( "isdefined", &Well2::hasBeenDefined )
|
||||
.def( "isinjector", &Well2::isInjector )
|
||||
.def( "isproducer", &Well2::isProducer )
|
||||
.def( "group", &Well2::groupName )
|
||||
.def( "guide_rate", &Well2::getGuideRate )
|
||||
.def( "available_gctrl", &Well2::isAvailableForGroupControl )
|
||||
.def( "isdefined", &Well::hasBeenDefined )
|
||||
.def( "isinjector", &Well::isInjector )
|
||||
.def( "isproducer", &Well::isProducer )
|
||||
.def( "group", &Well::groupName )
|
||||
.def( "guide_rate", &Well::getGuideRate )
|
||||
.def( "available_gctrl", &Well::isAvailableForGroupControl )
|
||||
.def( "connections", &connections );
|
||||
|
||||
}
|
||||
|
||||
@@ -54,7 +54,7 @@ namespace {
|
||||
}
|
||||
|
||||
template <class ConnOp>
|
||||
void connectionLoop(const std::vector<Opm::Well2>& wells,
|
||||
void connectionLoop(const std::vector<Opm::Well>& wells,
|
||||
const Opm::EclipseGrid& grid,
|
||||
ConnOp&& connOp)
|
||||
{
|
||||
@@ -278,7 +278,7 @@ captureDeclaredConnData(const Schedule& sched,
|
||||
const data::WellRates& xw,
|
||||
const std::size_t sim_step)
|
||||
{
|
||||
const auto& wells = sched.getWells2(sim_step);
|
||||
const auto& wells = sched.getWells(sim_step);
|
||||
//
|
||||
// construct a composite vector of connection objects holding
|
||||
// rates for all open connectons
|
||||
@@ -313,7 +313,7 @@ captureDeclaredConnData(const Schedule& sched,
|
||||
}
|
||||
|
||||
connectionLoop(wells, grid, [&units, &allWellConnections, this]
|
||||
(const Well2& well, const std::size_t wellID,
|
||||
(const Well& well, const std::size_t wellID,
|
||||
const Connection& conn, const std::size_t connID) -> void
|
||||
{
|
||||
auto ic = this->iConn_(wellID, connID);
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GTNode.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstddef>
|
||||
@@ -56,7 +56,7 @@ int nwgmax(const std::vector<int>& inteHead)
|
||||
|
||||
|
||||
template <typename GroupOp>
|
||||
void groupLoop(const std::vector<const Opm::Group2*>& groups,
|
||||
void groupLoop(const std::vector<const Opm::Group*>& groups,
|
||||
GroupOp&& groupOp)
|
||||
{
|
||||
auto groupID = std::size_t{0};
|
||||
@@ -70,14 +70,14 @@ void groupLoop(const std::vector<const Opm::Group2*>& groups,
|
||||
}
|
||||
|
||||
|
||||
int currentGroupLevel(const Opm::Schedule& sched, const Opm::Group2& group, const size_t simStep)
|
||||
int currentGroupLevel(const Opm::Schedule& sched, const Opm::Group& group, const size_t simStep)
|
||||
{
|
||||
if (group.defined( simStep )) {
|
||||
auto current = group;
|
||||
int level = 0;
|
||||
while (current.name() != "FIELD") {
|
||||
level += 1;
|
||||
current = sched.getGroup2(current.parent(), simStep);
|
||||
current = sched.getGroup(current.parent(), simStep);
|
||||
}
|
||||
|
||||
return level;
|
||||
@@ -88,7 +88,7 @@ int currentGroupLevel(const Opm::Schedule& sched, const Opm::Group2& group, cons
|
||||
}
|
||||
}
|
||||
|
||||
int groupType(const Opm::Group2& group) {
|
||||
int groupType(const Opm::Group& group) {
|
||||
if (group.wellgroup())
|
||||
return 0;
|
||||
else
|
||||
@@ -96,7 +96,7 @@ int groupType(const Opm::Group2& group) {
|
||||
}
|
||||
|
||||
|
||||
std::size_t groupSize(const Opm::Group2& group) {
|
||||
std::size_t groupSize(const Opm::Group& group) {
|
||||
if (group.wellgroup())
|
||||
return group.wells().size();
|
||||
else
|
||||
@@ -124,7 +124,7 @@ allocate(const std::vector<int>& inteHead)
|
||||
|
||||
template <class IGrpArray>
|
||||
void staticContrib(const Opm::Schedule& sched,
|
||||
const Opm::Group2& group,
|
||||
const Opm::Group& group,
|
||||
const int nwgmax,
|
||||
const int ngmaxz,
|
||||
const std::size_t simStep,
|
||||
@@ -135,14 +135,14 @@ void staticContrib(const Opm::Schedule& sched,
|
||||
//group has child wells
|
||||
//store the well number (sequence index) in iGrp according to the sequence they are defined
|
||||
for (const auto& well_name : group.wells()) {
|
||||
const auto& well = sched.getWell2(well_name, simStep);
|
||||
const auto& well = sched.getWell(well_name, simStep);
|
||||
iGrp[igrpCount] = well.seqIndex() + 1;
|
||||
igrpCount += 1;
|
||||
}
|
||||
} else if (!group.groups().empty()) {
|
||||
int igrpCount = 0;
|
||||
for (const auto& group_name : group.groups()) {
|
||||
const auto& child_group = sched.getGroup2(group_name, simStep);
|
||||
const auto& child_group = sched.getGroup(group_name, simStep);
|
||||
iGrp[igrpCount] = child_group.insert_index();
|
||||
igrpCount += 1;
|
||||
}
|
||||
@@ -186,7 +186,7 @@ void staticContrib(const Opm::Schedule& sched,
|
||||
if (group.name() == "FIELD")
|
||||
iGrp[nwgmax+28] = 0;
|
||||
else {
|
||||
const auto& parent_group = sched.getGroup2(group.parent(), simStep);
|
||||
const auto& parent_group = sched.getGroup(group.parent(), simStep);
|
||||
if (parent_group.name() == "FIELD")
|
||||
iGrp[nwgmax+28] = ngmaxz;
|
||||
else
|
||||
@@ -283,7 +283,7 @@ void dynamicContrib(const std::vector<std::string>& restart_group_keys,
|
||||
const std::vector<std::string>& restart_field_keys,
|
||||
const std::map<std::string, size_t>& groupKeyToIndex,
|
||||
const std::map<std::string, size_t>& fieldKeyToIndex,
|
||||
const Opm::Group2& group,
|
||||
const Opm::Group& group,
|
||||
const Opm::SummaryState& sumState,
|
||||
XGrpArray& xGrp)
|
||||
{
|
||||
@@ -329,7 +329,7 @@ allocate(const std::vector<int>& inteHead)
|
||||
}
|
||||
|
||||
template <class ZGroupArray>
|
||||
void staticContrib(const Opm::Group2& group, ZGroupArray& zGroup)
|
||||
void staticContrib(const Opm::Group& group, ZGroupArray& zGroup)
|
||||
{
|
||||
zGroup[0] = group.name();
|
||||
}
|
||||
@@ -359,16 +359,16 @@ captureDeclaredGroupData(const Opm::Schedule& sched,
|
||||
const Opm::SummaryState& sumState,
|
||||
const std::vector<int>& inteHead)
|
||||
{
|
||||
std::vector<const Opm::Group2*> curGroups(ngmaxz(inteHead), nullptr);
|
||||
std::vector<const Opm::Group*> curGroups(ngmaxz(inteHead), nullptr);
|
||||
for (const auto& group_name : sched.groupNames(simStep)) {
|
||||
const auto& group = sched.getGroup2(group_name, simStep);
|
||||
const auto& group = sched.getGroup(group_name, simStep);
|
||||
int ind = (group.name() == "FIELD")
|
||||
? ngmaxz(inteHead)-1 : group.insert_index()-1;
|
||||
curGroups[ind] = std::addressof(group);
|
||||
}
|
||||
|
||||
groupLoop(curGroups, [&sched, simStep, this]
|
||||
(const Group2& group, const std::size_t groupID) -> void
|
||||
(const Group& group, const std::size_t groupID) -> void
|
||||
{
|
||||
auto ig = this->iGroup_[groupID];
|
||||
|
||||
@@ -378,7 +378,7 @@ captureDeclaredGroupData(const Opm::Schedule& sched,
|
||||
|
||||
// Define Static Contributions to SGrp Array.
|
||||
groupLoop(curGroups,
|
||||
[this](const Group2& /* group */, const std::size_t groupID) -> void
|
||||
[this](const Group& /* group */, const std::size_t groupID) -> void
|
||||
{
|
||||
auto sw = this->sGroup_[groupID];
|
||||
SGrp::staticContrib(sw);
|
||||
@@ -386,7 +386,7 @@ captureDeclaredGroupData(const Opm::Schedule& sched,
|
||||
|
||||
// Define Dynamic Contributions to XGrp Array.
|
||||
groupLoop(curGroups, [&sumState, this]
|
||||
(const Group2& group, const std::size_t groupID) -> void
|
||||
(const Group& group, const std::size_t groupID) -> void
|
||||
{
|
||||
auto xg = this->xGroup_[groupID];
|
||||
|
||||
@@ -397,7 +397,7 @@ captureDeclaredGroupData(const Opm::Schedule& sched,
|
||||
|
||||
// Define Static Contributions to ZGrp Array.
|
||||
groupLoop(curGroups, [this, &inteHead]
|
||||
(const Group2& group, const std::size_t /* groupID */) -> void
|
||||
(const Group& group, const std::size_t /* groupID */) -> void
|
||||
{
|
||||
std::size_t group_index = group.insert_index() - 1;
|
||||
if (group.name() == "FIELD")
|
||||
|
||||
@@ -387,7 +387,7 @@ namespace {
|
||||
}
|
||||
|
||||
template <typename MSWOp>
|
||||
void MSWLoop(const std::vector<const Opm::Well2*>& wells,
|
||||
void MSWLoop(const std::vector<const Opm::Well*>& wells,
|
||||
MSWOp&& mswOp)
|
||||
{
|
||||
auto mswID = std::size_t{0};
|
||||
@@ -420,7 +420,7 @@ namespace {
|
||||
}
|
||||
|
||||
template <class ISegArray>
|
||||
void staticContrib(const Opm::Well2& well,
|
||||
void staticContrib(const Opm::Well& well,
|
||||
const std::vector<int>& inteHead,
|
||||
ISegArray& iSeg)
|
||||
{
|
||||
@@ -471,7 +471,7 @@ namespace {
|
||||
}
|
||||
|
||||
template <class RSegArray>
|
||||
void staticContrib_useMSW(const Opm::Well2& well,
|
||||
void staticContrib_useMSW(const Opm::Well& well,
|
||||
const std::vector<int>& inteHead,
|
||||
const Opm::EclipseGrid& grid,
|
||||
const Opm::UnitSystem& units,
|
||||
@@ -643,7 +643,7 @@ namespace {
|
||||
}
|
||||
|
||||
template <class ILBSArray>
|
||||
void staticContrib(const Opm::Well2& well,
|
||||
void staticContrib(const Opm::Well& well,
|
||||
ILBSArray& iLBS)
|
||||
{
|
||||
if (well.isMultiSegment()) {
|
||||
@@ -682,7 +682,7 @@ namespace {
|
||||
}
|
||||
|
||||
template <class ILBRArray>
|
||||
void staticContrib(const Opm::Well2& well,
|
||||
void staticContrib(const Opm::Well& well,
|
||||
const std::vector<int>& inteHead,
|
||||
ILBRArray& iLBR)
|
||||
{
|
||||
@@ -732,8 +732,8 @@ captureDeclaredMSWData(const Schedule& sched,
|
||||
const Opm::data::WellRates& wr
|
||||
)
|
||||
{
|
||||
const auto& wells = sched.getWells2(rptStep);
|
||||
auto msw = std::vector<const Opm::Well2*>{};
|
||||
const auto& wells = sched.getWells(rptStep);
|
||||
auto msw = std::vector<const Opm::Well*>{};
|
||||
|
||||
//msw.reserve(wells.size());
|
||||
for (const auto& well : wells) {
|
||||
@@ -743,7 +743,7 @@ captureDeclaredMSWData(const Schedule& sched,
|
||||
// Extract Contributions to ISeg Array
|
||||
{
|
||||
MSWLoop(msw, [&inteHead, this]
|
||||
(const Well2& well, const std::size_t mswID) -> void
|
||||
(const Well& well, const std::size_t mswID) -> void
|
||||
{
|
||||
auto imsw = this->iSeg_[mswID];
|
||||
|
||||
@@ -753,7 +753,7 @@ captureDeclaredMSWData(const Schedule& sched,
|
||||
// Extract Contributions to RSeg Array
|
||||
{
|
||||
MSWLoop(msw, [&units, &inteHead, &grid, &smry, this, &wr]
|
||||
(const Well2& well, const std::size_t mswID) -> void
|
||||
(const Well& well, const std::size_t mswID) -> void
|
||||
{
|
||||
auto rmsw = this->rSeg_[mswID];
|
||||
|
||||
@@ -763,7 +763,7 @@ captureDeclaredMSWData(const Schedule& sched,
|
||||
// Extract Contributions to ILBS Array
|
||||
{
|
||||
MSWLoop(msw, [this]
|
||||
(const Well2& well, const std::size_t mswID) -> void
|
||||
(const Well& well, const std::size_t mswID) -> void
|
||||
{
|
||||
auto ilbs_msw = this->iLBS_[mswID];
|
||||
|
||||
@@ -773,7 +773,7 @@ captureDeclaredMSWData(const Schedule& sched,
|
||||
// Extract Contributions to ILBR Array
|
||||
{
|
||||
MSWLoop(msw, [&inteHead, this]
|
||||
(const Well2& well, const std::size_t mswID) -> void
|
||||
(const Well& well, const std::size_t mswID) -> void
|
||||
{
|
||||
auto ilbr_msw = this->iLBR_[mswID];
|
||||
|
||||
|
||||
@@ -275,7 +275,7 @@ namespace {
|
||||
|
||||
template <class DUDGArray>
|
||||
void staticContrib(const Opm::SummaryState& st,
|
||||
const std::vector<const Opm::Group2*> groups,
|
||||
const std::vector<const Opm::Group*> groups,
|
||||
const std::string udq,
|
||||
const std::size_t ngmaxz,
|
||||
DUDGArray& dUdg)
|
||||
@@ -352,13 +352,13 @@ std::pair<bool, int > findInVector(const std::vector<T> & vecOfElements, const
|
||||
}
|
||||
|
||||
// Make ordered list of current groups
|
||||
const std::vector<const Opm::Group2*> currentGroups(const Opm::Schedule& sched,
|
||||
const std::vector<const Opm::Group*> currentGroups(const Opm::Schedule& sched,
|
||||
const std::size_t simStep,
|
||||
const std::vector<int>& inteHead )
|
||||
{
|
||||
std::vector<const Opm::Group2*> curGroups(ngmaxz(inteHead), nullptr);
|
||||
std::vector<const Opm::Group*> curGroups(ngmaxz(inteHead), nullptr);
|
||||
for (const auto& group_name : sched.groupNames(simStep)) {
|
||||
const auto& group = sched.getGroup2(group_name, simStep);
|
||||
const auto& group = sched.getGroup(group_name, simStep);
|
||||
|
||||
//The FIELD group is the first group according to the insert_index()
|
||||
//In the Eclipse compatible restart file, the FILED group is put at the end of the list of groups (ngmaxz(inteHead)-1)
|
||||
@@ -402,11 +402,11 @@ const std::vector<int> iuap_data(const Opm::Schedule& sched,
|
||||
auto& ctrl = iuap[ind].control;
|
||||
wg_key = Opm::UDQ::keyword(ctrl);
|
||||
if ((wg_key == Opm::UDAKeyword::WCONPROD) || (wg_key == Opm::UDAKeyword::WCONINJE)) {
|
||||
const auto& well = sched.getWell2(iuap[ind].wgname, simStep);
|
||||
const auto& well = sched.getWell(iuap[ind].wgname, simStep);
|
||||
wg_no.push_back(well.seqIndex());
|
||||
}
|
||||
else if ((wg_key == Opm::UDAKeyword::GCONPROD) || (wg_key == Opm::UDAKeyword::GCONINJE)) {
|
||||
const auto& group = sched.getGroup2(iuap[ind].wgname, simStep);
|
||||
const auto& group = sched.getGroup(iuap[ind].wgname, simStep);
|
||||
wg_no.push_back(group.insert_index());
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -74,7 +74,7 @@ namespace {
|
||||
}
|
||||
|
||||
template <typename WellOp>
|
||||
void wellLoop(const std::vector<Opm::Well2>& wells,
|
||||
void wellLoop(const std::vector<Opm::Well>& wells,
|
||||
WellOp&& wellOp)
|
||||
{
|
||||
for (auto nWell = wells.size(), wellID = 0*nWell;
|
||||
@@ -108,7 +108,7 @@ namespace {
|
||||
// make group name to index map for the current time step
|
||||
std::map <const std::string, size_t> groupIndexMap;
|
||||
for (const auto& group_name : sched.groupNames(simStep)) {
|
||||
const auto& group = sched.getGroup2(group_name, simStep);
|
||||
const auto& group = sched.getGroup(group_name, simStep);
|
||||
int ind = (group.name() == "FIELD")
|
||||
? inteHead[VI::intehead::NGMAXZ]-1 : group.insert_index()-1;
|
||||
std::pair<const std::string, size_t> groupPair = std::make_pair(group.name(), ind);
|
||||
@@ -132,7 +132,7 @@ namespace {
|
||||
return ind;
|
||||
}
|
||||
|
||||
int wellType(const Opm::Well2& well, const Opm::SummaryState& st)
|
||||
int wellType(const Opm::Well& well, const Opm::SummaryState& st)
|
||||
{
|
||||
using WTypeVal = ::Opm::RestartIO::Helpers::VectorItems::IWell::Value::WellType;
|
||||
|
||||
@@ -140,7 +140,7 @@ namespace {
|
||||
return WTypeVal::Producer;
|
||||
}
|
||||
|
||||
using IType = ::Opm::Well2::InjectorType;
|
||||
using IType = ::Opm::Well::InjectorType;
|
||||
|
||||
const auto itype = well.injectionControls(st).injector_type;
|
||||
|
||||
@@ -152,7 +152,7 @@ namespace {
|
||||
}
|
||||
}
|
||||
|
||||
int wellVFPTab(const Opm::Well2& well, const Opm::SummaryState& st)
|
||||
int wellVFPTab(const Opm::Well& well, const Opm::SummaryState& st)
|
||||
{
|
||||
if (well.isInjector()) {
|
||||
return well.injectionControls(st).vfp_table_number;
|
||||
@@ -160,7 +160,7 @@ namespace {
|
||||
return well.productionControls(st).vfp_table_number;
|
||||
}
|
||||
|
||||
int ctrlMode(const Opm::Well2& well, const Opm::SummaryState& st)
|
||||
int ctrlMode(const Opm::Well& well, const Opm::SummaryState& st)
|
||||
{
|
||||
using WMCtrlVal = ::Opm::RestartIO::Helpers::VectorItems::IWell::Value::WellCtrlMode;
|
||||
|
||||
@@ -170,8 +170,8 @@ namespace {
|
||||
const auto wmctl = controls.cmode;
|
||||
const auto wtype = controls.injector_type;
|
||||
|
||||
using CMode = ::Opm::Well2::InjectorCMode;
|
||||
using WType = ::Opm::Well2::InjectorType;
|
||||
using CMode = ::Opm::Well::InjectorCMode;
|
||||
using WType = ::Opm::Well::InjectorType;
|
||||
|
||||
switch (wmctl) {
|
||||
case CMode::RATE: {
|
||||
@@ -193,7 +193,7 @@ namespace {
|
||||
{
|
||||
const auto stat = well.getStatus();
|
||||
|
||||
using WStat = ::Opm::Well2::Status;
|
||||
using WStat = ::Opm::Well::Status;
|
||||
|
||||
if (stat == WStat::SHUT) {
|
||||
return WMCtrlVal::Shut;
|
||||
@@ -205,7 +205,7 @@ namespace {
|
||||
else if (well.isProducer()) {
|
||||
const auto& controls = well.productionControls(st);
|
||||
|
||||
using CMode = ::Opm::Well2::ProducerCMode;
|
||||
using CMode = ::Opm::Well::ProducerCMode;
|
||||
|
||||
switch (controls.cmode) {
|
||||
case CMode::ORAT: return WMCtrlVal::OilRate;
|
||||
@@ -222,7 +222,7 @@ namespace {
|
||||
{
|
||||
const auto stat = well.getStatus();
|
||||
|
||||
using WStat = ::Opm::Well2::Status;
|
||||
using WStat = ::Opm::Well::Status;
|
||||
|
||||
if (stat == WStat::SHUT) {
|
||||
return WMCtrlVal::Shut;
|
||||
@@ -235,7 +235,7 @@ namespace {
|
||||
return WMCtrlVal::WMCtlUnk;
|
||||
}
|
||||
|
||||
int compOrder(const Opm::Well2& well)
|
||||
int compOrder(const Opm::Well& well)
|
||||
{
|
||||
using WCO = ::Opm::Connection::Order;
|
||||
using COVal = ::Opm::RestartIO::Helpers::
|
||||
@@ -251,7 +251,7 @@ namespace {
|
||||
}
|
||||
|
||||
template <class IWellArray>
|
||||
void staticContrib(const Opm::Well2& well,
|
||||
void staticContrib(const Opm::Well& well,
|
||||
const Opm::SummaryState& st,
|
||||
const std::size_t msWellID,
|
||||
const std::map <const std::string, size_t>& GroupMapNameInd,
|
||||
@@ -367,7 +367,7 @@ namespace {
|
||||
return inteHead[VI::intehead::NSWELZ];
|
||||
}
|
||||
|
||||
float datumDepth(const Opm::Well2& well)
|
||||
float datumDepth(const Opm::Well& well)
|
||||
{
|
||||
if (well.isMultiSegment()) {
|
||||
// Datum depth for multi-segment wells is
|
||||
@@ -441,7 +441,7 @@ namespace {
|
||||
}
|
||||
|
||||
template <class SWellArray>
|
||||
void staticContrib(const Opm::Well2& well,
|
||||
void staticContrib(const Opm::Well& well,
|
||||
const Opm::UnitSystem& units,
|
||||
const ::Opm::SummaryState& smry,
|
||||
SWellArray& sWell)
|
||||
@@ -511,8 +511,8 @@ namespace {
|
||||
else if (well.isInjector()) {
|
||||
const auto& ic = well.injectionControls(smry);
|
||||
|
||||
using IP = ::Opm::Well2::InjectorCMode;
|
||||
using IT = ::Opm::Well2::InjectorType;
|
||||
using IP = ::Opm::Well::InjectorCMode;
|
||||
using IT = ::Opm::Well::InjectorType;
|
||||
|
||||
if (ic.hasControl(IP::RATE)) {
|
||||
if (ic.injector_type == IT::OIL) {
|
||||
@@ -571,7 +571,7 @@ namespace {
|
||||
}
|
||||
|
||||
template <class XWellArray>
|
||||
void staticContrib(const ::Opm::Well2& well,
|
||||
void staticContrib(const ::Opm::Well& well,
|
||||
const Opm::SummaryState& st,
|
||||
const Opm::UnitSystem& units,
|
||||
XWellArray& xWell)
|
||||
@@ -704,7 +704,7 @@ namespace {
|
||||
}
|
||||
|
||||
template <class XWellArray>
|
||||
void dynamicContrib(const ::Opm::Well2& well,
|
||||
void dynamicContrib(const ::Opm::Well& well,
|
||||
const ::Opm::SummaryState& smry,
|
||||
XWellArray& xWell)
|
||||
{
|
||||
@@ -712,7 +712,7 @@ namespace {
|
||||
assignProducer(well.name(), smry, xWell);
|
||||
}
|
||||
else if (well.isInjector()) {
|
||||
using IType = ::Opm::Well2::InjectorType;
|
||||
using IType = ::Opm::Well::InjectorType;
|
||||
const auto itype = well.injectionControls(smry).injector_type;
|
||||
|
||||
switch (itype) {
|
||||
@@ -762,7 +762,7 @@ namespace {
|
||||
}
|
||||
|
||||
template <class ZWellArray>
|
||||
void staticContrib(const Opm::Well2& well, ZWellArray& zWell)
|
||||
void staticContrib(const Opm::Well& well, ZWellArray& zWell)
|
||||
{
|
||||
using Ix = ::Opm::RestartIO::Helpers::VectorItems::ZWell::index;
|
||||
|
||||
@@ -792,7 +792,7 @@ captureDeclaredWellData(const Schedule& sched,
|
||||
const ::Opm::SummaryState& smry,
|
||||
const std::vector<int>& inteHead)
|
||||
{
|
||||
const auto& wells = sched.getWells2(sim_step);
|
||||
const auto& wells = sched.getWells(sim_step);
|
||||
|
||||
// Static contributions to IWEL array.
|
||||
{
|
||||
@@ -801,7 +801,7 @@ captureDeclaredWellData(const Schedule& sched,
|
||||
auto msWellID = std::size_t{0};
|
||||
|
||||
wellLoop(wells, [&groupMapNameIndex, &msWellID, &smry, this]
|
||||
(const Well2& well, const std::size_t wellID) -> void
|
||||
(const Well& well, const std::size_t wellID) -> void
|
||||
{
|
||||
msWellID += well.isMultiSegment(); // 1-based index.
|
||||
auto iw = this->iWell_[wellID];
|
||||
@@ -812,7 +812,7 @@ captureDeclaredWellData(const Schedule& sched,
|
||||
|
||||
// Static contributions to SWEL array.
|
||||
wellLoop(wells, [&units, &smry, this]
|
||||
(const Well2& well, const std::size_t wellID) -> void
|
||||
(const Well& well, const std::size_t wellID) -> void
|
||||
{
|
||||
auto sw = this->sWell_[wellID];
|
||||
|
||||
@@ -821,7 +821,7 @@ captureDeclaredWellData(const Schedule& sched,
|
||||
|
||||
// Static contributions to XWEL array.
|
||||
wellLoop(wells, [&units, &smry, this]
|
||||
(const Well2& well, const std::size_t wellID) -> void
|
||||
(const Well& well, const std::size_t wellID) -> void
|
||||
{
|
||||
auto xw = this->xWell_[wellID];
|
||||
|
||||
@@ -830,7 +830,7 @@ captureDeclaredWellData(const Schedule& sched,
|
||||
|
||||
// Static contributions to ZWEL array.
|
||||
wellLoop(wells,
|
||||
[this](const Well2& well, const std::size_t wellID) -> void
|
||||
[this](const Well& well, const std::size_t wellID) -> void
|
||||
{
|
||||
auto zw = this->zWell_[wellID];
|
||||
|
||||
@@ -847,11 +847,11 @@ captureDynamicWellData(const Schedule& sched,
|
||||
const Opm::data::WellRates& xw,
|
||||
const ::Opm::SummaryState& smry)
|
||||
{
|
||||
const auto& wells = sched.getWells2(sim_step);
|
||||
const auto& wells = sched.getWells(sim_step);
|
||||
|
||||
// Dynamic contributions to IWEL array.
|
||||
wellLoop(wells, [this, &xw]
|
||||
(const Well2& well, const std::size_t wellID) -> void
|
||||
(const Well& well, const std::size_t wellID) -> void
|
||||
{
|
||||
auto iWell = this->iWell_[wellID];
|
||||
|
||||
@@ -866,7 +866,7 @@ captureDynamicWellData(const Schedule& sched,
|
||||
|
||||
// Dynamic contributions to XWEL array.
|
||||
wellLoop(wells, [this, &smry]
|
||||
(const Well2& well, const std::size_t wellID) -> void
|
||||
(const Well& well, const std::size_t wellID) -> void
|
||||
{
|
||||
auto xwell = this->xWell_[wellID];
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ namespace {
|
||||
{
|
||||
auto ncwmax = 0;
|
||||
|
||||
for (const auto& well : sched.getWells2(lookup_step)) {
|
||||
for (const auto& well : sched.getWells(lookup_step)) {
|
||||
const auto ncw = well.getConnections().size();
|
||||
|
||||
ncwmax = std::max(ncwmax, static_cast<int>(ncw));
|
||||
@@ -217,11 +217,11 @@ namespace {
|
||||
{
|
||||
const auto& wsd = rspec.wellSegmentDimensions();
|
||||
|
||||
const auto& sched_wells = sched.getWells2(lookup_step);
|
||||
const auto& sched_wells = sched.getWells(lookup_step);
|
||||
|
||||
const auto nsegwl =
|
||||
std::count_if(std::begin(sched_wells), std::end(sched_wells),
|
||||
[](const Opm::Well2& well)
|
||||
[](const Opm::Well& well)
|
||||
{
|
||||
return well.isMultiSegment();
|
||||
});
|
||||
|
||||
@@ -42,7 +42,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cmath>
|
||||
@@ -696,12 +696,12 @@ namespace {
|
||||
void checkWellVectorSizes(const std::vector<int>& opm_iwel,
|
||||
const std::vector<double>& opm_xwel,
|
||||
const std::vector<Opm::data::Rates::opt>& phases,
|
||||
const std::vector<Opm::Well2>& sched_wells)
|
||||
const std::vector<Opm::Well>& sched_wells)
|
||||
{
|
||||
const auto expected_xwel_size =
|
||||
std::accumulate(sched_wells.begin(), sched_wells.end(),
|
||||
std::size_t(0),
|
||||
[&phases](const std::size_t acc, const Opm::Well2& w)
|
||||
[&phases](const std::size_t acc, const Opm::Well& w)
|
||||
-> std::size_t
|
||||
{
|
||||
return acc
|
||||
@@ -744,7 +744,7 @@ namespace {
|
||||
|
||||
using rt = Opm::data::Rates::opt;
|
||||
|
||||
const auto& sched_wells = schedule.getWells2(rst_view.simStep());
|
||||
const auto& sched_wells = schedule.getWells(rst_view.simStep());
|
||||
std::vector<rt> phases;
|
||||
{
|
||||
const auto& phase = es.runspec().phases();
|
||||
@@ -859,7 +859,7 @@ namespace {
|
||||
if (gas) { xc.rates.set(Opm::data::Rates::opt::gas, 0.0); }
|
||||
}
|
||||
|
||||
void restoreConnResults(const Opm::Well2& well,
|
||||
void restoreConnResults(const Opm::Well& well,
|
||||
const std::size_t wellID,
|
||||
const Opm::EclipseGrid& grid,
|
||||
const Opm::UnitSystem& usys,
|
||||
@@ -980,7 +980,7 @@ namespace {
|
||||
}
|
||||
|
||||
Opm::data::Well
|
||||
restore_well(const Opm::Well2& well,
|
||||
restore_well(const Opm::Well& well,
|
||||
const std::size_t wellID,
|
||||
const Opm::EclipseGrid& grid,
|
||||
const Opm::UnitSystem& usys,
|
||||
@@ -1068,7 +1068,7 @@ namespace {
|
||||
const auto& units = es.getUnits();
|
||||
const auto& phases = es.runspec().phases();
|
||||
|
||||
const auto& wells = schedule.getWells2(rst_view->simStep());
|
||||
const auto& wells = schedule.getWells(rst_view->simStep());
|
||||
for (auto nWells = wells.size(), wellID = 0*nWells;
|
||||
wellID < nWells; ++wellID)
|
||||
{
|
||||
@@ -1165,7 +1165,7 @@ namespace {
|
||||
// Well cumulatives
|
||||
{
|
||||
const auto wellData = WellVectors { intehead, rst_view };
|
||||
const auto& wells = schedule.getWells2(sim_step);
|
||||
const auto& wells = schedule.getWells(sim_step);
|
||||
|
||||
for (auto nWells = wells.size(), wellID = 0*nWells;
|
||||
wellID < nWells; ++wellID)
|
||||
@@ -1182,7 +1182,7 @@ namespace {
|
||||
};
|
||||
|
||||
for (const auto& gname : schedule.groupNames(sim_step)) {
|
||||
const auto& group = schedule.getGroup2(gname, sim_step);
|
||||
const auto& group = schedule.getGroup(gname, sim_step);
|
||||
// Note: Order of group values in {I,X}GRP arrays mostly
|
||||
// matches group's order of occurrence in .DATA file.
|
||||
// Values pertaining to FIELD are stored at zero-based order
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace out {
|
||||
RegionCache::RegionCache(const Eclipse3DProperties& properties, const EclipseGrid& grid, const Schedule& schedule) {
|
||||
const auto& fipnum_data = properties.getIntGridProperty("FIPNUM").getData();
|
||||
|
||||
const auto& wells = schedule.getWells2atEnd();
|
||||
const auto& wells = schedule.getWellsatEnd();
|
||||
for (const auto& well : wells) {
|
||||
const auto& connections = well.getConnections( );
|
||||
for (const auto& c : connections) {
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/Eqldims.hpp>
|
||||
|
||||
#include <opm/common/OpmLog/OpmLog.hpp>
|
||||
@@ -106,7 +106,7 @@ namespace {
|
||||
|
||||
std::vector<double>
|
||||
serialize_OPM_XWEL(const data::Wells& wells,
|
||||
const std::vector<Opm::Well2>& sched_wells,
|
||||
const std::vector<Opm::Well>& sched_wells,
|
||||
const Phases& phase_spec,
|
||||
const EclipseGrid& grid)
|
||||
{
|
||||
@@ -120,7 +120,7 @@ namespace {
|
||||
std::vector< double > xwel;
|
||||
for (const auto& sched_well : sched_wells) {
|
||||
if (wells.count(sched_well.name()) == 0 ||
|
||||
sched_well.getStatus() == Opm::Well2::Status::SHUT)
|
||||
sched_well.getStatus() == Opm::Well::Status::SHUT)
|
||||
{
|
||||
const auto elems = (sched_well.getConnections().size()
|
||||
* (phases.size() + data::Connection::restart_size))
|
||||
@@ -321,7 +321,7 @@ namespace {
|
||||
// Extended set of OPM well vectors
|
||||
if (!ecl_compatible_rst)
|
||||
{
|
||||
const auto sched_wells = schedule.getWells2(sim_step);
|
||||
const auto sched_wells = schedule.getWells(sim_step);
|
||||
const auto sched_well_names = schedule.wellNames(sim_step);
|
||||
|
||||
const auto opm_xwel =
|
||||
@@ -537,12 +537,12 @@ void save(EclIO::OutputStream::Restart& rstFile,
|
||||
|
||||
// Write well and MSW data only when applicable (i.e., when present)
|
||||
{
|
||||
const auto& wells = schedule.getWells2(sim_step);
|
||||
const auto& wells = schedule.getWells(sim_step);
|
||||
|
||||
if (! wells.empty()) {
|
||||
const auto haveMSW =
|
||||
std::any_of(std::begin(wells), std::end(wells),
|
||||
[](const Well2& well)
|
||||
[](const Well& well)
|
||||
{
|
||||
return well.isMultiSegment();
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/GridProperty.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/IOConfig/IOConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp>
|
||||
@@ -187,7 +187,7 @@ namespace {
|
||||
};
|
||||
|
||||
for (const auto& wname : sched.wellNames()) {
|
||||
const auto& well = sched.getWell2atEnd(wname);
|
||||
const auto& well = sched.getWellatEnd(wname);
|
||||
|
||||
if (! well.isMultiSegment()) {
|
||||
// Don't allocate MS summary vectors for non-MS wells.
|
||||
@@ -320,7 +320,7 @@ struct quantity {
|
||||
* is the index of the block in question. wells is simulation data.
|
||||
*/
|
||||
struct fn_args {
|
||||
const std::vector<Opm::Well2>& schedule_wells;
|
||||
const std::vector<Opm::Well>& schedule_wells;
|
||||
double duration;
|
||||
const int sim_step;
|
||||
int num;
|
||||
@@ -414,7 +414,7 @@ inline quantity rate( const fn_args& args ) {
|
||||
template< bool injection >
|
||||
inline quantity flowing( const fn_args& args ) {
|
||||
const auto& wells = args.wells;
|
||||
auto pred = [&wells]( const Opm::Well2& w ) {
|
||||
auto pred = [&wells]( const Opm::Well& w ) {
|
||||
const auto& name = w.name();
|
||||
return w.isInjector( ) == injection
|
||||
&& wells.count( name ) > 0
|
||||
@@ -572,7 +572,7 @@ inline quantity thp( const fn_args& args ) {
|
||||
inline quantity bhp_history( const fn_args& args ) {
|
||||
if( args.schedule_wells.empty() ) return { 0.0, measure::pressure };
|
||||
|
||||
const Opm::Well2& sched_well = args.schedule_wells.front();
|
||||
const Opm::Well& sched_well = args.schedule_wells.front();
|
||||
|
||||
double bhp_hist;
|
||||
if ( sched_well.isProducer( ) )
|
||||
@@ -586,7 +586,7 @@ inline quantity bhp_history( const fn_args& args ) {
|
||||
inline quantity thp_history( const fn_args& args ) {
|
||||
if( args.schedule_wells.empty() ) return { 0.0, measure::pressure };
|
||||
|
||||
const Opm::Well2& sched_well = args.schedule_wells.front();
|
||||
const Opm::Well& sched_well = args.schedule_wells.front();
|
||||
|
||||
double thp_hist;
|
||||
if ( sched_well.isProducer() )
|
||||
@@ -633,7 +633,7 @@ inline quantity injection_history( const fn_args& args ) {
|
||||
inline quantity res_vol_production_target( const fn_args& args ) {
|
||||
|
||||
double sum = 0.0;
|
||||
for( const Opm::Well2& sched_well : args.schedule_wells )
|
||||
for( const Opm::Well& sched_well : args.schedule_wells )
|
||||
if (sched_well.getProductionProperties().predictionMode)
|
||||
sum += sched_well.getProductionProperties().ResVRate.get<double>();
|
||||
|
||||
@@ -1114,7 +1114,7 @@ static const std::unordered_map< std::string, Opm::UnitSystem::measure> block_un
|
||||
{"BOVIS" , Opm::UnitSystem::measure::viscosity},
|
||||
};
|
||||
|
||||
inline std::vector<Opm::Well2> find_wells( const Opm::Schedule& schedule,
|
||||
inline std::vector<Opm::Well> find_wells( const Opm::Schedule& schedule,
|
||||
const Opm::SummaryNode& node,
|
||||
const int sim_step,
|
||||
const Opm::out::RegionCache& regionCache ) {
|
||||
@@ -1128,7 +1128,7 @@ inline std::vector<Opm::Well2> find_wells( const Opm::Schedule& schedule,
|
||||
const auto& name = node.namedEntity();
|
||||
|
||||
if (schedule.hasWell(name, sim_step)) {
|
||||
const auto& well = schedule.getWell2( name, sim_step );
|
||||
const auto& well = schedule.getWell( name, sim_step );
|
||||
return { well };
|
||||
} else
|
||||
return {};
|
||||
@@ -1143,20 +1143,20 @@ inline std::vector<Opm::Well2> find_wells( const Opm::Schedule& schedule,
|
||||
}
|
||||
|
||||
if( cat == Opm::SummaryNode::Category::Field )
|
||||
return schedule.getWells2(sim_step);
|
||||
return schedule.getWells(sim_step);
|
||||
|
||||
if( cat == Opm::SummaryNode::Category::Region ) {
|
||||
std::vector<Opm::Well2> wells;
|
||||
std::vector<Opm::Well> wells;
|
||||
|
||||
const auto region = node.number();
|
||||
|
||||
for ( const auto& connection : regionCache.connections( region ) ){
|
||||
const auto& w_name = connection.first;
|
||||
if (schedule.hasWell(w_name, sim_step)) {
|
||||
const auto& well = schedule.getWell2( w_name, sim_step );
|
||||
const auto& well = schedule.getWell( w_name, sim_step );
|
||||
|
||||
const auto& it = std::find_if( wells.begin(), wells.end(),
|
||||
[&] ( const Opm::Well2& elem )
|
||||
[&] ( const Opm::Well& elem )
|
||||
{ return elem.name() == well.name(); });
|
||||
if ( it == wells.end() )
|
||||
wells.push_back( well );
|
||||
@@ -1274,13 +1274,13 @@ struct EfficiencyFactor
|
||||
|
||||
void setFactors(const Opm::SummaryNode& node,
|
||||
const Opm::Schedule& schedule,
|
||||
const std::vector<Opm::Well2>& schedule_wells,
|
||||
const std::vector<Opm::Well>& schedule_wells,
|
||||
const int sim_step);
|
||||
};
|
||||
|
||||
void EfficiencyFactor::setFactors(const Opm::SummaryNode& node,
|
||||
const Opm::Schedule& schedule,
|
||||
const std::vector<Opm::Well2>& schedule_wells,
|
||||
const std::vector<Opm::Well>& schedule_wells,
|
||||
const int sim_step)
|
||||
{
|
||||
this->factors.clear();
|
||||
@@ -1302,7 +1302,7 @@ void EfficiencyFactor::setFactors(const Opm::SummaryNode& node,
|
||||
continue;
|
||||
|
||||
double eff_factor = well.getEfficiencyFactor();
|
||||
const auto* group_ptr = std::addressof(schedule.getGroup2(well.groupName(), sim_step));
|
||||
const auto* group_ptr = std::addressof(schedule.getGroup(well.groupName(), sim_step));
|
||||
|
||||
while(true){
|
||||
if(( is_group
|
||||
@@ -1313,7 +1313,7 @@ void EfficiencyFactor::setFactors(const Opm::SummaryNode& node,
|
||||
|
||||
if (group_ptr->name() == "FIELD")
|
||||
break;
|
||||
group_ptr = std::addressof( schedule.getGroup2( group_ptr->parent(), sim_step ) );
|
||||
group_ptr = std::addressof( schedule.getGroup( group_ptr->parent(), sim_step ) );
|
||||
}
|
||||
|
||||
this->factors.emplace_back( well.name(), eff_factor );
|
||||
@@ -1369,7 +1369,7 @@ namespace Evaluator {
|
||||
const auto wells = get_wells
|
||||
? find_wells(input.sched, this->node_,
|
||||
static_cast<int>(sim_step), input.reg)
|
||||
: std::vector<Opm::Well2>{};
|
||||
: std::vector<Opm::Well>{};
|
||||
|
||||
if (get_wells && wells.empty())
|
||||
// Parameter depends on well information, but no active
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace {
|
||||
{
|
||||
auto rft = WellRFT{ xcon.size() };
|
||||
|
||||
for (const auto& conn : sched.getWell2(wname, reportStep).getConnections()) {
|
||||
for (const auto& conn : sched.getWell(wname, reportStep).getConnections()) {
|
||||
const auto i = static_cast<std::size_t>(conn.getI());
|
||||
const auto j = static_cast<std::size_t>(conn.getJ());
|
||||
const auto k = static_cast<std::size_t>(conn.getK());
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/ArrayDimChecker.hpp>
|
||||
@@ -60,7 +60,7 @@ namespace {
|
||||
{
|
||||
auto nconn = std::size_t{0};
|
||||
for (const auto& well_name : sched.wellNames()) {
|
||||
const auto& well = sched.getWell2atEnd(well_name);
|
||||
const auto& well = sched.getWellatEnd(well_name);
|
||||
nconn = std::max(nconn, well.getConnections().size());
|
||||
}
|
||||
|
||||
@@ -158,7 +158,7 @@ Opm::maxGroupSize(const Opm::Schedule& sched,
|
||||
int nwgmax = 0;
|
||||
|
||||
for (const auto& gnm : sched.groupNames(step)) {
|
||||
const auto& grp = sched.getGroup2(gnm, step);
|
||||
const auto& grp = sched.getGroup(gnm, step);
|
||||
const auto gsz = grp.wellgroup()
|
||||
? grp.numWells() : grp.groups().size();
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
GTNode::GTNode(const Group2& group_arg, const GTNode * parent_arg) :
|
||||
GTNode::GTNode(const Group& group_arg, const GTNode * parent_arg) :
|
||||
m_group(group_arg),
|
||||
m_parent(parent_arg)
|
||||
{}
|
||||
@@ -30,7 +30,7 @@ const std::string& GTNode::name() const {
|
||||
return this->m_group.name();
|
||||
}
|
||||
|
||||
const Group2& GTNode::group() const {
|
||||
const Group& GTNode::group() const {
|
||||
return this->m_group;
|
||||
}
|
||||
|
||||
@@ -42,7 +42,7 @@ const GTNode& GTNode::parent() const {
|
||||
}
|
||||
|
||||
|
||||
void GTNode::add_well(const Well2& well) {
|
||||
void GTNode::add_well(const Well& well) {
|
||||
this->m_wells.push_back(well);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ void GTNode::add_group(const GTNode& child_group) {
|
||||
this->m_child_groups.push_back(child_group);
|
||||
}
|
||||
|
||||
const std::vector<Well2>& GTNode::wells() const {
|
||||
const std::vector<Well>& GTNode::wells() const {
|
||||
return this->m_wells;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,13 +19,13 @@
|
||||
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
|
||||
|
||||
#include "../eval_uda.hpp"
|
||||
|
||||
namespace Opm {
|
||||
|
||||
Group2::Group2(const std::string& name, std::size_t insert_index_arg, std::size_t init_step_arg, double udq_undefined_arg, const UnitSystem& unit_system_arg) :
|
||||
Group::Group(const std::string& name, std::size_t insert_index_arg, std::size_t init_step_arg, double udq_undefined_arg, const UnitSystem& unit_system_arg) :
|
||||
m_name(name),
|
||||
m_insert_index(insert_index_arg),
|
||||
init_step(init_step_arg),
|
||||
@@ -41,31 +41,31 @@ Group2::Group2(const std::string& name, std::size_t insert_index_arg, std::size_
|
||||
this->parent_group = "FIELD";
|
||||
}
|
||||
|
||||
std::size_t Group2::insert_index() const {
|
||||
std::size_t Group::insert_index() const {
|
||||
return this->m_insert_index;
|
||||
}
|
||||
|
||||
bool Group2::defined(size_t timeStep) const {
|
||||
bool Group::defined(size_t timeStep) const {
|
||||
return (timeStep >= this->init_step);
|
||||
}
|
||||
|
||||
const std::string& Group2::name() const {
|
||||
const std::string& Group::name() const {
|
||||
return this->m_name;
|
||||
}
|
||||
|
||||
const Group2::GroupProductionProperties& Group2::productionProperties() const {
|
||||
const Group::GroupProductionProperties& Group::productionProperties() const {
|
||||
return this->production_properties;
|
||||
}
|
||||
|
||||
const Group2::GroupInjectionProperties& Group2::injectionProperties() const {
|
||||
const Group::GroupInjectionProperties& Group::injectionProperties() const {
|
||||
return this->injection_properties;
|
||||
}
|
||||
|
||||
int Group2::getGroupNetVFPTable() const {
|
||||
int Group::getGroupNetVFPTable() const {
|
||||
return this->vfp_table;
|
||||
}
|
||||
|
||||
bool Group2::updateNetVFPTable(int vfp_arg) {
|
||||
bool Group::updateNetVFPTable(int vfp_arg) {
|
||||
if (this->vfp_table != vfp_arg) {
|
||||
this->vfp_table = vfp_arg;
|
||||
return true;
|
||||
@@ -73,7 +73,7 @@ bool Group2::updateNetVFPTable(int vfp_arg) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Group2::updateInjection(const GroupInjectionProperties& injection) {
|
||||
bool Group::updateInjection(const GroupInjectionProperties& injection) {
|
||||
bool update = false;
|
||||
|
||||
if (this->injection_properties != injection) {
|
||||
@@ -90,7 +90,7 @@ bool Group2::updateInjection(const GroupInjectionProperties& injection) {
|
||||
}
|
||||
|
||||
|
||||
bool Group2::updateProduction(const GroupProductionProperties& production) {
|
||||
bool Group::updateProduction(const GroupProductionProperties& production) {
|
||||
bool update = false;
|
||||
|
||||
if (this->production_properties != production) {
|
||||
@@ -107,7 +107,7 @@ bool Group2::updateProduction(const GroupProductionProperties& production) {
|
||||
}
|
||||
|
||||
|
||||
bool Group2::GroupInjectionProperties::operator==(const GroupInjectionProperties& other) const {
|
||||
bool Group::GroupInjectionProperties::operator==(const GroupInjectionProperties& other) const {
|
||||
return
|
||||
this->phase == other.phase &&
|
||||
this->cmode == other.cmode &&
|
||||
@@ -121,12 +121,12 @@ bool Group2::GroupInjectionProperties::operator==(const GroupInjectionProperties
|
||||
}
|
||||
|
||||
|
||||
bool Group2::GroupInjectionProperties::operator!=(const GroupInjectionProperties& other) const {
|
||||
bool Group::GroupInjectionProperties::operator!=(const GroupInjectionProperties& other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
|
||||
bool Group2::GroupProductionProperties::operator==(const GroupProductionProperties& other) const {
|
||||
bool Group::GroupProductionProperties::operator==(const GroupProductionProperties& other) const {
|
||||
return
|
||||
this->cmode == other.cmode &&
|
||||
this->exceed_action == other.exceed_action &&
|
||||
@@ -139,54 +139,54 @@ bool Group2::GroupProductionProperties::operator==(const GroupProductionProperti
|
||||
}
|
||||
|
||||
|
||||
bool Group2::GroupProductionProperties::operator!=(const GroupProductionProperties& other) const {
|
||||
bool Group::GroupProductionProperties::operator!=(const GroupProductionProperties& other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
bool Group2::hasType(GroupType gtype) const {
|
||||
bool Group::hasType(GroupType gtype) const {
|
||||
return ((this->group_type & gtype) == gtype);
|
||||
}
|
||||
|
||||
void Group2::addType(GroupType new_gtype) {
|
||||
void Group::addType(GroupType new_gtype) {
|
||||
this->group_type = this->group_type | new_gtype;
|
||||
}
|
||||
|
||||
bool Group2::isProductionGroup() const {
|
||||
bool Group::isProductionGroup() const {
|
||||
return this->hasType(GroupType::PRODUCTION);
|
||||
}
|
||||
|
||||
bool Group2::isInjectionGroup() const {
|
||||
bool Group::isInjectionGroup() const {
|
||||
return this->hasType(GroupType::INJECTION);
|
||||
}
|
||||
|
||||
void Group2::setProductionGroup() {
|
||||
void Group::setProductionGroup() {
|
||||
this->addType(GroupType::PRODUCTION);
|
||||
}
|
||||
|
||||
void Group2::setInjectionGroup() {
|
||||
void Group::setInjectionGroup() {
|
||||
this->addType(GroupType::INJECTION);
|
||||
}
|
||||
|
||||
|
||||
std::size_t Group2::numWells() const {
|
||||
std::size_t Group::numWells() const {
|
||||
return this->m_wells.size();
|
||||
}
|
||||
|
||||
const std::vector<std::string>& Group2::wells() const {
|
||||
const std::vector<std::string>& Group::wells() const {
|
||||
return this->m_wells.data();
|
||||
}
|
||||
|
||||
const std::vector<std::string>& Group2::groups() const {
|
||||
const std::vector<std::string>& Group::groups() const {
|
||||
return this->m_groups.data();
|
||||
}
|
||||
|
||||
bool Group2::wellgroup() const {
|
||||
bool Group::wellgroup() const {
|
||||
if (this->m_groups.size() > 0)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Group2::addWell(const std::string& well_name) {
|
||||
bool Group::addWell(const std::string& well_name) {
|
||||
if (!this->m_groups.empty())
|
||||
throw std::logic_error("Groups can not mix group and well children. Trying to add well: " + well_name + " to group: " + this->name());
|
||||
|
||||
@@ -197,17 +197,17 @@ bool Group2::addWell(const std::string& well_name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Group2::hasWell(const std::string& well_name) const {
|
||||
bool Group::hasWell(const std::string& well_name) const {
|
||||
return (this->m_wells.count(well_name) == 1);
|
||||
}
|
||||
|
||||
void Group2::delWell(const std::string& well_name) {
|
||||
void Group::delWell(const std::string& well_name) {
|
||||
auto rm_count = this->m_wells.erase(well_name);
|
||||
if (rm_count == 0)
|
||||
throw std::invalid_argument("Group: " + this->name() + " does not have well: " + well_name);
|
||||
}
|
||||
|
||||
bool Group2::addGroup(const std::string& group_name) {
|
||||
bool Group::addGroup(const std::string& group_name) {
|
||||
if (!this->m_wells.empty())
|
||||
throw std::logic_error("Groups can not mix group and well children. Trying to add group: " + group_name + " to group: " + this->name());
|
||||
|
||||
@@ -218,17 +218,17 @@ bool Group2::addGroup(const std::string& group_name) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Group2::hasGroup(const std::string& group_name) const {
|
||||
bool Group::hasGroup(const std::string& group_name) const {
|
||||
return (this->m_groups.count(group_name) == 1);
|
||||
}
|
||||
|
||||
void Group2::delGroup(const std::string& group_name) {
|
||||
void Group::delGroup(const std::string& group_name) {
|
||||
auto rm_count = this->m_groups.erase(group_name);
|
||||
if (rm_count == 0)
|
||||
throw std::invalid_argument("Group does not have group: " + group_name);
|
||||
}
|
||||
|
||||
bool Group2::update_gefac(double gf, bool transfer_gf) {
|
||||
bool Group::update_gefac(double gf, bool transfer_gf) {
|
||||
bool update = false;
|
||||
if (this->gefac != gf) {
|
||||
this->gefac = gf;
|
||||
@@ -243,20 +243,20 @@ bool Group2::update_gefac(double gf, bool transfer_gf) {
|
||||
return update;
|
||||
}
|
||||
|
||||
double Group2::getGroupEfficiencyFactor() const {
|
||||
double Group::getGroupEfficiencyFactor() const {
|
||||
return this->gefac;
|
||||
}
|
||||
|
||||
bool Group2::getTransferGroupEfficiencyFactor() const {
|
||||
bool Group::getTransferGroupEfficiencyFactor() const {
|
||||
return this->transfer_gefac;
|
||||
}
|
||||
|
||||
const std::string& Group2::parent() const {
|
||||
const std::string& Group::parent() const {
|
||||
return this->parent_group;
|
||||
}
|
||||
|
||||
|
||||
bool Group2::updateParent(const std::string& parent) {
|
||||
bool Group::updateParent(const std::string& parent) {
|
||||
if (this->parent_group != parent) {
|
||||
this->parent_group = parent;
|
||||
return true;
|
||||
@@ -265,8 +265,8 @@ bool Group2::updateParent(const std::string& parent) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Group2::ProductionControls Group2::productionControls(const SummaryState& st) const {
|
||||
Group2::ProductionControls pc;
|
||||
Group::ProductionControls Group::productionControls(const SummaryState& st) const {
|
||||
Group::ProductionControls pc;
|
||||
|
||||
pc.cmode = this->production_properties.cmode;
|
||||
pc.exceed_action = this->production_properties.exceed_action;
|
||||
@@ -281,8 +281,8 @@ Group2::ProductionControls Group2::productionControls(const SummaryState& st) co
|
||||
return pc;
|
||||
}
|
||||
|
||||
Group2::InjectionControls Group2::injectionControls(const SummaryState& st) const {
|
||||
Group2::InjectionControls ic;
|
||||
Group::InjectionControls Group::injectionControls(const SummaryState& st) const {
|
||||
Group::InjectionControls ic;
|
||||
|
||||
ic.phase = this->injection_properties.phase;
|
||||
ic.cmode = this->injection_properties.cmode;
|
||||
@@ -295,38 +295,38 @@ Group2::InjectionControls Group2::injectionControls(const SummaryState& st) cons
|
||||
return ic;
|
||||
}
|
||||
|
||||
Group2::ProductionCMode Group2::production_cmode() const {
|
||||
Group::ProductionCMode Group::production_cmode() const {
|
||||
return this->production_properties.cmode;
|
||||
}
|
||||
|
||||
Group2::InjectionCMode Group2::injection_cmode() const {
|
||||
Group::InjectionCMode Group::injection_cmode() const {
|
||||
return this->injection_properties.cmode;
|
||||
}
|
||||
|
||||
Phase Group2::injection_phase() const {
|
||||
Phase Group::injection_phase() const {
|
||||
return this->injection_properties.phase;
|
||||
}
|
||||
|
||||
|
||||
bool Group2::ProductionControls::has_control(Group2::ProductionCMode control) const {
|
||||
bool Group::ProductionControls::has_control(Group::ProductionCMode control) const {
|
||||
return (this->production_controls & static_cast<int>(control)) != 0;
|
||||
}
|
||||
|
||||
|
||||
bool Group2::InjectionControls::has_control(InjectionCMode cmode_arg) const {
|
||||
bool Group::InjectionControls::has_control(InjectionCMode cmode_arg) const {
|
||||
return (this->injection_controls & static_cast<int>(cmode_arg)) != 0;
|
||||
}
|
||||
|
||||
bool Group2::has_control(Group2::ProductionCMode control) const {
|
||||
bool Group::has_control(Group::ProductionCMode control) const {
|
||||
return (this->production_properties.production_controls & static_cast<int>(control)) != 0;
|
||||
}
|
||||
|
||||
bool Group2::has_control(InjectionCMode control) const {
|
||||
bool Group::has_control(InjectionCMode control) const {
|
||||
return (this->injection_properties.injection_controls & static_cast<int>(control)) != 0;
|
||||
}
|
||||
|
||||
|
||||
const std::string Group2::ExceedAction2String( ExceedAction enumValue ) {
|
||||
const std::string Group::ExceedAction2String( ExceedAction enumValue ) {
|
||||
switch(enumValue) {
|
||||
case ExceedAction::NONE:
|
||||
return "NONE";
|
||||
@@ -346,7 +346,7 @@ const std::string Group2::ExceedAction2String( ExceedAction enumValue ) {
|
||||
}
|
||||
|
||||
|
||||
Group2::ExceedAction Group2::ExceedActionFromString( const std::string& stringValue ) {
|
||||
Group::ExceedAction Group::ExceedActionFromString( const std::string& stringValue ) {
|
||||
|
||||
if (stringValue == "NONE")
|
||||
return ExceedAction::NONE;
|
||||
@@ -365,7 +365,7 @@ Group2::ExceedAction Group2::ExceedActionFromString( const std::string& stringVa
|
||||
}
|
||||
|
||||
|
||||
const std::string Group2::InjectionCMode2String( InjectionCMode enumValue ) {
|
||||
const std::string Group::InjectionCMode2String( InjectionCMode enumValue ) {
|
||||
switch( enumValue ) {
|
||||
case InjectionCMode::NONE:
|
||||
return "NONE";
|
||||
@@ -385,7 +385,7 @@ const std::string Group2::InjectionCMode2String( InjectionCMode enumValue ) {
|
||||
}
|
||||
|
||||
|
||||
Group2::InjectionCMode Group2::InjectionCModeFromString( const std::string& stringValue ) {
|
||||
Group::InjectionCMode Group::InjectionCModeFromString( const std::string& stringValue ) {
|
||||
if (stringValue == "NONE")
|
||||
return InjectionCMode::NONE;
|
||||
else if (stringValue == "RATE")
|
||||
@@ -402,17 +402,17 @@ Group2::InjectionCMode Group2::InjectionCModeFromString( const std::string& stri
|
||||
throw std::invalid_argument("Unknown enum state string: " + stringValue );
|
||||
}
|
||||
|
||||
Group2::GroupType operator|(Group2::GroupType lhs, Group2::GroupType rhs) {
|
||||
return static_cast<Group2::GroupType>(static_cast<std::underlying_type<Group2::GroupType>::type>(lhs) | static_cast<std::underlying_type<Group2::GroupType>::type>(rhs));
|
||||
Group::GroupType operator|(Group::GroupType lhs, Group::GroupType rhs) {
|
||||
return static_cast<Group::GroupType>(static_cast<std::underlying_type<Group::GroupType>::type>(lhs) | static_cast<std::underlying_type<Group::GroupType>::type>(rhs));
|
||||
}
|
||||
|
||||
|
||||
Group2::GroupType operator&(Group2::GroupType lhs, Group2::GroupType rhs) {
|
||||
return static_cast<Group2::GroupType>(static_cast<std::underlying_type<Group2::GroupType>::type>(lhs) & static_cast<std::underlying_type<Group2::GroupType>::type>(rhs));
|
||||
Group::GroupType operator&(Group::GroupType lhs, Group::GroupType rhs) {
|
||||
return static_cast<Group::GroupType>(static_cast<std::underlying_type<Group::GroupType>::type>(lhs) & static_cast<std::underlying_type<Group::GroupType>::type>(rhs));
|
||||
}
|
||||
|
||||
|
||||
const std::string Group2::ProductionCMode2String( ProductionCMode enumValue ) {
|
||||
const std::string Group::ProductionCMode2String( ProductionCMode enumValue ) {
|
||||
switch( enumValue ) {
|
||||
case ProductionCMode::NONE:
|
||||
return "NONE";
|
||||
@@ -438,7 +438,7 @@ const std::string Group2::ProductionCMode2String( ProductionCMode enumValue ) {
|
||||
}
|
||||
|
||||
|
||||
Group2::ProductionCMode Group2::ProductionCModeFromString( const std::string& stringValue ) {
|
||||
Group::ProductionCMode Group::ProductionCModeFromString( const std::string& stringValue ) {
|
||||
if (stringValue == "NONE")
|
||||
return ProductionCMode::NONE;
|
||||
else if (stringValue == "ORAT")
|
||||
@@ -461,7 +461,7 @@ Group2::ProductionCMode Group2::ProductionCModeFromString( const std::string& st
|
||||
throw std::invalid_argument("Unknown enum state string: " + stringValue );
|
||||
}
|
||||
|
||||
Group2::GuideRateTarget Group2::GuideRateTargetFromString( const std::string& stringValue ) {
|
||||
Group::GuideRateTarget Group::GuideRateTargetFromString( const std::string& stringValue ) {
|
||||
if (stringValue == "OIL")
|
||||
return GuideRateTarget::OIL;
|
||||
else if (stringValue == "WAT")
|
||||
@@ -22,33 +22,33 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
double GuideRate::Potential::eval(Well2::GuideRateTarget target) const {
|
||||
if (target == Well2::GuideRateTarget::OIL)
|
||||
double GuideRate::Potential::eval(Well::GuideRateTarget target) const {
|
||||
if (target == Well::GuideRateTarget::OIL)
|
||||
return this->oil_pot;
|
||||
|
||||
if (target == Well2::GuideRateTarget::GAS)
|
||||
if (target == Well::GuideRateTarget::GAS)
|
||||
return this->gas_pot;
|
||||
|
||||
if (target == Well2::GuideRateTarget::LIQ)
|
||||
if (target == Well::GuideRateTarget::LIQ)
|
||||
return this->oil_pot + this->wat_pot;
|
||||
|
||||
if (target == Well2::GuideRateTarget::WAT)
|
||||
if (target == Well::GuideRateTarget::WAT)
|
||||
return this->wat_pot;
|
||||
|
||||
throw std::logic_error("Don't know how to convert .... ");
|
||||
}
|
||||
|
||||
double GuideRate::Potential::eval(Group2::GuideRateTarget target) const {
|
||||
if (target == Group2::GuideRateTarget::OIL)
|
||||
double GuideRate::Potential::eval(Group::GuideRateTarget target) const {
|
||||
if (target == Group::GuideRateTarget::OIL)
|
||||
return this->oil_pot;
|
||||
|
||||
if (target == Group2::GuideRateTarget::GAS)
|
||||
if (target == Group::GuideRateTarget::GAS)
|
||||
return this->gas_pot;
|
||||
|
||||
if (target == Group2::GuideRateTarget::LIQ)
|
||||
if (target == Group::GuideRateTarget::LIQ)
|
||||
return this->oil_pot + this->wat_pot;
|
||||
|
||||
if (target == Group2::GuideRateTarget::WAT)
|
||||
if (target == Group::GuideRateTarget::WAT)
|
||||
return this->wat_pot;
|
||||
|
||||
throw std::logic_error("Don't know how to convert .... ");
|
||||
@@ -61,7 +61,7 @@ GuideRate::GuideRate(const Schedule& schedule_arg) :
|
||||
|
||||
|
||||
|
||||
double GuideRate::get(const std::string& well, Well2::GuideRateTarget target) const {
|
||||
double GuideRate::get(const std::string& well, Well::GuideRateTarget target) const {
|
||||
const auto iter = this->values.find(well);
|
||||
if (iter != this->values.end()) {
|
||||
const auto& value = iter->second;
|
||||
@@ -80,7 +80,7 @@ double GuideRate::get(const std::string& well, Well2::GuideRateTarget target) co
|
||||
}
|
||||
}
|
||||
|
||||
double GuideRate::get(const std::string& group, Group2::GuideRateTarget target) const {
|
||||
double GuideRate::get(const std::string& group, Group::GuideRateTarget target) const {
|
||||
const auto iter = this->values.find(group);
|
||||
if (iter != this->values.end()) {
|
||||
auto model_target = GuideRateModel::convert_target(target);
|
||||
@@ -126,7 +126,7 @@ void GuideRate::group_compute(const std::string& wgname, size_t report_step, dou
|
||||
// then we just return.
|
||||
if (iter != this->values.end()) {
|
||||
const auto& grv = iter->second;
|
||||
if (group.target == Group2::GuideRateTarget::FORM) {
|
||||
if (group.target == Group::GuideRateTarget::FORM) {
|
||||
if (!config.has_model())
|
||||
throw std::logic_error("When specifying GUIDERATE target FORM you must enter a guiderate model with the GUIDERAT keyword");
|
||||
|
||||
@@ -137,13 +137,13 @@ void GuideRate::group_compute(const std::string& wgname, size_t report_step, dou
|
||||
}
|
||||
|
||||
|
||||
if (group.target == Group2::GuideRateTarget::INJV)
|
||||
if (group.target == Group::GuideRateTarget::INJV)
|
||||
throw std::logic_error("Group guide rate mode: INJV not implemented");
|
||||
|
||||
if (group.target == Group2::GuideRateTarget::POTN)
|
||||
if (group.target == Group::GuideRateTarget::POTN)
|
||||
throw std::logic_error("Group guide rate mode: POTN not implemented");
|
||||
|
||||
if (group.target == Group2::GuideRateTarget::FORM) {
|
||||
if (group.target == Group::GuideRateTarget::FORM) {
|
||||
double guide_rate;
|
||||
if (!config.has_model())
|
||||
throw std::logic_error("When specifying GUIDERATE target FORM you must enter a guiderate model with the GUIDERAT keyword");
|
||||
@@ -174,7 +174,7 @@ void GuideRate::well_compute(const std::string& wgname, size_t report_step, doub
|
||||
if (!this->schedule.hasWell(wgname, report_step))
|
||||
return;
|
||||
|
||||
const auto& well = this->schedule.getWell2(wgname, report_step);
|
||||
const auto& well = this->schedule.getWell(wgname, report_step);
|
||||
|
||||
// GUIDERAT does not apply to injectors
|
||||
if (well.isInjector())
|
||||
|
||||
@@ -47,7 +47,7 @@ bool GuideRateConfig::update_model(const GuideRateModel& new_model) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void GuideRateConfig::update_well(const Well2& well) {
|
||||
void GuideRateConfig::update_well(const Well& well) {
|
||||
if (well.isAvailableForGroupControl()) {
|
||||
auto& well_node = this->wells[well.name()];
|
||||
well_node.guide_rate = well.getGuideRate();
|
||||
@@ -57,17 +57,17 @@ void GuideRateConfig::update_well(const Well2& well) {
|
||||
this->wells.erase(well.name());
|
||||
}
|
||||
|
||||
const GuideRateConfig::Well& GuideRateConfig::well(const std::string& well) const {
|
||||
const GuideRateConfig::WellTarget& GuideRateConfig::well(const std::string& well) const {
|
||||
return this->wells.at(well);
|
||||
}
|
||||
|
||||
void GuideRateConfig::update_group(const Group2& group) {
|
||||
void GuideRateConfig::update_group(const Group& group) {
|
||||
if (group.name() == "FIELD")
|
||||
return;
|
||||
|
||||
const auto& properties = group.productionProperties();
|
||||
auto guide_target = properties.guide_rate_def;
|
||||
if (guide_target == Group2::GuideRateTarget::NO_GUIDE_RATE) {
|
||||
if (guide_target == Group::GuideRateTarget::NO_GUIDE_RATE) {
|
||||
this->groups.erase(group.name());
|
||||
return;
|
||||
}
|
||||
@@ -77,7 +77,7 @@ void GuideRateConfig::update_group(const Group2& group) {
|
||||
group_node.target = guide_target;
|
||||
}
|
||||
|
||||
const GuideRateConfig::Group& GuideRateConfig::group(const std::string& group) const {
|
||||
const GuideRateConfig::GroupTarget& GuideRateConfig::group(const std::string& group) const {
|
||||
return this->groups.at(group);
|
||||
}
|
||||
|
||||
|
||||
@@ -227,33 +227,33 @@ bool GuideRateModel::updateLINCOM(const UDAValue& , const UDAValue& , const UDAV
|
||||
}
|
||||
|
||||
|
||||
GuideRateModel::Target GuideRateModel::convert_target(Well2::GuideRateTarget well_target) {
|
||||
if (well_target == Well2::GuideRateTarget::OIL)
|
||||
GuideRateModel::Target GuideRateModel::convert_target(Well::GuideRateTarget well_target) {
|
||||
if (well_target == Well::GuideRateTarget::OIL)
|
||||
return Target::OIL;
|
||||
|
||||
if (well_target == Well2::GuideRateTarget::GAS)
|
||||
if (well_target == Well::GuideRateTarget::GAS)
|
||||
return Target::GAS;
|
||||
|
||||
if (well_target == Well2::GuideRateTarget::LIQ)
|
||||
if (well_target == Well::GuideRateTarget::LIQ)
|
||||
return Target::LIQ;
|
||||
|
||||
if (well_target == Well2::GuideRateTarget::WAT)
|
||||
if (well_target == Well::GuideRateTarget::WAT)
|
||||
return Target::WAT;
|
||||
|
||||
throw std::logic_error("Can not convert this .... ");
|
||||
}
|
||||
|
||||
GuideRateModel::Target GuideRateModel::convert_target(Group2::GuideRateTarget group_target) {
|
||||
if (group_target == Group2::GuideRateTarget::OIL)
|
||||
GuideRateModel::Target GuideRateModel::convert_target(Group::GuideRateTarget group_target) {
|
||||
if (group_target == Group::GuideRateTarget::OIL)
|
||||
return Target::OIL;
|
||||
|
||||
if (group_target == Group2::GuideRateTarget::GAS)
|
||||
if (group_target == Group::GuideRateTarget::GAS)
|
||||
return Target::GAS;
|
||||
|
||||
if (group_target == Group2::GuideRateTarget::LIQ)
|
||||
if (group_target == Group::GuideRateTarget::LIQ)
|
||||
return Target::LIQ;
|
||||
|
||||
if (group_target == Group2::GuideRateTarget::WAT)
|
||||
if (group_target == Group::GuideRateTarget::WAT)
|
||||
return Target::WAT;
|
||||
|
||||
throw std::logic_error("Can not convert this .... ");
|
||||
|
||||
@@ -126,7 +126,7 @@ namespace {
|
||||
guide_rate_config(this->m_timeMap, std::make_shared<GuideRateConfig>()),
|
||||
gconsale(this->m_timeMap, std::make_shared<GConSale>() ),
|
||||
gconsump(this->m_timeMap, std::make_shared<GConSump>() ),
|
||||
global_whistctl_mode(this->m_timeMap, Well2::ProducerCMode::CMODE_UNDEFINED),
|
||||
global_whistctl_mode(this->m_timeMap, Well::ProducerCMode::CMODE_UNDEFINED),
|
||||
m_actions(this->m_timeMap, std::make_shared<Action::Actions>()),
|
||||
rft_config(this->m_timeMap),
|
||||
m_nupcol(this->m_timeMap, ParserKeywords::NUPCOL::NUM_ITER::defaultValue)
|
||||
@@ -484,10 +484,10 @@ namespace {
|
||||
void Schedule::handleWHISTCTL(const DeckKeyword& keyword, std::size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors) {
|
||||
const auto& record = keyword.getRecord(0);
|
||||
const std::string& cmodeString = record.getItem("CMODE").getTrimmedString(0);
|
||||
const auto controlMode = Well2::ProducerCModeFromString( cmodeString );
|
||||
const auto controlMode = Well::ProducerCModeFromString( cmodeString );
|
||||
|
||||
if (controlMode != Well2::ProducerCMode::NONE) {
|
||||
if (!Well2::WellProductionProperties::effectiveHistoryProductionControl(controlMode) ) {
|
||||
if (controlMode != Well::ProducerCMode::NONE) {
|
||||
if (!Well::WellProductionProperties::effectiveHistoryProductionControl(controlMode) ) {
|
||||
std::string msg = "The WHISTCTL keyword specifies an un-supported control mode " + cmodeString
|
||||
+ ", which makes WHISTCTL keyword not affect the simulation at all";
|
||||
OpmLog::warning(msg);
|
||||
@@ -505,8 +505,8 @@ namespace {
|
||||
|
||||
for (auto& well_pair : this->wells_static) {
|
||||
auto& dynamic_state = well_pair.second;
|
||||
auto well2 = std::make_shared<Well2>(*dynamic_state[currentStep]);
|
||||
auto prop = std::make_shared<Well2::WellProductionProperties>(well2->getProductionProperties());
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[currentStep]);
|
||||
auto prop = std::make_shared<Well::WellProductionProperties>(well2->getProductionProperties());
|
||||
|
||||
if (prop->whistctl_cmode != controlMode) {
|
||||
prop->whistctl_cmode = controlMode;
|
||||
@@ -517,8 +517,8 @@ namespace {
|
||||
|
||||
for (auto& well_pair : this->wells_static) {
|
||||
auto& dynamic_state = well_pair.second;
|
||||
auto well2 = std::make_shared<Well2>(*dynamic_state[currentStep]);
|
||||
auto prop = std::make_shared<Well2::WellProductionProperties>(well2->getProductionProperties());
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[currentStep]);
|
||||
auto prop = std::make_shared<Well::WellProductionProperties>(well2->getProductionProperties());
|
||||
|
||||
if (prop->whistctl_cmode != controlMode) {
|
||||
prop->whistctl_cmode = controlMode;
|
||||
@@ -529,8 +529,8 @@ namespace {
|
||||
|
||||
for (auto& well_pair : this->wells_static) {
|
||||
auto& dynamic_state = well_pair.second;
|
||||
auto well2 = std::make_shared<Well2>(*dynamic_state[currentStep]);
|
||||
auto prop = std::make_shared<Well2::WellProductionProperties>(well2->getProductionProperties());
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[currentStep]);
|
||||
auto prop = std::make_shared<Well::WellProductionProperties>(well2->getProductionProperties());
|
||||
|
||||
if (prop->whistctl_cmode != controlMode) {
|
||||
prop->whistctl_cmode = controlMode;
|
||||
@@ -633,7 +633,7 @@ namespace {
|
||||
const auto& compordRecord = compord.getRecord(compordRecordNr);
|
||||
|
||||
const std::string& wellNamePattern = compordRecord.getItem(0).getTrimmedString(0);
|
||||
if (Well2::wellNameInWellNamePattern(wellName, wellNamePattern)) {
|
||||
if (Well::wellNameInWellNamePattern(wellName, wellNamePattern)) {
|
||||
const std::string& compordString = compordRecord.getItem(1).getTrimmedString(0);
|
||||
wellConnectionOrder = Connection::OrderFromString(compordString);
|
||||
}
|
||||
@@ -651,7 +651,7 @@ namespace {
|
||||
: -1.0;
|
||||
{
|
||||
bool update = false;
|
||||
auto well2 = std::shared_ptr<Well2>(new Well2( this->getWell2(wellName, currentStep)));
|
||||
auto well2 = std::shared_ptr<Well>(new Well( this->getWell(wellName, currentStep)));
|
||||
update = well2->updateHead(headI, headJ);
|
||||
update |= well2->updateRefDepth(refDepth);
|
||||
update |= well2->updateDrainageRadius(drainageRadius);
|
||||
@@ -738,7 +738,7 @@ namespace {
|
||||
const std::string& wellNamePattern =
|
||||
record.getItem("WELL").getTrimmedString(0);
|
||||
|
||||
const Well2::Status status = Well2::StatusFromString(record.getItem("STATUS").getTrimmedString(0));
|
||||
const Well::Status status = Well::StatusFromString(record.getItem("STATUS").getTrimmedString(0));
|
||||
|
||||
auto well_names = this->wellNames(wellNamePattern, currentStep);
|
||||
if (well_names.empty())
|
||||
@@ -748,9 +748,9 @@ namespace {
|
||||
updateWellStatus( well_name , currentStep , status );
|
||||
{
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well2 = std::make_shared<Well2>(*dynamic_state[currentStep]);
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[currentStep]);
|
||||
bool switching_from_injector = !well2->isProducer();
|
||||
auto properties = std::make_shared<Well2::WellProductionProperties>(well2->getProductionProperties());
|
||||
auto properties = std::make_shared<Well::WellProductionProperties>(well2->getProductionProperties());
|
||||
bool update_well = false;
|
||||
properties->handleWCONHIST(record);
|
||||
|
||||
@@ -758,7 +758,7 @@ namespace {
|
||||
properties->resetDefaultBHPLimit();
|
||||
well2->updateProducer(true);
|
||||
|
||||
auto inj_props = std::make_shared<Well2::WellInjectionProperties>(well2->getInjectionProperties());
|
||||
auto inj_props = std::make_shared<Well::WellInjectionProperties>(well2->getInjectionProperties());
|
||||
inj_props->setBHPLimit(0);
|
||||
well2->updateInjection(inj_props);
|
||||
}
|
||||
@@ -788,7 +788,7 @@ namespace {
|
||||
"Well " + well2->name() + " is a history matched well with zero rate where crossflow is banned. " +
|
||||
"This well will be closed at " + std::to_string ( m_timeMap.getTimePassedUntil(currentStep) / (60*60*24) ) + " days";
|
||||
OpmLog::note(msg);
|
||||
updateWellStatus( well_name, currentStep, Well2::Status::SHUT );
|
||||
updateWellStatus( well_name, currentStep, Well::Status::SHUT );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -802,7 +802,7 @@ namespace {
|
||||
const std::string& wellNamePattern =
|
||||
record.getItem("WELL").getTrimmedString(0);
|
||||
|
||||
const Well2::Status status = Well2::StatusFromString(record.getItem("STATUS").getTrimmedString(0));
|
||||
const Well::Status status = Well::StatusFromString(record.getItem("STATUS").getTrimmedString(0));
|
||||
auto well_names = this->wellNames(wellNamePattern, currentStep);
|
||||
if (well_names.empty())
|
||||
invalidNamePattern(wellNamePattern, parseContext, errors, keyword);
|
||||
@@ -812,13 +812,13 @@ namespace {
|
||||
updateWellStatus( well_name , currentStep , status );
|
||||
{
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well2 = std::make_shared<Well2>(*dynamic_state[currentStep]);
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[currentStep]);
|
||||
bool switching_from_injector = !well2->isProducer();
|
||||
auto properties = std::make_shared<Well2::WellProductionProperties>(well2->getProductionProperties());
|
||||
auto properties = std::make_shared<Well::WellProductionProperties>(well2->getProductionProperties());
|
||||
bool update_well = switching_from_injector;
|
||||
properties->clearControls();
|
||||
if (well2->isAvailableForGroupControl())
|
||||
properties->addProductionControl(Well2::ProducerCMode::GRUP);
|
||||
properties->addProductionControl(Well::ProducerCMode::GRUP);
|
||||
|
||||
properties->handleWCONPROD(well_name, record);
|
||||
|
||||
@@ -849,7 +849,7 @@ namespace {
|
||||
}
|
||||
|
||||
|
||||
void Schedule::updateWell(std::shared_ptr<Well2> well, size_t reportStep) {
|
||||
void Schedule::updateWell(std::shared_ptr<Well> well, size_t reportStep) {
|
||||
auto& dynamic_state = this->wells_static.at(well->name());
|
||||
dynamic_state.update(reportStep, well);
|
||||
}
|
||||
@@ -857,13 +857,13 @@ namespace {
|
||||
|
||||
/*
|
||||
Function is quite dangerous - because if this is called while holding a
|
||||
Well2 pointer that will go stale and needs to be refreshed.
|
||||
Well pointer that will go stale and needs to be refreshed.
|
||||
*/
|
||||
bool Schedule::updateWellStatus( const std::string& well_name, size_t reportStep , Well2::Status status) {
|
||||
bool Schedule::updateWellStatus( const std::string& well_name, size_t reportStep , Well::Status status) {
|
||||
bool update = false;
|
||||
{
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well2 = std::make_shared<Well2>(*dynamic_state[reportStep]);
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[reportStep]);
|
||||
if (well2->updateStatus(status)) {
|
||||
m_events.addEvent( ScheduleEvents::WELL_STATUS_CHANGE, reportStep );
|
||||
this->addWellEvent( well2->name(), ScheduleEvents::WELL_STATUS_CHANGE, reportStep);
|
||||
@@ -882,7 +882,7 @@ namespace {
|
||||
for (const auto& wname : well_names) {
|
||||
{
|
||||
auto& dynamic_state = this->wells_static.at(wname);
|
||||
auto well_ptr = std::make_shared<Well2>( *dynamic_state[currentStep] );
|
||||
auto well_ptr = std::make_shared<Well>( *dynamic_state[currentStep] );
|
||||
if (well_ptr->handleWPIMULT(record))
|
||||
this->updateWell(well_ptr, currentStep);
|
||||
}
|
||||
@@ -902,13 +902,13 @@ namespace {
|
||||
invalidNamePattern(wellNamePattern, parseContext, errors, keyword);
|
||||
|
||||
for( const auto& well_name : well_names ) {
|
||||
Well2::Status status = Well2::StatusFromString( record.getItem("STATUS").getTrimmedString(0));
|
||||
Well::Status status = Well::StatusFromString( record.getItem("STATUS").getTrimmedString(0));
|
||||
updateWellStatus( well_name , currentStep , status );
|
||||
{
|
||||
bool update_well = false;
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well2 = std::make_shared<Well2>(*dynamic_state[currentStep]);
|
||||
auto injection = std::make_shared<Well2::WellInjectionProperties>(well2->getInjectionProperties());
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[currentStep]);
|
||||
auto injection = std::make_shared<Well::WellInjectionProperties>(well2->getInjectionProperties());
|
||||
injection->handleWCONINJE(record, well2->isAvailableForGroupControl(), well_name);
|
||||
|
||||
if (well2->updateProducer(false))
|
||||
@@ -934,16 +934,16 @@ namespace {
|
||||
"This well will be closed at " + std::to_string ( m_timeMap.getTimePassedUntil(currentStep) / (60*60*24) ) + " days";
|
||||
|
||||
if (injection->surfaceInjectionRate.is<double>()) {
|
||||
if (injection->hasInjectionControl(Well2::InjectorCMode::RATE) && injection->surfaceInjectionRate.get<double>() == 0) {
|
||||
if (injection->hasInjectionControl(Well::InjectorCMode::RATE) && injection->surfaceInjectionRate.get<double>() == 0) {
|
||||
OpmLog::note(msg);
|
||||
updateWellStatus( well_name, currentStep, Well2::Status::SHUT );
|
||||
updateWellStatus( well_name, currentStep, Well::Status::SHUT );
|
||||
}
|
||||
}
|
||||
|
||||
if (injection->reservoirInjectionRate.is<double>()) {
|
||||
if (injection->hasInjectionControl(Well2::InjectorCMode::RESV) && injection->reservoirInjectionRate.get<double>() == 0) {
|
||||
if (injection->hasInjectionControl(Well::InjectorCMode::RESV) && injection->reservoirInjectionRate.get<double>() == 0) {
|
||||
OpmLog::note(msg);
|
||||
updateWellStatus( well_name, currentStep, Well2::Status::SHUT );
|
||||
updateWellStatus( well_name, currentStep, Well::Status::SHUT );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -959,7 +959,7 @@ namespace {
|
||||
void Schedule::handleWCONINJH(const DeckKeyword& keyword, size_t currentStep, const ParseContext& parseContext, ErrorGuard& errors) {
|
||||
for( const auto& record : keyword ) {
|
||||
const std::string& wellNamePattern = record.getItem("WELL").getTrimmedString(0);
|
||||
Well2::Status status = Well2::StatusFromString( record.getItem("STATUS").getTrimmedString(0));
|
||||
Well::Status status = Well::StatusFromString( record.getItem("STATUS").getTrimmedString(0));
|
||||
const auto well_names = wellNames( wellNamePattern, currentStep );
|
||||
|
||||
if (well_names.empty())
|
||||
@@ -970,8 +970,8 @@ namespace {
|
||||
{
|
||||
bool update_well = false;
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well2 = std::make_shared<Well2>(*dynamic_state[currentStep]);
|
||||
auto injection = std::make_shared<Well2::WellInjectionProperties>(well2->getInjectionProperties());
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[currentStep]);
|
||||
auto injection = std::make_shared<Well::WellInjectionProperties>(well2->getInjectionProperties());
|
||||
injection->handleWCONINJH(record, well2->isProducer(), well_name);
|
||||
|
||||
if (well2->updateProducer(false))
|
||||
@@ -994,7 +994,7 @@ namespace {
|
||||
"Well " + well_name + " is an injector with zero rate where crossflow is banned. " +
|
||||
"This well will be closed at " + std::to_string ( m_timeMap.getTimePassedUntil(currentStep) / (60*60*24) ) + " days";
|
||||
OpmLog::note(msg);
|
||||
updateWellStatus( well_name, currentStep, Well2::Status::SHUT );
|
||||
updateWellStatus( well_name, currentStep, Well::Status::SHUT );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1011,7 +1011,7 @@ namespace {
|
||||
|
||||
for (const auto& well_name : well_names) {
|
||||
const auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well2 = std::make_shared<Well2>(*dynamic_state[currentStep]);
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[currentStep]);
|
||||
auto foam_properties = std::make_shared<WellFoamProperties>(well2->getFoamProperties());
|
||||
foam_properties->handleWFOAM(record);
|
||||
if (well2->updateFoamProperties(foam_properties))
|
||||
@@ -1031,7 +1031,7 @@ namespace {
|
||||
for( const auto& well_name : well_names) {
|
||||
{
|
||||
const auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well2 = std::make_shared<Well2>(*dynamic_state[currentStep]);
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[currentStep]);
|
||||
auto polymer_properties = std::make_shared<WellPolymerProperties>( well2->getPolymerProperties() );
|
||||
polymer_properties->handleWPOLYMER(record);
|
||||
if (well2->updatePolymerProperties(polymer_properties))
|
||||
@@ -1055,7 +1055,7 @@ namespace {
|
||||
for (const auto& well_name : well_names) {
|
||||
{
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well2 = std::make_shared<Well2>(*dynamic_state[currentStep]);
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[currentStep]);
|
||||
auto polymer_properties = std::make_shared<WellPolymerProperties>( well2->getPolymerProperties() );
|
||||
polymer_properties->handleWPMITAB(record);
|
||||
if (well2->updatePolymerProperties(polymer_properties))
|
||||
@@ -1079,7 +1079,7 @@ namespace {
|
||||
for (const auto& well_name : well_names) {
|
||||
{
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well2 = std::make_shared<Well2>(*dynamic_state[currentStep]);
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[currentStep]);
|
||||
auto polymer_properties = std::make_shared<WellPolymerProperties>( well2->getPolymerProperties() );
|
||||
polymer_properties->handleWSKPTAB(record);
|
||||
if (well2->updatePolymerProperties(polymer_properties))
|
||||
@@ -1101,7 +1101,7 @@ namespace {
|
||||
for(const auto& well_name : well_names) {
|
||||
{
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well2 = std::make_shared<Well2>(*dynamic_state[currentStep]);
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[currentStep]);
|
||||
auto econ_limits = std::make_shared<WellEconProductionLimits>( record );
|
||||
if (well2->updateEconLimits(econ_limits))
|
||||
this->updateWell(well2, currentStep);
|
||||
@@ -1122,7 +1122,7 @@ namespace {
|
||||
for(const auto& well_name : well_names) {
|
||||
{
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well2 = std::make_shared<Well2>(*dynamic_state[currentStep]);
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[currentStep]);
|
||||
if (well2->updateEfficiencyFactor(efficiencyFactor))
|
||||
this->updateWell(well2, currentStep);
|
||||
}
|
||||
@@ -1221,11 +1221,11 @@ namespace {
|
||||
|
||||
for(const auto& well_name : well_names) {
|
||||
{
|
||||
const auto& well = this->getWell2(well_name, currentStep);
|
||||
const auto& well = this->getWell(well_name, currentStep);
|
||||
const auto& inj = well.getInjectionProperties();
|
||||
if (!well.isProducer() && inj.injectorType == Well2::InjectorType::GAS) {
|
||||
if (!well.isProducer() && inj.injectorType == Well::InjectorType::GAS) {
|
||||
if (well.getSolventFraction() != fraction) {
|
||||
auto new_well = std::make_shared<Well2>(well);
|
||||
auto new_well = std::make_shared<Well>(well);
|
||||
new_well->updateSolventFraction(fraction);
|
||||
this->updateWell(new_well, currentStep);
|
||||
}
|
||||
@@ -1249,7 +1249,7 @@ namespace {
|
||||
double tracerConcentration = record.getItem("CONCENTRATION").get< UDAValue >(0).get<double>();
|
||||
const std::string& tracerName = record.getItem("TRACER").getTrimmedString(0);
|
||||
{
|
||||
auto well = std::make_shared<Well2>( this->getWell2(well_name, currentStep));
|
||||
auto well = std::make_shared<Well>( this->getWell(well_name, currentStep));
|
||||
auto wellTracerProperties = std::make_shared<WellTracerProperties>( well->getTracerProperties() );
|
||||
wellTracerProperties->setConcentration(tracerName, tracerConcentration);
|
||||
if (well->updateTracer(wellTracerProperties))
|
||||
@@ -1275,12 +1275,12 @@ namespace {
|
||||
// to a very weird segmentation fault downstream. For now, let's take the
|
||||
// water route.
|
||||
{
|
||||
const auto& well = this->getWell2(well_name, currentStep);
|
||||
const auto& well = this->getWell(well_name, currentStep);
|
||||
double current_temp = well.getInjectionProperties().temperature;
|
||||
if (current_temp != temp && !well.isProducer()) {
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well_ptr = std::make_shared<Well2>( *dynamic_state[currentStep] );
|
||||
auto inj = std::make_shared<Well2::WellInjectionProperties>(well_ptr->getInjectionProperties());
|
||||
auto well_ptr = std::make_shared<Well>( *dynamic_state[currentStep] );
|
||||
auto inj = std::make_shared<Well::WellInjectionProperties>(well_ptr->getInjectionProperties());
|
||||
inj->temperature = temp;
|
||||
well_ptr->updateInjection(inj);
|
||||
this->updateWell(well_ptr, currentStep);
|
||||
@@ -1309,12 +1309,12 @@ namespace {
|
||||
// to a very weird segmentation fault downstream. For now, let's take the
|
||||
// water route.
|
||||
{
|
||||
const auto& well = this->getWell2(well_name, currentStep);
|
||||
const auto& well = this->getWell(well_name, currentStep);
|
||||
double current_temp = well.getInjectionProperties().temperature;
|
||||
if (current_temp != temp && !well.isProducer()) {
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well_ptr = std::make_shared<Well2>( *dynamic_state[currentStep] );
|
||||
auto inj = std::make_shared<Well2::WellInjectionProperties>(well_ptr->getInjectionProperties());
|
||||
auto well_ptr = std::make_shared<Well>( *dynamic_state[currentStep] );
|
||||
auto inj = std::make_shared<Well::WellInjectionProperties>(well_ptr->getInjectionProperties());
|
||||
inj->temperature = temp;
|
||||
well_ptr->updateInjection(inj);
|
||||
this->updateWell(well_ptr, currentStep);
|
||||
@@ -1333,7 +1333,7 @@ namespace {
|
||||
for (const auto& wname : well_names) {
|
||||
{
|
||||
auto& dynamic_state = this->wells_static.at(wname);
|
||||
auto well_ptr = std::make_shared<Well2>( *dynamic_state[timestep] );
|
||||
auto well_ptr = std::make_shared<Well>( *dynamic_state[timestep] );
|
||||
if (well_ptr->handleCOMPLUMP(record))
|
||||
this->updateWell(well_ptr, timestep);
|
||||
}
|
||||
@@ -1351,7 +1351,7 @@ namespace {
|
||||
return std::all_of( rec.begin() + 2, rec.end(), defaulted );
|
||||
};
|
||||
|
||||
constexpr auto open = Well2::Status::OPEN;
|
||||
constexpr auto open = Well::Status::OPEN;
|
||||
|
||||
for( const auto& record : keyword ) {
|
||||
const auto& wellNamePattern = record.getItem( "WELL" ).getTrimmedString(0);
|
||||
@@ -1364,10 +1364,10 @@ namespace {
|
||||
* well status is updated
|
||||
*/
|
||||
if( conn_defaulted( record ) ) {
|
||||
const auto well_status = Well2::StatusFromString( status_str );
|
||||
const auto well_status = Well::StatusFromString( status_str );
|
||||
for (const auto& wname : well_names) {
|
||||
{
|
||||
const auto& well = this->getWell2(wname, currentStep);
|
||||
const auto& well = this->getWell(wname, currentStep);
|
||||
if( well_status == open && !well.canOpen() ) {
|
||||
auto days = m_timeMap.getTimePassedUntil( currentStep ) / (60 * 60 * 24);
|
||||
std::string msg = "Well " + wname
|
||||
@@ -1390,7 +1390,7 @@ namespace {
|
||||
const auto comp_status = Connection::StateFromString( status_str );
|
||||
{
|
||||
auto& dynamic_state = this->wells_static.at(wname);
|
||||
auto well_ptr = std::make_shared<Well2>( *dynamic_state[currentStep] );
|
||||
auto well_ptr = std::make_shared<Well>( *dynamic_state[currentStep] );
|
||||
if (well_ptr->handleWELOPEN(record, comp_status))
|
||||
// The updateWell call breaks test at line 825 and 831 in ScheduleTests
|
||||
this->updateWell(well_ptr, currentStep);
|
||||
@@ -1424,7 +1424,7 @@ namespace {
|
||||
for( const auto& record : keyword ) {
|
||||
|
||||
const std::string& wellNamePattern = record.getItem("WELL").getTrimmedString(0);
|
||||
const auto cmode = Well2::WELTARGCModeFromString(record.getItem("CMODE").getTrimmedString(0));
|
||||
const auto cmode = Well::WELTARGCModeFromString(record.getItem("CMODE").getTrimmedString(0));
|
||||
double newValue = record.getItem("NEW_VALUE").get< double >(0);
|
||||
|
||||
const auto well_names = wellNames( wellNamePattern, currentStep );
|
||||
@@ -1435,19 +1435,19 @@ namespace {
|
||||
for(const auto& well_name : well_names) {
|
||||
{
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well2 = std::make_shared<Well2>(*dynamic_state[currentStep]);
|
||||
auto well2 = std::make_shared<Well>(*dynamic_state[currentStep]);
|
||||
bool update = false;
|
||||
if (well2->isProducer()) {
|
||||
auto prop = std::make_shared<Well2::WellProductionProperties>(well2->getProductionProperties());
|
||||
auto prop = std::make_shared<Well::WellProductionProperties>(well2->getProductionProperties());
|
||||
prop->handleWELTARG(cmode, newValue, siFactorG, siFactorL, siFactorP);
|
||||
update = well2->updateProduction(prop);
|
||||
if (cmode == Well2::WELTARGCMode::GUID)
|
||||
if (cmode == Well::WELTARGCMode::GUID)
|
||||
update |= well2->updateWellGuideRate(newValue);
|
||||
} else {
|
||||
auto inj = std::make_shared<Well2::WellInjectionProperties>(well2->getInjectionProperties());
|
||||
auto inj = std::make_shared<Well::WellInjectionProperties>(well2->getInjectionProperties());
|
||||
inj->handleWELTARG(cmode, newValue, siFactorG, siFactorL, siFactorP);
|
||||
update = well2->updateInjection(inj);
|
||||
if (cmode == Well2::WELTARGCMode::GUID)
|
||||
if (cmode == Well::WELTARGCMode::GUID)
|
||||
update |= well2->updateWellGuideRate(newValue);
|
||||
}
|
||||
if (update)
|
||||
@@ -1466,7 +1466,7 @@ namespace {
|
||||
invalidNamePattern(groupNamePattern, parseContext, errors, keyword);
|
||||
|
||||
for (const auto& group_name : group_names){
|
||||
Group2::InjectionCMode controlMode = Group2::InjectionCModeFromString( record.getItem("CONTROL_MODE").getTrimmedString(0) );
|
||||
Group::InjectionCMode controlMode = Group::InjectionCModeFromString( record.getItem("CONTROL_MODE").getTrimmedString(0) );
|
||||
Phase phase = get_phase( record.getItem("PHASE").getTrimmedString(0));
|
||||
auto surfaceInjectionRate = record.getItem("SURFACE_TARGET").get< UDAValue >(0);
|
||||
auto reservoirInjectionRate = record.getItem("RESV_TARGET").get<UDAValue>(0);
|
||||
@@ -1482,8 +1482,8 @@ namespace {
|
||||
|
||||
//surfaceInjectionRate = injection::rateToSI(surfaceInjectionRate, phase, section.unitSystem());
|
||||
{
|
||||
auto group_ptr = std::make_shared<Group2>(this->getGroup2(group_name, currentStep));
|
||||
Group2::GroupInjectionProperties injection;
|
||||
auto group_ptr = std::make_shared<Group>(this->getGroup(group_name, currentStep));
|
||||
Group::GroupInjectionProperties injection;
|
||||
injection.phase = phase;
|
||||
injection.cmode = controlMode;
|
||||
injection.surface_max_rate = surfaceInjectionRate;
|
||||
@@ -1495,16 +1495,16 @@ namespace {
|
||||
injection.voidage_group = voidage_group;
|
||||
|
||||
if (!record.getItem("SURFACE_TARGET").defaultApplied(0))
|
||||
injection.injection_controls += static_cast<int>(Group2::InjectionCMode::RATE);
|
||||
injection.injection_controls += static_cast<int>(Group::InjectionCMode::RATE);
|
||||
|
||||
if (!record.getItem("RESV_TARGET").defaultApplied(0))
|
||||
injection.injection_controls += static_cast<int>(Group2::InjectionCMode::RESV);
|
||||
injection.injection_controls += static_cast<int>(Group::InjectionCMode::RESV);
|
||||
|
||||
if (!record.getItem("REINJ_TARGET").defaultApplied(0))
|
||||
injection.injection_controls += static_cast<int>(Group2::InjectionCMode::REIN);
|
||||
injection.injection_controls += static_cast<int>(Group::InjectionCMode::REIN);
|
||||
|
||||
if (!record.getItem("VOIDAGE_TARGET").defaultApplied(0))
|
||||
injection.injection_controls += static_cast<int>(Group2::InjectionCMode::VREP);
|
||||
injection.injection_controls += static_cast<int>(Group::InjectionCMode::VREP);
|
||||
|
||||
if (group_ptr->updateInjection(injection))
|
||||
this->updateGroup(std::move(group_ptr), currentStep);
|
||||
@@ -1523,18 +1523,18 @@ namespace {
|
||||
invalidNamePattern(groupNamePattern, parseContext, errors, keyword);
|
||||
|
||||
for (const auto& group_name : group_names){
|
||||
Group2::ProductionCMode controlMode = Group2::ProductionCModeFromString( record.getItem("CONTROL_MODE").getTrimmedString(0) );
|
||||
Group2::ExceedAction exceedAction = Group2::ExceedActionFromString(record.getItem("EXCEED_PROC").getTrimmedString(0) );
|
||||
Group::ProductionCMode controlMode = Group::ProductionCModeFromString( record.getItem("CONTROL_MODE").getTrimmedString(0) );
|
||||
Group::ExceedAction exceedAction = Group::ExceedActionFromString(record.getItem("EXCEED_PROC").getTrimmedString(0) );
|
||||
auto oil_target = record.getItem("OIL_TARGET").get<UDAValue>(0);
|
||||
auto gas_target = record.getItem("GAS_TARGET").get<UDAValue>(0);
|
||||
auto water_target = record.getItem("WATER_TARGET").get<UDAValue>(0);
|
||||
auto liquid_target = record.getItem("LIQUID_TARGET").get<UDAValue>(0);
|
||||
auto guide_rate_def = Group2::GuideRateTarget::NO_GUIDE_RATE;
|
||||
auto guide_rate_def = Group::GuideRateTarget::NO_GUIDE_RATE;
|
||||
double guide_rate = 0;
|
||||
if (group_name != "FIELD") {
|
||||
if (record.getItem("GUIDE_RATE_DEF").hasValue(0)) {
|
||||
std::string guide_rate_str = record.getItem("GUIDE_RATE_DEF").getTrimmedString(0);
|
||||
guide_rate_def = Group2::GuideRateTargetFromString( guide_rate_str );
|
||||
guide_rate_def = Group::GuideRateTargetFromString( guide_rate_str );
|
||||
|
||||
if ((guide_rate_str == "INJ" || guide_rate_str == "POTN" || guide_rate_str == "FORM")) {
|
||||
std::string msg = "The supplied guide_rate value will be ignored";
|
||||
@@ -1543,14 +1543,14 @@ namespace {
|
||||
else {
|
||||
guide_rate = record.getItem("GUIDE_RATE").get<double>(0);
|
||||
if (guide_rate == 0)
|
||||
guide_rate_def = Group2::GuideRateTarget::POTN;
|
||||
guide_rate_def = Group::GuideRateTarget::POTN;
|
||||
}
|
||||
}
|
||||
}
|
||||
auto resv_target = record.getItem("RESERVOIR_FLUID_TARGET").getSIDouble(0);
|
||||
{
|
||||
auto group_ptr = std::make_shared<Group2>(this->getGroup2(group_name, currentStep));
|
||||
Group2::GroupProductionProperties production;
|
||||
auto group_ptr = std::make_shared<Group>(this->getGroup(group_name, currentStep));
|
||||
Group::GroupProductionProperties production;
|
||||
production.cmode = controlMode;
|
||||
production.oil_target = oil_target;
|
||||
production.gas_target = gas_target;
|
||||
@@ -1559,30 +1559,30 @@ namespace {
|
||||
production.guide_rate = guide_rate;
|
||||
production.guide_rate_def = guide_rate_def;
|
||||
production.resv_target = resv_target;
|
||||
if ((production.cmode == Group2::ProductionCMode::ORAT) ||
|
||||
(production.cmode == Group2::ProductionCMode::WRAT) ||
|
||||
(production.cmode == Group2::ProductionCMode::GRAT) ||
|
||||
(production.cmode == Group2::ProductionCMode::LRAT))
|
||||
production.exceed_action = Group2::ExceedAction::RATE;
|
||||
if ((production.cmode == Group::ProductionCMode::ORAT) ||
|
||||
(production.cmode == Group::ProductionCMode::WRAT) ||
|
||||
(production.cmode == Group::ProductionCMode::GRAT) ||
|
||||
(production.cmode == Group::ProductionCMode::LRAT))
|
||||
production.exceed_action = Group::ExceedAction::RATE;
|
||||
else
|
||||
production.exceed_action = exceedAction;
|
||||
|
||||
production.production_controls = 0;
|
||||
|
||||
if (!record.getItem("OIL_TARGET").defaultApplied(0))
|
||||
production.production_controls += static_cast<int>(Group2::ProductionCMode::ORAT);
|
||||
production.production_controls += static_cast<int>(Group::ProductionCMode::ORAT);
|
||||
|
||||
if (!record.getItem("GAS_TARGET").defaultApplied(0))
|
||||
production.production_controls += static_cast<int>(Group2::ProductionCMode::GRAT);
|
||||
production.production_controls += static_cast<int>(Group::ProductionCMode::GRAT);
|
||||
|
||||
if (!record.getItem("WATER_TARGET").defaultApplied(0))
|
||||
production.production_controls += static_cast<int>(Group2::ProductionCMode::WRAT);
|
||||
production.production_controls += static_cast<int>(Group::ProductionCMode::WRAT);
|
||||
|
||||
if (!record.getItem("LIQUID_TARGET").defaultApplied(0))
|
||||
production.production_controls += static_cast<int>(Group2::ProductionCMode::LRAT);
|
||||
production.production_controls += static_cast<int>(Group::ProductionCMode::LRAT);
|
||||
|
||||
if (!record.getItem("RESERVOIR_FLUID_TARGET").defaultApplied(0))
|
||||
production.production_controls += static_cast<int>(Group2::ProductionCMode::RESV);
|
||||
production.production_controls += static_cast<int>(Group::ProductionCMode::RESV);
|
||||
|
||||
if (group_ptr->updateProduction(production)) {
|
||||
auto new_config = std::make_shared<GuideRateConfig>( this->guideRateConfig(currentStep) );
|
||||
@@ -1609,7 +1609,7 @@ namespace {
|
||||
bool transfer = DeckItem::to_bool(record.getItem("TRANSFER_EXT_NET").getTrimmedString(0));
|
||||
auto gefac = record.getItem("EFFICIENCY_FACTOR").get< double >(0);
|
||||
{
|
||||
auto group_ptr = std::make_shared<Group2>(this->getGroup2(group_name, currentStep));
|
||||
auto group_ptr = std::make_shared<Group>(this->getGroup(group_name, currentStep));
|
||||
if (group_ptr->update_gefac(gefac, transfer))
|
||||
this->updateGroup(std::move(group_ptr), currentStep);
|
||||
}
|
||||
@@ -1856,7 +1856,7 @@ namespace {
|
||||
|
||||
for (const auto& name : wellnames) {
|
||||
{
|
||||
auto well2 = std::shared_ptr<Well2>(new Well2( this->getWell2(name, currentStep)));
|
||||
auto well2 = std::shared_ptr<Well>(new Well( this->getWell(name, currentStep)));
|
||||
auto connections = std::shared_ptr<WellConnections>( new WellConnections( well2->getConnections()));
|
||||
connections->loadCOMPDAT(record, grid, eclipseProperties);
|
||||
|
||||
@@ -1878,7 +1878,7 @@ namespace {
|
||||
printf("Running all_shut inner loop\n");
|
||||
if (this->updateWellStatus(well2->name(), currentStep, WellCommon::StatusEnum::OPEN))
|
||||
// Refresh pointer if the status has updated current slot. Ugly
|
||||
well2 = std::shared_ptr<Well2>(new Well2(this->getWell2(name, currentStep)));
|
||||
well2 = std::shared_ptr<Well>(new Well(this->getWell(name, currentStep)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1886,7 +1886,7 @@ namespace {
|
||||
if (well2->updateConnections(connections))
|
||||
this->updateWell(well2, currentStep);
|
||||
|
||||
if (well2->getStatus() == Well2::Status::SHUT) {
|
||||
if (well2->getStatus() == Well::Status::SHUT) {
|
||||
std::string msg =
|
||||
"All completions in well " + well2->name() + " is shut at " + std::to_string ( m_timeMap.getTimePassedUntil(currentStep) / (60*60*24) ) + " days. \n" +
|
||||
"The well is therefore also shut.";
|
||||
@@ -1910,7 +1910,7 @@ namespace {
|
||||
const auto& wname = record1.getItem("WELL").getTrimmedString(0);
|
||||
{
|
||||
auto& dynamic_state = this->wells_static.at(wname);
|
||||
auto well_ptr = std::make_shared<Well2>( *dynamic_state[currentStep] );
|
||||
auto well_ptr = std::make_shared<Well>( *dynamic_state[currentStep] );
|
||||
if (well_ptr->handleWELSEGS(keyword))
|
||||
this->updateWell(well_ptr, currentStep);
|
||||
}
|
||||
@@ -1922,7 +1922,7 @@ namespace {
|
||||
const std::string& well_name = record1.getItem("WELL").getTrimmedString(0);
|
||||
{
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well_ptr = std::make_shared<Well2>( *dynamic_state[currentStep] );
|
||||
auto well_ptr = std::make_shared<Well>( *dynamic_state[currentStep] );
|
||||
if (well_ptr->handleCOMPSEGS(keyword, grid, parseContext, errors))
|
||||
this->updateWell(well_ptr, currentStep);
|
||||
}
|
||||
@@ -1935,15 +1935,15 @@ namespace {
|
||||
bool availableForGroupControl = DeckItem::to_bool(record.getItem("GROUP_CONTROLLED").getTrimmedString(0));
|
||||
double guide_rate = record.getItem("GUIDE_RATE").get< double >(0);
|
||||
double scaling_factor = record.getItem("SCALING_FACTOR").get< double >(0);
|
||||
auto phase = Well2::GuideRateTarget::UNDEFINED;
|
||||
auto phase = Well::GuideRateTarget::UNDEFINED;
|
||||
if (!record.getItem("PHASE").defaultApplied(0)) {
|
||||
std::string guideRatePhase = record.getItem("PHASE").getTrimmedString(0);
|
||||
phase = Well2::GuideRateTargetFromString(guideRatePhase);
|
||||
phase = Well::GuideRateTargetFromString(guideRatePhase);
|
||||
}
|
||||
|
||||
{
|
||||
auto& dynamic_state = this->wells_static.at(well_name);
|
||||
auto well_ptr = std::make_shared<Well2>( *dynamic_state[currentStep] );
|
||||
auto well_ptr = std::make_shared<Well>( *dynamic_state[currentStep] );
|
||||
if (well_ptr->updateWellGuideRate(availableForGroupControl, guide_rate, phase, scaling_factor)) {
|
||||
this->updateWell(well_ptr, currentStep);
|
||||
|
||||
@@ -1981,7 +1981,7 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
|
||||
|
||||
int table = record.getItem("VFP_TABLE").get< int >(0);
|
||||
{
|
||||
auto group_ptr = std::make_shared<Group2>( this->getGroup2(groupName, currentStep) );
|
||||
auto group_ptr = std::make_shared<Group>( this->getGroup(groupName, currentStep) );
|
||||
if (group_ptr->updateNetVFPTable(table))
|
||||
this->updateGroup(std::move(group_ptr), currentStep);
|
||||
}
|
||||
@@ -2037,11 +2037,11 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
|
||||
|
||||
|
||||
GTNode Schedule::groupTree(const std::string& root_node, std::size_t report_step, const GTNode * parent) const {
|
||||
auto root_group = this->getGroup2(root_node, report_step);
|
||||
auto root_group = this->getGroup(root_node, report_step);
|
||||
GTNode tree(root_group, parent);
|
||||
|
||||
for (const auto& wname : root_group.wells()) {
|
||||
const auto& well = this->getWell2(wname, report_step);
|
||||
const auto& well = this->getWell(wname, report_step);
|
||||
tree.add_well(well);
|
||||
}
|
||||
|
||||
@@ -2105,12 +2105,12 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
|
||||
automaticShutIn = false;
|
||||
}
|
||||
{
|
||||
wells_static.insert( std::make_pair(wellName, DynamicState<std::shared_ptr<Well2>>(m_timeMap, nullptr)));
|
||||
wells_static.insert( std::make_pair(wellName, DynamicState<std::shared_ptr<Well>>(m_timeMap, nullptr)));
|
||||
|
||||
auto& dynamic_state = wells_static.at(wellName);
|
||||
const std::string& group = record.getItem<ParserKeywords::WELSPECS::GROUP>().getTrimmedString(0);
|
||||
std::size_t insert_index = this->wells_static.size() - 1;
|
||||
auto well_ptr = std::make_shared<Well2>(wellName,
|
||||
auto well_ptr = std::make_shared<Well>(wellName,
|
||||
group,
|
||||
timeStep,
|
||||
insert_index,
|
||||
@@ -2150,34 +2150,34 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
|
||||
if (this->wells_static.count(wellName) == 0)
|
||||
return false;
|
||||
|
||||
const auto& well = this->getWell2atEnd(wellName);
|
||||
const auto& well = this->getWellatEnd(wellName);
|
||||
return well.hasBeenDefined(timeStep);
|
||||
}
|
||||
|
||||
std::vector< const Group2* > Schedule::getChildGroups2(const std::string& group_name, size_t timeStep) const {
|
||||
std::vector< const Group* > Schedule::getChildGroups2(const std::string& group_name, size_t timeStep) const {
|
||||
if (!hasGroup(group_name))
|
||||
throw std::invalid_argument("No such group: '" + group_name + "'");
|
||||
{
|
||||
const auto& group = getGroup2( group_name, timeStep );
|
||||
std::vector<const Group2*> child_groups;
|
||||
const auto& group = getGroup( group_name, timeStep );
|
||||
std::vector<const Group*> child_groups;
|
||||
|
||||
if (group.defined( timeStep )) {
|
||||
for (const auto& child_name : group.groups())
|
||||
child_groups.push_back( std::addressof(this->getGroup2(child_name, timeStep)));
|
||||
child_groups.push_back( std::addressof(this->getGroup(child_name, timeStep)));
|
||||
}
|
||||
return child_groups;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::vector< Well2 > Schedule::getChildWells2(const std::string& group_name, size_t timeStep) const {
|
||||
std::vector< Well > Schedule::getChildWells2(const std::string& group_name, size_t timeStep) const {
|
||||
if (!hasGroup(group_name))
|
||||
throw std::invalid_argument("No such group: '" + group_name + "'");
|
||||
{
|
||||
const auto& dynamic_state = this->groups.at(group_name);
|
||||
const auto& group_ptr = dynamic_state.get(timeStep);
|
||||
if (group_ptr) {
|
||||
std::vector<Well2> wells;
|
||||
std::vector<Well> wells;
|
||||
|
||||
if (group_ptr->groups().size()) {
|
||||
for (const auto& child_name : group_ptr->groups()) {
|
||||
@@ -2186,7 +2186,7 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
|
||||
}
|
||||
} else {
|
||||
for (const auto& well_name : group_ptr->wells( ))
|
||||
wells.push_back( this->getWell2( well_name, timeStep ));
|
||||
wells.push_back( this->getWell( well_name, timeStep ));
|
||||
}
|
||||
|
||||
return wells;
|
||||
@@ -2197,8 +2197,8 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
|
||||
|
||||
|
||||
|
||||
std::vector<Well2> Schedule::getWells2(size_t timeStep) const {
|
||||
std::vector<Well2> wells;
|
||||
std::vector<Well> Schedule::getWells(size_t timeStep) const {
|
||||
std::vector<Well> wells;
|
||||
if (timeStep >= this->m_timeMap.size())
|
||||
throw std::invalid_argument("timeStep argument beyond the length of the simulation");
|
||||
|
||||
@@ -2210,16 +2210,16 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
|
||||
return wells;
|
||||
}
|
||||
|
||||
std::vector<Well2> Schedule::getWells2atEnd() const {
|
||||
return this->getWells2(this->m_timeMap.size() - 1);
|
||||
std::vector<Well> Schedule::getWellsatEnd() const {
|
||||
return this->getWells(this->m_timeMap.size() - 1);
|
||||
}
|
||||
|
||||
|
||||
const Well2& Schedule::getWell2atEnd(const std::string& well_name) const {
|
||||
return this->getWell2(well_name, this->m_timeMap.size() - 1);
|
||||
const Well& Schedule::getWellatEnd(const std::string& well_name) const {
|
||||
return this->getWell(well_name, this->m_timeMap.size() - 1);
|
||||
}
|
||||
|
||||
const Well2& Schedule::getWell2(const std::string& wellName, size_t timeStep) const {
|
||||
const Well& Schedule::getWell(const std::string& wellName, size_t timeStep) const {
|
||||
if (this->wells_static.count(wellName) == 0)
|
||||
throw std::invalid_argument("No such well: " + wellName);
|
||||
|
||||
@@ -2231,7 +2231,7 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
|
||||
return *well_ptr;
|
||||
}
|
||||
|
||||
const Group2& Schedule::getGroup2(const std::string& groupName, size_t timeStep) const {
|
||||
const Group& Schedule::getGroup(const std::string& groupName, size_t timeStep) const {
|
||||
if (this->groups.count(groupName) == 0)
|
||||
throw std::invalid_argument("No such group: '" + groupName + "'");
|
||||
|
||||
@@ -2243,7 +2243,7 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
|
||||
return *group_ptr;
|
||||
}
|
||||
|
||||
void Schedule::updateGroup(std::shared_ptr<Group2> group, size_t reportStep) {
|
||||
void Schedule::updateGroup(std::shared_ptr<Group> group, size_t reportStep) {
|
||||
auto& dynamic_state = this->groups.at(group->name());
|
||||
dynamic_state.update(reportStep, std::move(group));
|
||||
}
|
||||
@@ -2403,8 +2403,8 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
|
||||
void Schedule::addGroup(const std::string& groupName, size_t timeStep, const UnitSystem& unit_system) {
|
||||
const size_t gseqIndex = this->groups.size();
|
||||
|
||||
groups.insert( std::make_pair( groupName, DynamicState<std::shared_ptr<Group2>>(this->m_timeMap, nullptr)));
|
||||
auto group_ptr = std::make_shared<Group2>(groupName, gseqIndex, timeStep, this->getUDQConfig(timeStep).params().undefinedValue(), unit_system);
|
||||
groups.insert( std::make_pair( groupName, DynamicState<std::shared_ptr<Group>>(this->m_timeMap, nullptr)));
|
||||
auto group_ptr = std::make_shared<Group>(groupName, gseqIndex, timeStep, this->getUDQConfig(timeStep).params().undefinedValue(), unit_system);
|
||||
auto& dynamic_state = this->groups.at(groupName);
|
||||
dynamic_state.update(timeStep, group_ptr);
|
||||
|
||||
@@ -2439,20 +2439,20 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
|
||||
&& grpMap->second.at(timeStep);
|
||||
}
|
||||
|
||||
void Schedule::addGroupToGroup( const std::string& parent_group, const Group2& child_group, size_t timeStep) {
|
||||
void Schedule::addGroupToGroup( const std::string& parent_group, const Group& child_group, size_t timeStep) {
|
||||
// Add to new parent
|
||||
auto& dynamic_state = this->groups.at(parent_group);
|
||||
auto parent_ptr = std::make_shared<Group2>( *dynamic_state[timeStep] );
|
||||
auto parent_ptr = std::make_shared<Group>( *dynamic_state[timeStep] );
|
||||
if (parent_ptr->addGroup(child_group.name()))
|
||||
this->updateGroup(std::move(parent_ptr), timeStep);
|
||||
|
||||
// Check and update backreference in child
|
||||
if (child_group.parent() != parent_group) {
|
||||
auto old_parent = std::make_shared<Group2>( this->getGroup2(child_group.parent(), timeStep) );
|
||||
auto old_parent = std::make_shared<Group>( this->getGroup(child_group.parent(), timeStep) );
|
||||
old_parent->delGroup(child_group.name());
|
||||
this->updateGroup(std::move(old_parent), timeStep);
|
||||
|
||||
auto child_ptr = std::make_shared<Group2>( child_group );
|
||||
auto child_ptr = std::make_shared<Group>( child_group );
|
||||
child_ptr->updateParent(parent_group);
|
||||
this->updateGroup(std::move(child_ptr), timeStep);
|
||||
|
||||
@@ -2460,26 +2460,26 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
|
||||
}
|
||||
|
||||
void Schedule::addGroupToGroup( const std::string& parent_group, const std::string& child_group, size_t timeStep) {
|
||||
this->addGroupToGroup(parent_group, this->getGroup2(child_group, timeStep), timeStep);
|
||||
this->addGroupToGroup(parent_group, this->getGroup(child_group, timeStep), timeStep);
|
||||
}
|
||||
|
||||
void Schedule::addWellToGroup( const std::string& group_name, const std::string& well_name , size_t timeStep) {
|
||||
const auto& well = this->getWell2(well_name, timeStep);
|
||||
const auto& well = this->getWell(well_name, timeStep);
|
||||
const auto old_gname = well.groupName();
|
||||
if (old_gname != group_name) {
|
||||
auto well_ptr = std::make_shared<Well2>( well );
|
||||
auto well_ptr = std::make_shared<Well>( well );
|
||||
well_ptr->updateGroup(group_name);
|
||||
this->updateWell(well_ptr, timeStep);
|
||||
this->addWellEvent(well_ptr->name(), ScheduleEvents::WELL_WELSPECS_UPDATE, timeStep);
|
||||
|
||||
// Remove well child reference from previous group
|
||||
auto group = std::make_shared<Group2>(this->getGroup2(old_gname, timeStep));
|
||||
auto group = std::make_shared<Group>(this->getGroup(old_gname, timeStep));
|
||||
group->delWell(well_name);
|
||||
this->updateGroup(std::move(group), timeStep);
|
||||
}
|
||||
|
||||
// Add well child reference to new group
|
||||
auto group_ptr = std::make_shared<Group2>(this->getGroup2(group_name, timeStep));
|
||||
auto group_ptr = std::make_shared<Group>(this->getGroup(group_name, timeStep));
|
||||
group_ptr->addWell(well_name);
|
||||
this->updateGroup(group_ptr, timeStep);
|
||||
this->m_events.addEvent( ScheduleEvents::GROUP_CHANGE , timeStep);
|
||||
@@ -2535,10 +2535,10 @@ void Schedule::handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep, c
|
||||
void Schedule::checkIfAllConnectionsIsShut(size_t timeStep) {
|
||||
const auto& well_names = this->wellNames(timeStep);
|
||||
for (const auto& wname : well_names) {
|
||||
const auto& well = this->getWell2(wname, timeStep);
|
||||
const auto& well = this->getWell(wname, timeStep);
|
||||
const auto& connections = well.getConnections();
|
||||
if (connections.allConnectionsShut())
|
||||
this->updateWellStatus( well.name(), timeStep, Well2::Status::SHUT);
|
||||
this->updateWellStatus( well.name(), timeStep, Well::Status::SHUT);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
#include <opm/parser/eclipse/Deck/DeckKeyword.hpp>
|
||||
#include <opm/parser/eclipse/Parser/ParserKeywords/W.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/MSW/updatingConnectionsWithSegments.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellProductionProperties.hpp>
|
||||
@@ -74,7 +74,7 @@ namespace {
|
||||
}
|
||||
|
||||
|
||||
Well2::Well2(const std::string& wname_arg,
|
||||
Well::Well(const std::string& wname_arg,
|
||||
const std::string& gname,
|
||||
std::size_t init_step_arg,
|
||||
std::size_t insert_index_arg,
|
||||
@@ -102,7 +102,7 @@ Well2::Well2(const std::string& wname_arg,
|
||||
allow_cross_flow(DeckItem::to_bool(ParserKeywords::WELSPECS::CROSSFLOW::defaultValue)),
|
||||
automatic_shutin( ParserKeywords::WELSPECS::CROSSFLOW::defaultValue == "SHUT"),
|
||||
producer(true),
|
||||
guide_rate({true, -1, Well2::GuideRateTarget::UNDEFINED,ParserKeywords::WGRUPCON::SCALING_FACTOR::defaultValue}),
|
||||
guide_rate({true, -1, Well::GuideRateTarget::UNDEFINED,ParserKeywords::WGRUPCON::SCALING_FACTOR::defaultValue}),
|
||||
efficiency_factor(1.0),
|
||||
solvent_fraction(0.0),
|
||||
econ_limits(std::make_shared<WellEconProductionLimits>()),
|
||||
@@ -118,7 +118,7 @@ Well2::Well2(const std::string& wname_arg,
|
||||
this->updateProduction(p);
|
||||
}
|
||||
|
||||
bool Well2::updateEfficiencyFactor(double efficiency_factor_arg) {
|
||||
bool Well::updateEfficiencyFactor(double efficiency_factor_arg) {
|
||||
if (this->efficiency_factor != efficiency_factor_arg) {
|
||||
this->efficiency_factor = efficiency_factor_arg;
|
||||
return true;
|
||||
@@ -127,7 +127,7 @@ bool Well2::updateEfficiencyFactor(double efficiency_factor_arg) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Well2::updateWellGuideRate(double guide_rate_arg) {
|
||||
bool Well::updateWellGuideRate(double guide_rate_arg) {
|
||||
if (this->guide_rate.guide_rate != guide_rate_arg) {
|
||||
this->guide_rate.guide_rate = guide_rate_arg;
|
||||
return true;
|
||||
@@ -137,7 +137,7 @@ bool Well2::updateWellGuideRate(double guide_rate_arg) {
|
||||
}
|
||||
|
||||
|
||||
bool Well2::updateFoamProperties(std::shared_ptr<WellFoamProperties> foam_properties_arg) {
|
||||
bool Well::updateFoamProperties(std::shared_ptr<WellFoamProperties> foam_properties_arg) {
|
||||
if (this->producer) {
|
||||
throw std::runtime_error("Not allowed to set foam injection properties for well " + name()
|
||||
+ " since it is a production well");
|
||||
@@ -151,7 +151,7 @@ bool Well2::updateFoamProperties(std::shared_ptr<WellFoamProperties> foam_proper
|
||||
}
|
||||
|
||||
|
||||
bool Well2::updatePolymerProperties(std::shared_ptr<WellPolymerProperties> polymer_properties_arg) {
|
||||
bool Well::updatePolymerProperties(std::shared_ptr<WellPolymerProperties> polymer_properties_arg) {
|
||||
if (this->producer) {
|
||||
throw std::runtime_error("Not allowed to set polymer injection properties for well " + name() +
|
||||
" since it is a production well");
|
||||
@@ -165,7 +165,7 @@ bool Well2::updatePolymerProperties(std::shared_ptr<WellPolymerProperties> polym
|
||||
}
|
||||
|
||||
|
||||
bool Well2::updateEconLimits(std::shared_ptr<WellEconProductionLimits> econ_limits_arg) {
|
||||
bool Well::updateEconLimits(std::shared_ptr<WellEconProductionLimits> econ_limits_arg) {
|
||||
if (*this->econ_limits != *econ_limits_arg) {
|
||||
this->econ_limits = econ_limits_arg;
|
||||
return true;
|
||||
@@ -174,17 +174,17 @@ bool Well2::updateEconLimits(std::shared_ptr<WellEconProductionLimits> econ_limi
|
||||
return false;
|
||||
}
|
||||
|
||||
void Well2::switchToProducer() {
|
||||
void Well::switchToProducer() {
|
||||
auto p = std::make_shared<WellInjectionProperties>(this->getInjectionProperties());
|
||||
|
||||
p->BHPLimit.reset( 0 );
|
||||
p->dropInjectionControl( Opm::Well2::InjectorCMode::BHP );
|
||||
p->dropInjectionControl( Opm::Well::InjectorCMode::BHP );
|
||||
this->updateInjection( p );
|
||||
this->updateProducer(true);
|
||||
}
|
||||
|
||||
|
||||
void Well2::switchToInjector() {
|
||||
void Well::switchToInjector() {
|
||||
auto p = std::make_shared<WellProductionProperties>(getProductionProperties());
|
||||
|
||||
p->BHPLimit.assert_numeric();
|
||||
@@ -194,7 +194,7 @@ void Well2::switchToInjector() {
|
||||
this->updateProducer( false );
|
||||
}
|
||||
|
||||
bool Well2::updateInjection(std::shared_ptr<WellInjectionProperties> injection_arg) {
|
||||
bool Well::updateInjection(std::shared_ptr<WellInjectionProperties> injection_arg) {
|
||||
if (this->producer)
|
||||
this->switchToInjector( );
|
||||
|
||||
@@ -206,7 +206,7 @@ bool Well2::updateInjection(std::shared_ptr<WellInjectionProperties> injection_a
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Well2::updateProduction(std::shared_ptr<WellProductionProperties> production_arg) {
|
||||
bool Well::updateProduction(std::shared_ptr<WellProductionProperties> production_arg) {
|
||||
if (!this->producer)
|
||||
this->switchToProducer( );
|
||||
|
||||
@@ -218,7 +218,7 @@ bool Well2::updateProduction(std::shared_ptr<WellProductionProperties> productio
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Well2::updateTracer(std::shared_ptr<WellTracerProperties> tracer_properties_arg) {
|
||||
bool Well::updateTracer(std::shared_ptr<WellTracerProperties> tracer_properties_arg) {
|
||||
if (*this->tracer_properties != *tracer_properties_arg) {
|
||||
this->tracer_properties = tracer_properties_arg;
|
||||
return true;
|
||||
@@ -227,7 +227,7 @@ bool Well2::updateTracer(std::shared_ptr<WellTracerProperties> tracer_properties
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Well2::updateWellGuideRate(bool available, double guide_rate_arg, GuideRateTarget guide_phase, double scale_factor) {
|
||||
bool Well::updateWellGuideRate(bool available, double guide_rate_arg, GuideRateTarget guide_phase, double scale_factor) {
|
||||
bool update = false;
|
||||
if (this->guide_rate.available != available) {
|
||||
this->guide_rate.available = available;
|
||||
@@ -253,7 +253,7 @@ bool Well2::updateWellGuideRate(bool available, double guide_rate_arg, GuideRate
|
||||
}
|
||||
|
||||
|
||||
bool Well2::updateProducer(bool producer_arg) {
|
||||
bool Well::updateProducer(bool producer_arg) {
|
||||
if (this->producer != producer_arg) {
|
||||
this->producer = producer_arg;
|
||||
return true;
|
||||
@@ -262,7 +262,7 @@ bool Well2::updateProducer(bool producer_arg) {
|
||||
}
|
||||
|
||||
|
||||
bool Well2::updateGroup(const std::string& group_arg) {
|
||||
bool Well::updateGroup(const std::string& group_arg) {
|
||||
if (this->group_name != group_arg) {
|
||||
this->group_name = group_arg;
|
||||
return true;
|
||||
@@ -271,7 +271,7 @@ bool Well2::updateGroup(const std::string& group_arg) {
|
||||
}
|
||||
|
||||
|
||||
bool Well2::updateHead(int I, int J) {
|
||||
bool Well::updateHead(int I, int J) {
|
||||
bool update = false;
|
||||
if (this->headI != I) {
|
||||
this->headI = I;
|
||||
@@ -287,7 +287,7 @@ bool Well2::updateHead(int I, int J) {
|
||||
}
|
||||
|
||||
|
||||
bool Well2::updateStatus(Status status_arg) {
|
||||
bool Well::updateStatus(Status status_arg) {
|
||||
if (this->status != status_arg) {
|
||||
this->status = status_arg;
|
||||
return true;
|
||||
@@ -297,7 +297,7 @@ bool Well2::updateStatus(Status status_arg) {
|
||||
}
|
||||
|
||||
|
||||
bool Well2::updateRefDepth(double ref_depth_arg) {
|
||||
bool Well::updateRefDepth(double ref_depth_arg) {
|
||||
if (this->ref_depth != ref_depth_arg) {
|
||||
this->ref_depth = ref_depth_arg;
|
||||
return true;
|
||||
@@ -306,7 +306,7 @@ bool Well2::updateRefDepth(double ref_depth_arg) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Well2::updateDrainageRadius(double drainage_radius_arg) {
|
||||
bool Well::updateDrainageRadius(double drainage_radius_arg) {
|
||||
if (this->drainage_radius != drainage_radius_arg) {
|
||||
this->drainage_radius = drainage_radius_arg;
|
||||
return true;
|
||||
@@ -316,7 +316,7 @@ bool Well2::updateDrainageRadius(double drainage_radius_arg) {
|
||||
}
|
||||
|
||||
|
||||
bool Well2::updateCrossFlow(bool allow_cross_flow_arg) {
|
||||
bool Well::updateCrossFlow(bool allow_cross_flow_arg) {
|
||||
if (this->allow_cross_flow != allow_cross_flow_arg) {
|
||||
this->allow_cross_flow = allow_cross_flow_arg;
|
||||
return true;
|
||||
@@ -325,7 +325,7 @@ bool Well2::updateCrossFlow(bool allow_cross_flow_arg) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Well2::updateAutoShutin(bool auto_shutin) {
|
||||
bool Well::updateAutoShutin(bool auto_shutin) {
|
||||
if (this->automatic_shutin != auto_shutin) {
|
||||
this->automatic_shutin = auto_shutin;
|
||||
return true;
|
||||
@@ -335,7 +335,7 @@ bool Well2::updateAutoShutin(bool auto_shutin) {
|
||||
}
|
||||
|
||||
|
||||
bool Well2::updateConnections(const std::shared_ptr<WellConnections> connections_arg) {
|
||||
bool Well::updateConnections(const std::shared_ptr<WellConnections> connections_arg) {
|
||||
if( this->ordering == Connection::Order::TRACK)
|
||||
connections_arg->orderConnections( this->headI, this->headJ );
|
||||
|
||||
@@ -351,7 +351,7 @@ bool Well2::updateConnections(const std::shared_ptr<WellConnections> connections
|
||||
}
|
||||
|
||||
|
||||
bool Well2::updateSolventFraction(double solvent_fraction_arg) {
|
||||
bool Well::updateSolventFraction(double solvent_fraction_arg) {
|
||||
if (this->solvent_fraction != solvent_fraction_arg) {
|
||||
this->solvent_fraction = solvent_fraction_arg;
|
||||
return true;
|
||||
@@ -361,34 +361,34 @@ bool Well2::updateSolventFraction(double solvent_fraction_arg) {
|
||||
}
|
||||
|
||||
|
||||
bool Well2::handleCOMPSEGS(const DeckKeyword& keyword, const EclipseGrid& grid,
|
||||
bool Well::handleCOMPSEGS(const DeckKeyword& keyword, const EclipseGrid& grid,
|
||||
const ParseContext& parseContext, ErrorGuard& errors) {
|
||||
std::shared_ptr<WellConnections> new_connection_set( newConnectionsWithSegments(keyword, *this->connections, *this->segments , grid,
|
||||
parseContext, errors) );
|
||||
return this->updateConnections(new_connection_set);
|
||||
}
|
||||
|
||||
const std::string& Well2::groupName() const {
|
||||
const std::string& Well::groupName() const {
|
||||
return this->group_name;
|
||||
}
|
||||
|
||||
|
||||
bool Well2::isMultiSegment() const {
|
||||
bool Well::isMultiSegment() const {
|
||||
if (this->segments)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Well2::isProducer() const {
|
||||
bool Well::isProducer() const {
|
||||
return this->producer;
|
||||
}
|
||||
|
||||
bool Well2::isInjector() const {
|
||||
bool Well::isInjector() const {
|
||||
return !this->producer;
|
||||
}
|
||||
|
||||
|
||||
Well2::InjectorType Well2::injectorType() const {
|
||||
Well::InjectorType Well::injectorType() const {
|
||||
if (this->producer)
|
||||
throw std::runtime_error("Can not access injectorType attribute of a producer");
|
||||
|
||||
@@ -397,54 +397,54 @@ Well2::InjectorType Well2::injectorType() const {
|
||||
|
||||
|
||||
|
||||
bool Well2::isAvailableForGroupControl() const {
|
||||
bool Well::isAvailableForGroupControl() const {
|
||||
return this->guide_rate.available;
|
||||
}
|
||||
|
||||
double Well2::getGuideRate() const {
|
||||
double Well::getGuideRate() const {
|
||||
return this->guide_rate.guide_rate;
|
||||
}
|
||||
|
||||
Well2::GuideRateTarget Well2::getGuideRatePhase() const {
|
||||
Well::GuideRateTarget Well::getGuideRatePhase() const {
|
||||
return this->guide_rate.guide_phase;
|
||||
}
|
||||
|
||||
double Well2::getGuideRateScalingFactor() const {
|
||||
double Well::getGuideRateScalingFactor() const {
|
||||
return this->guide_rate.scale_factor;
|
||||
}
|
||||
|
||||
|
||||
double Well2::getEfficiencyFactor() const {
|
||||
double Well::getEfficiencyFactor() const {
|
||||
return this->efficiency_factor;
|
||||
}
|
||||
|
||||
double Well2::getSolventFraction() const {
|
||||
double Well::getSolventFraction() const {
|
||||
return this->solvent_fraction;
|
||||
}
|
||||
|
||||
|
||||
|
||||
std::size_t Well2::seqIndex() const {
|
||||
std::size_t Well::seqIndex() const {
|
||||
return this->insert_index;
|
||||
}
|
||||
|
||||
int Well2::getHeadI() const {
|
||||
int Well::getHeadI() const {
|
||||
return this->headI;
|
||||
}
|
||||
|
||||
int Well2::getHeadJ() const {
|
||||
int Well::getHeadJ() const {
|
||||
return this->headJ;
|
||||
}
|
||||
|
||||
bool Well2::getAutomaticShutIn() const {
|
||||
bool Well::getAutomaticShutIn() const {
|
||||
return this->automatic_shutin;
|
||||
}
|
||||
|
||||
bool Well2::getAllowCrossFlow() const {
|
||||
bool Well::getAllowCrossFlow() const {
|
||||
return this->allow_cross_flow;
|
||||
}
|
||||
|
||||
double Well2::getRefDepth() const {
|
||||
double Well::getRefDepth() const {
|
||||
if( this->ref_depth >= 0.0 )
|
||||
return this->ref_depth;
|
||||
|
||||
@@ -458,58 +458,58 @@ double Well2::getRefDepth() const {
|
||||
}
|
||||
|
||||
|
||||
double Well2::getDrainageRadius() const {
|
||||
double Well::getDrainageRadius() const {
|
||||
return this->drainage_radius;
|
||||
}
|
||||
|
||||
|
||||
const std::string& Well2::name() const {
|
||||
const std::string& Well::name() const {
|
||||
return this->wname;
|
||||
}
|
||||
|
||||
|
||||
const WellConnections& Well2::getConnections() const {
|
||||
const WellConnections& Well::getConnections() const {
|
||||
return *this->connections;
|
||||
}
|
||||
|
||||
const WellFoamProperties& Well2::getFoamProperties() const {
|
||||
const WellFoamProperties& Well::getFoamProperties() const {
|
||||
return *this->foam_properties;
|
||||
}
|
||||
|
||||
const WellPolymerProperties& Well2::getPolymerProperties() const {
|
||||
const WellPolymerProperties& Well::getPolymerProperties() const {
|
||||
return *this->polymer_properties;
|
||||
}
|
||||
|
||||
|
||||
const WellTracerProperties& Well2::getTracerProperties() const {
|
||||
const WellTracerProperties& Well::getTracerProperties() const {
|
||||
return *this->tracer_properties;
|
||||
}
|
||||
|
||||
const WellEconProductionLimits& Well2::getEconLimits() const {
|
||||
const WellEconProductionLimits& Well::getEconLimits() const {
|
||||
return *this->econ_limits;
|
||||
}
|
||||
|
||||
const Well2::WellProductionProperties& Well2::getProductionProperties() const {
|
||||
const Well::WellProductionProperties& Well::getProductionProperties() const {
|
||||
return *this->production;
|
||||
}
|
||||
|
||||
const WellSegments& Well2::getSegments() const {
|
||||
const WellSegments& Well::getSegments() const {
|
||||
if (this->segments)
|
||||
return *this->segments;
|
||||
else
|
||||
throw std::logic_error("Asked for segment information in not MSW well: " + this->name());
|
||||
}
|
||||
|
||||
const Well2::WellInjectionProperties& Well2::getInjectionProperties() const {
|
||||
const Well::WellInjectionProperties& Well::getInjectionProperties() const {
|
||||
return *this->injection;
|
||||
}
|
||||
|
||||
Well2::Status Well2::getStatus() const {
|
||||
Well::Status Well::getStatus() const {
|
||||
return this->status;
|
||||
}
|
||||
|
||||
|
||||
std::map<int, std::vector<Connection>> Well2::getCompletions() const {
|
||||
std::map<int, std::vector<Connection>> Well::getCompletions() const {
|
||||
std::map<int, std::vector<Connection>> completions;
|
||||
|
||||
for (const auto& conn : *this->connections) {
|
||||
@@ -524,11 +524,11 @@ std::map<int, std::vector<Connection>> Well2::getCompletions() const {
|
||||
return completions;
|
||||
}
|
||||
|
||||
Phase Well2::getPreferredPhase() const {
|
||||
Phase Well::getPreferredPhase() const {
|
||||
return this->phase;
|
||||
}
|
||||
|
||||
bool Well2::handleWELOPEN(const DeckRecord& record, Connection::State state_arg) {
|
||||
bool Well::handleWELOPEN(const DeckRecord& record, Connection::State state_arg) {
|
||||
|
||||
auto match = [=]( const Connection &c) -> bool {
|
||||
if (!match_eq(c.getI(), record, "I" , -1)) return false;
|
||||
@@ -551,7 +551,7 @@ bool Well2::handleWELOPEN(const DeckRecord& record, Connection::State state_arg)
|
||||
return this->updateConnections(new_connections);
|
||||
}
|
||||
|
||||
bool Well2::handleCOMPLUMP(const DeckRecord& record) {
|
||||
bool Well::handleCOMPLUMP(const DeckRecord& record) {
|
||||
|
||||
auto match = [=]( const Connection &c) -> bool {
|
||||
if (!match_eq(c.getI(), record, "I" , -1)) return false;
|
||||
@@ -579,7 +579,7 @@ bool Well2::handleCOMPLUMP(const DeckRecord& record) {
|
||||
|
||||
|
||||
|
||||
bool Well2::handleWPIMULT(const DeckRecord& record) {
|
||||
bool Well::handleWPIMULT(const DeckRecord& record) {
|
||||
|
||||
auto match = [=]( const Connection &c) -> bool {
|
||||
if (!match_ge(c.complnum(), record, "FIRST")) return false;
|
||||
@@ -605,7 +605,7 @@ bool Well2::handleWPIMULT(const DeckRecord& record) {
|
||||
}
|
||||
|
||||
|
||||
bool Well2::handleWELSEGS(const DeckKeyword& keyword) {
|
||||
bool Well::handleWELSEGS(const DeckKeyword& keyword) {
|
||||
if( this->segments )
|
||||
throw std::logic_error("re-entering WELSEGS for a well is not supported yet!!.");
|
||||
|
||||
@@ -621,16 +621,16 @@ bool Well2::handleWELSEGS(const DeckKeyword& keyword) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void Well2::filterConnections(const EclipseGrid& grid) {
|
||||
void Well::filterConnections(const EclipseGrid& grid) {
|
||||
this->connections->filter(grid);
|
||||
}
|
||||
|
||||
|
||||
std::size_t Well2::firstTimeStep() const {
|
||||
std::size_t Well::firstTimeStep() const {
|
||||
return this->init_step;
|
||||
}
|
||||
|
||||
bool Well2::hasBeenDefined(size_t timeStep) const {
|
||||
bool Well::hasBeenDefined(size_t timeStep) const {
|
||||
if (timeStep < this->init_step)
|
||||
return false;
|
||||
else
|
||||
@@ -639,7 +639,7 @@ bool Well2::hasBeenDefined(size_t timeStep) const {
|
||||
|
||||
|
||||
|
||||
bool Well2::canOpen() const {
|
||||
bool Well::canOpen() const {
|
||||
if (this->allow_cross_flow)
|
||||
return true;
|
||||
|
||||
@@ -668,12 +668,12 @@ bool Well2::canOpen() const {
|
||||
}
|
||||
|
||||
|
||||
bool Well2::predictionMode() const {
|
||||
bool Well::predictionMode() const {
|
||||
return this->prediction_mode;
|
||||
}
|
||||
|
||||
|
||||
bool Well2::updatePrediction(bool prediction_mode_arg) {
|
||||
bool Well::updatePrediction(bool prediction_mode_arg) {
|
||||
if (this->prediction_mode != prediction_mode_arg) {
|
||||
this->prediction_mode = prediction_mode_arg;
|
||||
return true;
|
||||
@@ -683,11 +683,11 @@ bool Well2::updatePrediction(bool prediction_mode_arg) {
|
||||
}
|
||||
|
||||
|
||||
Connection::Order Well2::getWellConnectionOrdering() const {
|
||||
Connection::Order Well::getWellConnectionOrdering() const {
|
||||
return this->ordering;
|
||||
}
|
||||
|
||||
double Well2::production_rate(const SummaryState& st, Phase prod_phase) const {
|
||||
double Well::production_rate(const SummaryState& st, Phase prod_phase) const {
|
||||
if( !this->isProducer() ) return 0.0;
|
||||
|
||||
const auto controls = this->productionControls(st);
|
||||
@@ -712,21 +712,21 @@ double Well2::production_rate(const SummaryState& st, Phase prod_phase) const {
|
||||
"This is likely a programming error." );
|
||||
}
|
||||
|
||||
double Well2::injection_rate(const SummaryState& st, Phase phase_arg) const {
|
||||
double Well::injection_rate(const SummaryState& st, Phase phase_arg) const {
|
||||
if( !this->isInjector() ) return 0.0;
|
||||
const auto controls = this->injectionControls(st);
|
||||
|
||||
const auto type = controls.injector_type;
|
||||
|
||||
if( phase_arg == Phase::WATER && type != Well2::InjectorType::WATER ) return 0.0;
|
||||
if( phase_arg == Phase::OIL && type != Well2::InjectorType::OIL ) return 0.0;
|
||||
if( phase_arg == Phase::GAS && type != Well2::InjectorType::GAS ) return 0.0;
|
||||
if( phase_arg == Phase::WATER && type != Well::InjectorType::WATER ) return 0.0;
|
||||
if( phase_arg == Phase::OIL && type != Well::InjectorType::OIL ) return 0.0;
|
||||
if( phase_arg == Phase::GAS && type != Well::InjectorType::GAS ) return 0.0;
|
||||
|
||||
return controls.surface_rate;
|
||||
}
|
||||
|
||||
|
||||
bool Well2::wellNameInWellNamePattern(const std::string& wellName, const std::string& wellNamePattern) {
|
||||
bool Well::wellNameInWellNamePattern(const std::string& wellName, const std::string& wellNamePattern) {
|
||||
bool wellNameInPattern = false;
|
||||
if (fnmatch( wellNamePattern.c_str() , wellName.c_str() , 0 ) == 0) {
|
||||
wellNameInPattern = true;
|
||||
@@ -735,7 +735,7 @@ bool Well2::wellNameInWellNamePattern(const std::string& wellName, const std::st
|
||||
}
|
||||
|
||||
|
||||
Well2::ProductionControls Well2::productionControls(const SummaryState& st) const {
|
||||
Well::ProductionControls Well::productionControls(const SummaryState& st) const {
|
||||
if (this->isProducer()) {
|
||||
auto controls = this->production->controls(st, this->udq_undefined);
|
||||
controls.prediction_mode = this->predictionMode();
|
||||
@@ -744,7 +744,7 @@ Well2::ProductionControls Well2::productionControls(const SummaryState& st) cons
|
||||
throw std::logic_error("Trying to get production data from an injector");
|
||||
}
|
||||
|
||||
Well2::InjectionControls Well2::injectionControls(const SummaryState& st) const {
|
||||
Well::InjectionControls Well::injectionControls(const SummaryState& st) const {
|
||||
if (!this->isProducer()) {
|
||||
auto controls = this->injection->controls(this->unit_system, st, this->udq_undefined);
|
||||
controls.prediction_mode = this->predictionMode();
|
||||
@@ -762,21 +762,21 @@ Well2::InjectionControls Well2::injectionControls(const SummaryState& st) const
|
||||
*/
|
||||
|
||||
|
||||
int Well2::vfp_table_number() const {
|
||||
int Well::vfp_table_number() const {
|
||||
if (this->producer)
|
||||
return this->production->VFPTableNumber;
|
||||
else
|
||||
return this->injection->VFPTableNumber;
|
||||
}
|
||||
|
||||
double Well2::alq_value() const {
|
||||
double Well::alq_value() const {
|
||||
if (this->producer)
|
||||
return this->production->ALQValue;
|
||||
|
||||
throw std::runtime_error("Can not ask for ALQ value in an injector");
|
||||
}
|
||||
|
||||
double Well2::temperature() const {
|
||||
double Well::temperature() const {
|
||||
if (!this->producer)
|
||||
return this->injection->temperature;
|
||||
|
||||
@@ -784,7 +784,7 @@ double Well2::temperature() const {
|
||||
}
|
||||
|
||||
|
||||
std::string Well2::Status2String(Well2::Status enumValue) {
|
||||
std::string Well::Status2String(Well::Status enumValue) {
|
||||
switch( enumValue ) {
|
||||
case Status::OPEN:
|
||||
return "OPEN";
|
||||
@@ -800,7 +800,7 @@ std::string Well2::Status2String(Well2::Status enumValue) {
|
||||
}
|
||||
|
||||
|
||||
Well2::Status Well2::StatusFromString(const std::string& stringValue) {
|
||||
Well::Status Well::StatusFromString(const std::string& stringValue) {
|
||||
if (stringValue == "OPEN")
|
||||
return Status::OPEN;
|
||||
else if (stringValue == "SHUT")
|
||||
@@ -814,7 +814,7 @@ Well2::Status Well2::StatusFromString(const std::string& stringValue) {
|
||||
}
|
||||
|
||||
|
||||
const std::string Well2::InjectorType2String( Well2::InjectorType enumValue ) {
|
||||
const std::string Well::InjectorType2String( Well::InjectorType enumValue ) {
|
||||
switch( enumValue ) {
|
||||
case InjectorType::OIL:
|
||||
return "OIL";
|
||||
@@ -829,7 +829,7 @@ const std::string Well2::InjectorType2String( Well2::InjectorType enumValue ) {
|
||||
}
|
||||
}
|
||||
|
||||
Well2::InjectorType Well2::InjectorTypeFromString( const std::string& stringValue ) {
|
||||
Well::InjectorType Well::InjectorTypeFromString( const std::string& stringValue ) {
|
||||
if (stringValue == "OIL")
|
||||
return InjectorType::OIL;
|
||||
else if (stringValue == "WATER")
|
||||
@@ -844,7 +844,7 @@ Well2::InjectorType Well2::InjectorTypeFromString( const std::string& stringValu
|
||||
throw std::invalid_argument("Unknown enum state string: " + stringValue );
|
||||
}
|
||||
|
||||
const std::string Well2::InjectorCMode2String( InjectorCMode enumValue ) {
|
||||
const std::string Well::InjectorCMode2String( InjectorCMode enumValue ) {
|
||||
switch( enumValue ) {
|
||||
case InjectorCMode::RESV:
|
||||
return "RESV";
|
||||
@@ -862,7 +862,7 @@ const std::string Well2::InjectorCMode2String( InjectorCMode enumValue ) {
|
||||
}
|
||||
|
||||
|
||||
Well2::InjectorCMode Well2::InjectorCModeFromString(const std::string &stringValue) {
|
||||
Well::InjectorCMode Well::InjectorCModeFromString(const std::string &stringValue) {
|
||||
if (stringValue == "RATE")
|
||||
return InjectorCMode::RATE;
|
||||
else if (stringValue == "RESV")
|
||||
@@ -877,7 +877,7 @@ Well2::InjectorCMode Well2::InjectorCModeFromString(const std::string &stringVal
|
||||
throw std::invalid_argument("Unknown enum state string: " + stringValue);
|
||||
}
|
||||
|
||||
Well2::WELTARGCMode Well2::WELTARGCModeFromString(const std::string& string_value) {
|
||||
Well::WELTARGCMode Well::WELTARGCModeFromString(const std::string& string_value) {
|
||||
if (string_value == "ORAT")
|
||||
return WELTARGCMode::ORAT;
|
||||
|
||||
@@ -915,7 +915,7 @@ Well2::WELTARGCMode Well2::WELTARGCModeFromString(const std::string& string_valu
|
||||
}
|
||||
|
||||
|
||||
const std::string Well2::ProducerCMode2String( ProducerCMode enumValue ) {
|
||||
const std::string Well::ProducerCMode2String( ProducerCMode enumValue ) {
|
||||
switch( enumValue ) {
|
||||
case ProducerCMode::ORAT:
|
||||
return "ORAT";
|
||||
@@ -940,7 +940,7 @@ const std::string Well2::ProducerCMode2String( ProducerCMode enumValue ) {
|
||||
}
|
||||
}
|
||||
|
||||
Well2::ProducerCMode Well2::ProducerCModeFromString( const std::string& stringValue ) {
|
||||
Well::ProducerCMode Well::ProducerCModeFromString( const std::string& stringValue ) {
|
||||
if (stringValue == "ORAT")
|
||||
return ProducerCMode::ORAT;
|
||||
else if (stringValue == "WRAT")
|
||||
@@ -966,7 +966,7 @@ Well2::ProducerCMode Well2::ProducerCModeFromString( const std::string& stringVa
|
||||
}
|
||||
|
||||
|
||||
const std::string Well2::GuideRateTarget2String( GuideRateTarget enumValue ) {
|
||||
const std::string Well::GuideRateTarget2String( GuideRateTarget enumValue ) {
|
||||
switch( enumValue ) {
|
||||
case GuideRateTarget::OIL:
|
||||
return "OIL";
|
||||
@@ -993,7 +993,7 @@ const std::string Well2::GuideRateTarget2String( GuideRateTarget enumValue ) {
|
||||
}
|
||||
}
|
||||
|
||||
Well2::GuideRateTarget Well2::GuideRateTargetFromString( const std::string& stringValue ) {
|
||||
Well::GuideRateTarget Well::GuideRateTargetFromString( const std::string& stringValue ) {
|
||||
if (stringValue == "OIL")
|
||||
return GuideRateTarget::OIL;
|
||||
else if (stringValue == "WAT")
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQActive.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/WellInjectionProperties.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
|
||||
#include "injection.hpp"
|
||||
#include "../eval_uda.hpp"
|
||||
@@ -35,7 +35,7 @@
|
||||
namespace Opm {
|
||||
|
||||
|
||||
Well2::WellInjectionProperties::WellInjectionProperties(const std::string& wname)
|
||||
Well::WellInjectionProperties::WellInjectionProperties(const std::string& wname)
|
||||
: name(wname),
|
||||
injectorType(InjectorType::WATER),
|
||||
controlMode(InjectorCMode::CMODE_UNDEFINED)
|
||||
@@ -51,8 +51,8 @@ namespace Opm {
|
||||
}
|
||||
|
||||
|
||||
void Well2::WellInjectionProperties::handleWCONINJE(const DeckRecord& record, bool availableForGroupControl, const std::string& well_name) {
|
||||
this->injectorType = Well2::InjectorTypeFromString( record.getItem("TYPE").getTrimmedString(0) );
|
||||
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;
|
||||
|
||||
if (!record.getItem("RATE").defaultApplied(0)) {
|
||||
@@ -105,25 +105,25 @@ namespace Opm {
|
||||
|
||||
|
||||
|
||||
void Well2::WellInjectionProperties::handleWELTARG(WELTARGCMode cmode, double newValue, double siFactorG, double siFactorL, double siFactorP) {
|
||||
if (cmode == Well2::WELTARGCMode::BHP){
|
||||
void Well::WellInjectionProperties::handleWELTARG(WELTARGCMode cmode, double newValue, double siFactorG, double siFactorL, double siFactorP) {
|
||||
if (cmode == Well::WELTARGCMode::BHP){
|
||||
this->BHPLimit.reset( newValue * siFactorP );
|
||||
}
|
||||
else if (cmode == WELTARGCMode::ORAT){
|
||||
if(this->injectorType == Well2::InjectorType::OIL){
|
||||
if(this->injectorType == Well::InjectorType::OIL){
|
||||
this->surfaceInjectionRate.reset( newValue * siFactorL );
|
||||
}else{
|
||||
std::invalid_argument("Well type must be OIL to set the oil rate");
|
||||
}
|
||||
}
|
||||
else if (cmode == WELTARGCMode::WRAT){
|
||||
if(this->injectorType == Well2::InjectorType::WATER)
|
||||
if(this->injectorType == Well::InjectorType::WATER)
|
||||
this->surfaceInjectionRate.reset( newValue * siFactorL );
|
||||
else
|
||||
std::invalid_argument("Well type must be WATER to set the water rate");
|
||||
}
|
||||
else if (cmode == WELTARGCMode::GRAT){
|
||||
if(this->injectorType == Well2::InjectorType::GAS){
|
||||
if(this->injectorType == Well::InjectorType::GAS){
|
||||
this->surfaceInjectionRate.reset( newValue * siFactorG );
|
||||
}else{
|
||||
std::invalid_argument("Well type must be GAS to set the gas rate");
|
||||
@@ -144,14 +144,14 @@ namespace Opm {
|
||||
}
|
||||
|
||||
|
||||
void Well2::WellInjectionProperties::handleWCONINJH(const DeckRecord& record, bool is_producer, const std::string& well_name) {
|
||||
void Well::WellInjectionProperties::handleWCONINJH(const DeckRecord& record, bool is_producer, const std::string& well_name) {
|
||||
// convert injection rates to SI
|
||||
const auto& typeItem = record.getItem("TYPE");
|
||||
if (typeItem.defaultApplied(0)) {
|
||||
const std::string msg = "Injection type can not be defaulted for keyword WCONINJH";
|
||||
throw std::invalid_argument(msg);
|
||||
}
|
||||
this->injectorType = Well2::InjectorTypeFromString( typeItem.getTrimmedString(0));
|
||||
this->injectorType = Well::InjectorTypeFromString( typeItem.getTrimmedString(0));
|
||||
|
||||
if (!record.getItem("RATE").defaultApplied(0)) {
|
||||
double injectionRate = record.getItem("RATE").get<double>(0);
|
||||
@@ -196,7 +196,7 @@ namespace Opm {
|
||||
}
|
||||
}
|
||||
|
||||
bool Well2::WellInjectionProperties::operator==(const Well2::WellInjectionProperties& other) const {
|
||||
bool Well::WellInjectionProperties::operator==(const Well::WellInjectionProperties& other) const {
|
||||
if ((surfaceInjectionRate == other.surfaceInjectionRate) &&
|
||||
(reservoirInjectionRate == other.reservoirInjectionRate) &&
|
||||
(temperature == other.temperature) &&
|
||||
@@ -214,24 +214,24 @@ namespace Opm {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Well2::WellInjectionProperties::operator!=(const Well2::WellInjectionProperties& other) const {
|
||||
bool Well::WellInjectionProperties::operator!=(const Well::WellInjectionProperties& other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
void Well2::WellInjectionProperties::resetDefaultHistoricalBHPLimit() {
|
||||
void Well::WellInjectionProperties::resetDefaultHistoricalBHPLimit() {
|
||||
// this default BHP value is from simulation result,
|
||||
// without finding any related document
|
||||
BHPLimit.reset( 6891.2 * unit::barsa );
|
||||
}
|
||||
|
||||
void Well2::WellInjectionProperties::setBHPLimit(const double limit) {
|
||||
void Well::WellInjectionProperties::setBHPLimit(const double limit) {
|
||||
BHPLimit.reset( limit );
|
||||
}
|
||||
|
||||
std::ostream& operator<<( std::ostream& stream,
|
||||
const Well2::WellInjectionProperties& wp ) {
|
||||
const Well::WellInjectionProperties& wp ) {
|
||||
return stream
|
||||
<< "Well2::WellInjectionProperties { "
|
||||
<< "Well::WellInjectionProperties { "
|
||||
<< "surfacerate: " << wp.surfaceInjectionRate << ", "
|
||||
<< "reservoir rate " << wp.reservoirInjectionRate << ", "
|
||||
<< "temperature: " << wp.temperature << ", "
|
||||
@@ -242,12 +242,12 @@ namespace Opm {
|
||||
<< "VFP table: " << wp.VFPTableNumber << ", "
|
||||
<< "prediction mode: " << wp.predictionMode << ", "
|
||||
<< "injection ctrl: " << wp.injectionControls << ", "
|
||||
<< "injector type: " << Well2::InjectorType2String(wp.injectorType) << ", "
|
||||
<< "control mode: " << Well2::InjectorCMode2String(wp.controlMode) << " }";
|
||||
<< "injector type: " << Well::InjectorType2String(wp.injectorType) << ", "
|
||||
<< "control mode: " << Well::InjectorCMode2String(wp.controlMode) << " }";
|
||||
}
|
||||
|
||||
|
||||
Well2::InjectionControls Well2::WellInjectionProperties::controls(const UnitSystem& unit_sys, const SummaryState& st, double udq_def) const {
|
||||
Well::InjectionControls Well::WellInjectionProperties::controls(const UnitSystem& unit_sys, const SummaryState& st, double udq_def) const {
|
||||
InjectionControls controls(this->injectionControls);
|
||||
|
||||
controls.surface_rate = UDA::eval_well_uda_rate(this->surfaceInjectionRate, this->name, st, udq_def, this->injectorType, unit_sys);
|
||||
@@ -264,7 +264,7 @@ Well2::InjectionControls Well2::WellInjectionProperties::controls(const UnitSyst
|
||||
return controls;
|
||||
}
|
||||
|
||||
bool Well2::WellInjectionProperties::updateUDQActive(const UDQConfig& udq_config, UDQActive& active) const {
|
||||
bool Well::WellInjectionProperties::updateUDQActive(const UDQConfig& udq_config, UDQActive& active) const {
|
||||
int update_count = 0;
|
||||
|
||||
update_count += active.update(udq_config, this->surfaceInjectionRate, this->name, UDAControl::WCONINJE_RATE);
|
||||
|
||||
@@ -33,20 +33,20 @@
|
||||
|
||||
namespace Opm {
|
||||
|
||||
Well2::WellProductionProperties::WellProductionProperties(const std::string& name_arg) :
|
||||
Well::WellProductionProperties::WellProductionProperties(const std::string& name_arg) :
|
||||
name(name_arg),
|
||||
predictionMode( true )
|
||||
{}
|
||||
|
||||
|
||||
void Well2::WellProductionProperties::init_rates( const DeckRecord& record ) {
|
||||
void Well::WellProductionProperties::init_rates( const DeckRecord& record ) {
|
||||
this->OilRate = record.getItem("ORAT").get<UDAValue>(0);
|
||||
this->WaterRate = record.getItem("WRAT").get<UDAValue>(0);
|
||||
this->GasRate = record.getItem("GRAT").get<UDAValue>(0);
|
||||
}
|
||||
|
||||
|
||||
void Well2::WellProductionProperties::init_history(const DeckRecord& record)
|
||||
void Well::WellProductionProperties::init_history(const DeckRecord& record)
|
||||
{
|
||||
this->predictionMode = false;
|
||||
// update LiquidRate
|
||||
@@ -101,7 +101,7 @@ namespace Opm {
|
||||
|
||||
|
||||
|
||||
void Well2::WellProductionProperties::handleWCONPROD( const std::string& /* well */, const DeckRecord& record)
|
||||
void Well::WellProductionProperties::handleWCONPROD( const std::string& /* well */, const DeckRecord& record)
|
||||
{
|
||||
this->predictionMode = true;
|
||||
|
||||
@@ -137,7 +137,7 @@ namespace Opm {
|
||||
{
|
||||
const auto& cmodeItem = record.getItem("CMODE");
|
||||
if (cmodeItem.hasValue(0)) {
|
||||
auto cmode = Well2::ProducerCModeFromString( cmodeItem.getTrimmedString(0) );
|
||||
auto cmode = Well::ProducerCModeFromString( cmodeItem.getTrimmedString(0) );
|
||||
|
||||
if (this->hasProductionControl( cmode ))
|
||||
this->controlMode = cmode;
|
||||
@@ -152,7 +152,7 @@ namespace Opm {
|
||||
originate from the WCONHIST keyword. Predictions are handled with the
|
||||
default constructor and the handleWCONPROD() method.
|
||||
*/
|
||||
void Well2::WellProductionProperties::handleWCONHIST(const DeckRecord& record)
|
||||
void Well::WellProductionProperties::handleWCONHIST(const DeckRecord& record)
|
||||
{
|
||||
this->init_rates(record);
|
||||
this->LiquidRate.reset(0);
|
||||
@@ -173,7 +173,7 @@ namespace Opm {
|
||||
|
||||
|
||||
|
||||
void Well2::WellProductionProperties::handleWELTARG(Well2::WELTARGCMode cmode, double newValue, double siFactorG, double siFactorL, double siFactorP) {
|
||||
void Well::WellProductionProperties::handleWELTARG(Well::WELTARGCMode cmode, double newValue, double siFactorG, double siFactorL, double siFactorP) {
|
||||
if (cmode == WELTARGCMode::ORAT){
|
||||
this->OilRate.assert_numeric("Can not combine UDA and WELTARG");
|
||||
this->OilRate.reset( newValue * siFactorL );
|
||||
@@ -210,7 +210,7 @@ void Well2::WellProductionProperties::handleWELTARG(Well2::WELTARGCMode cmode, d
|
||||
|
||||
|
||||
|
||||
bool Well2::WellProductionProperties::operator==(const Well2::WellProductionProperties& other) const {
|
||||
bool Well::WellProductionProperties::operator==(const Well::WellProductionProperties& other) const {
|
||||
return OilRate == other.OilRate
|
||||
&& WaterRate == other.WaterRate
|
||||
&& GasRate == other.GasRate
|
||||
@@ -228,14 +228,14 @@ void Well2::WellProductionProperties::handleWELTARG(Well2::WELTARGCMode cmode, d
|
||||
}
|
||||
|
||||
|
||||
bool Well2::WellProductionProperties::operator!=(const Well2::WellProductionProperties& other) const {
|
||||
bool Well::WellProductionProperties::operator!=(const Well::WellProductionProperties& other) const {
|
||||
return !(*this == other);
|
||||
}
|
||||
|
||||
|
||||
std::ostream& operator<<( std::ostream& stream, const Well2::WellProductionProperties& wp ) {
|
||||
std::ostream& operator<<( std::ostream& stream, const Well::WellProductionProperties& wp ) {
|
||||
return stream
|
||||
<< "Well2::WellProductionProperties { "
|
||||
<< "Well::WellProductionProperties { "
|
||||
<< "oil rate: " << wp.OilRate << ", "
|
||||
<< "water rate: " << wp.WaterRate << ", "
|
||||
<< "gas rate: " << wp.GasRate << ", "
|
||||
@@ -247,35 +247,35 @@ void Well2::WellProductionProperties::handleWELTARG(Well2::WELTARGCMode cmode, d
|
||||
<< "THPH: " << wp.THPH << ", "
|
||||
<< "VFP table: " << wp.VFPTableNumber << ", "
|
||||
<< "ALQ: " << wp.ALQValue << ", "
|
||||
<< "WHISTCTL: " << Well2::ProducerCMode2String(wp.whistctl_cmode) << ", "
|
||||
<< "WHISTCTL: " << Well::ProducerCMode2String(wp.whistctl_cmode) << ", "
|
||||
<< "prediction: " << wp.predictionMode << " }";
|
||||
}
|
||||
|
||||
bool Well2::WellProductionProperties::effectiveHistoryProductionControl(const Well2::ProducerCMode cmode) {
|
||||
bool Well::WellProductionProperties::effectiveHistoryProductionControl(const Well::ProducerCMode cmode) {
|
||||
// Note, not handling CRAT for now
|
||||
return ( (cmode == ProducerCMode::LRAT || cmode == ProducerCMode::RESV || cmode == ProducerCMode::ORAT ||
|
||||
cmode == ProducerCMode::WRAT || cmode == ProducerCMode::GRAT || cmode == ProducerCMode::BHP) );
|
||||
}
|
||||
|
||||
void Well2::WellProductionProperties::resetDefaultBHPLimit() {
|
||||
void Well::WellProductionProperties::resetDefaultBHPLimit() {
|
||||
BHPLimit = UDAValue( 1. * unit::atm );
|
||||
}
|
||||
|
||||
void Well2::WellProductionProperties::clearControls() {
|
||||
void Well::WellProductionProperties::clearControls() {
|
||||
m_productionControls = 0;
|
||||
}
|
||||
|
||||
void Well2::WellProductionProperties::setBHPLimit(const double limit) {
|
||||
void Well::WellProductionProperties::setBHPLimit(const double limit) {
|
||||
BHPLimit = UDAValue( limit );
|
||||
}
|
||||
|
||||
double Well2::WellProductionProperties::getBHPLimit() const {
|
||||
double Well::WellProductionProperties::getBHPLimit() const {
|
||||
return BHPLimit.get<double>();
|
||||
}
|
||||
|
||||
|
||||
Well2::ProductionControls Well2::WellProductionProperties::controls(const SummaryState& st, double udq_undef) const {
|
||||
Well2::ProductionControls controls(this->m_productionControls);
|
||||
Well::ProductionControls Well::WellProductionProperties::controls(const SummaryState& st, double udq_undef) const {
|
||||
Well::ProductionControls controls(this->m_productionControls);
|
||||
|
||||
controls.oil_rate = UDA::eval_well_uda(this->OilRate, this->name, st, udq_undef);
|
||||
controls.water_rate = UDA::eval_well_uda(this->WaterRate, this->name, st, udq_undef);
|
||||
@@ -294,7 +294,7 @@ bool Well2::WellProductionProperties::effectiveHistoryProductionControl(const We
|
||||
return controls;
|
||||
}
|
||||
|
||||
bool Well2::WellProductionProperties::updateUDQActive(const UDQConfig& udq_config, UDQActive& active) const {
|
||||
bool Well::WellProductionProperties::updateUDQActive(const UDQConfig& udq_config, UDQActive& active) const {
|
||||
int update_count = 0;
|
||||
|
||||
update_count += active.update(udq_config, this->OilRate, this->name, UDAControl::WCONPROD_ORAT);
|
||||
|
||||
@@ -102,7 +102,7 @@ namespace Opm {
|
||||
|
||||
std::vector<std::pair<std::string, WellTestConfig::Reason>>
|
||||
WellTestState::updateWells(const WellTestConfig& config,
|
||||
const std::vector<Well2>& wells_ecl,
|
||||
const std::vector<Well>& wells_ecl,
|
||||
double sim_time) {
|
||||
std::vector<std::pair<std::string, WellTestConfig::Reason>> output;
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace Opm {
|
||||
|
||||
for (auto& well : this->wells) {
|
||||
auto well_ecl = std::find_if(wells_ecl.begin(), wells_ecl.end(),
|
||||
[&well](const Well2& w)
|
||||
[&well](const Well& w)
|
||||
{
|
||||
return w.name() == well.name;
|
||||
});
|
||||
@@ -119,7 +119,7 @@ namespace Opm {
|
||||
throw std::runtime_error("No well named " + well.name + " is found in wells_ecl.");
|
||||
|
||||
// if the well is SHUT, we do not consider to test it
|
||||
if (well_ecl->getStatus() != Well2::Status::OPEN)
|
||||
if (well_ecl->getStatus() != Well::Status::OPEN)
|
||||
continue;
|
||||
|
||||
if (well.closed && config.has(well.name, well.reason)) {
|
||||
|
||||
@@ -22,27 +22,27 @@
|
||||
#include <stdexcept>
|
||||
|
||||
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
|
||||
#include "injection.hpp"
|
||||
|
||||
namespace Opm {
|
||||
namespace injection {
|
||||
|
||||
double rateToSI(double rawRate, Well2::InjectorType wellType, const Opm::UnitSystem &unitSystem) {
|
||||
double rateToSI(double rawRate, Well::InjectorType wellType, const Opm::UnitSystem &unitSystem) {
|
||||
switch (wellType) {
|
||||
case Well2::InjectorType::MULTI:
|
||||
case Well::InjectorType::MULTI:
|
||||
// multi-phase controlled injectors are a really funny
|
||||
// construct in Eclipse: the quantity controlled for is
|
||||
// not physically meaningful, i.e. Eclipse adds up
|
||||
// MCFT/day and STB/day.
|
||||
throw std::logic_error("There is no generic way to handle multi-phase injectors at this level!");
|
||||
|
||||
case Well2::InjectorType::OIL:
|
||||
case Well2::InjectorType::WATER:
|
||||
case Well::InjectorType::OIL:
|
||||
case Well::InjectorType::WATER:
|
||||
return unitSystem.to_si( UnitSystem::measure::liquid_surface_rate, rawRate );
|
||||
|
||||
case Well2::InjectorType::GAS:
|
||||
case Well::InjectorType::GAS:
|
||||
return unitSystem.to_si( UnitSystem::measure::gas_surface_rate, rawRate );
|
||||
|
||||
default:
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
#define INJECTION_HPP
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
|
||||
namespace Opm {
|
||||
namespace injection {
|
||||
|
||||
double rateToSI(double rawRate, Well2::InjectorType wellType, const Opm::UnitSystem &unitSystem);
|
||||
double rateToSI(double rawRate, Well::InjectorType wellType, const Opm::UnitSystem &unitSystem);
|
||||
double rateToSI(double rawRate, Phase wellPhase, const Opm::UnitSystem& unitSystem);
|
||||
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace UDA {
|
||||
}
|
||||
|
||||
|
||||
double eval_well_uda_rate(const UDAValue& value, const std::string& well, const SummaryState& st, double udq_default, Well2::InjectorType wellType, const UnitSystem& unitSystem) {
|
||||
double eval_well_uda_rate(const UDAValue& value, const std::string& well, const SummaryState& st, double udq_default, Well::InjectorType wellType, const UnitSystem& unitSystem) {
|
||||
double raw_rate = eval_well_uda(value, well, st, udq_default);
|
||||
return injection::rateToSI(raw_rate, wellType, unitSystem);
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
|
||||
namespace Opm {
|
||||
class UDAvalue;
|
||||
@@ -32,7 +32,7 @@ class UnitSystem;
|
||||
namespace UDA {
|
||||
|
||||
double eval_well_uda(const UDAValue& value, const std::string& name, const SummaryState& st, double udq_undefined);
|
||||
double eval_well_uda_rate(const UDAValue& value, const std::string& name, const SummaryState& st, double udq_undefined, Well2::InjectorType wellType, const UnitSystem& unitSystem);
|
||||
double eval_well_uda_rate(const UDAValue& value, const std::string& name, const SummaryState& st, double udq_undefined, Well::InjectorType wellType, const UnitSystem& unitSystem);
|
||||
|
||||
double eval_group_uda(const UDAValue& value, const std::string& name, const SummaryState& st, double udq_undefined);
|
||||
double eval_group_uda_rate(const UDAValue& value, const std::string& name, const SummaryState& st, double udq_undefined, Phase phase, const UnitSystem& unitSystem);
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Tables/TableManager.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/GridDims.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQConfig.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/TimeMap.hpp>
|
||||
@@ -503,7 +503,7 @@ inline void keywordMISC( SummaryConfig::keyword_list& list,
|
||||
|
||||
for(const auto& name : well_names) {
|
||||
param.namedEntity(name);
|
||||
const auto& well = schedule.getWell2atEnd(name);
|
||||
const auto& well = schedule.getWellatEnd(name);
|
||||
/*
|
||||
* we don't want to add completions that don't exist, so we iterate
|
||||
* over a well's completions regardless of the desired block is
|
||||
@@ -542,7 +542,7 @@ inline void keywordMISC( SummaryConfig::keyword_list& list,
|
||||
|
||||
|
||||
int maxNumWellSegments(const std::size_t /* last_timestep */,
|
||||
const Well2& well)
|
||||
const Well& well)
|
||||
{
|
||||
return well.isMultiSegment()
|
||||
? well.getSegments().size() : 0;
|
||||
@@ -551,7 +551,7 @@ inline void keywordMISC( SummaryConfig::keyword_list& list,
|
||||
void makeSegmentNodes(const std::size_t last_timestep,
|
||||
const int segID,
|
||||
const DeckKeyword& keyword,
|
||||
const Well2& well,
|
||||
const Well& well,
|
||||
SummaryConfig::keyword_list& list)
|
||||
{
|
||||
if (!well.isMultiSegment())
|
||||
@@ -593,7 +593,7 @@ inline void keywordMISC( SummaryConfig::keyword_list& list,
|
||||
|
||||
const auto segID = -1;
|
||||
|
||||
for (const auto& well : schedule.getWells2atEnd())
|
||||
for (const auto& well : schedule.getWellsatEnd())
|
||||
makeSegmentNodes(last_timestep, segID, keyword,
|
||||
well, list);
|
||||
}
|
||||
@@ -637,7 +637,7 @@ inline void keywordMISC( SummaryConfig::keyword_list& list,
|
||||
? -1 : record.getItem(1).get<int>(0);
|
||||
|
||||
for (const auto& well_name : well_names)
|
||||
makeSegmentNodes(last_timestep, segID, keyword, schedule.getWell2atEnd(well_name), list);
|
||||
makeSegmentNodes(last_timestep, segID, keyword, schedule.getWellatEnd(well_name), list);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ double prod_wpr_P4(const EclipseState& es, const Schedule& /* sched */, const S
|
||||
|
||||
double inj_wir_INJ(const EclipseState& , const Schedule& sched, const SummaryState& st, const data::Solution& /* sol */, size_t report_step, double /* seconds_elapsed */) {
|
||||
if (st.has("FUINJ")) {
|
||||
const auto& well = sched.getWell2("INJ", report_step);
|
||||
const auto& well = sched.getWell("INJ", report_step);
|
||||
const auto controls = well.injectionControls(st);
|
||||
return controls.surface_rate;
|
||||
} else
|
||||
@@ -167,16 +167,16 @@ BOOST_AUTO_TEST_CASE(UDQ_SORTA_EXAMPLE) {
|
||||
|
||||
sim.run(td.schedule, io, false);
|
||||
{
|
||||
const auto& w1 = td.schedule.getWell2("P1", 1);
|
||||
const auto& w4 = td.schedule.getWell2("P4", 1);
|
||||
BOOST_CHECK(w1.getStatus() == Well2::Status::OPEN );
|
||||
BOOST_CHECK(w4.getStatus() == Well2::Status::OPEN );
|
||||
const auto& w1 = td.schedule.getWell("P1", 1);
|
||||
const auto& w4 = td.schedule.getWell("P4", 1);
|
||||
BOOST_CHECK(w1.getStatus() == Well::Status::OPEN );
|
||||
BOOST_CHECK(w4.getStatus() == Well::Status::OPEN );
|
||||
}
|
||||
{
|
||||
const auto& w1 = td.schedule.getWell2atEnd("P1");
|
||||
const auto& w4 = td.schedule.getWell2atEnd("P4");
|
||||
BOOST_CHECK(w1.getStatus() == Well2::Status::OPEN );
|
||||
BOOST_CHECK(w4.getStatus() == Well2::Status::SHUT );
|
||||
const auto& w1 = td.schedule.getWellatEnd("P1");
|
||||
const auto& w4 = td.schedule.getWellatEnd("P4");
|
||||
BOOST_CHECK(w1.getStatus() == Well::Status::OPEN );
|
||||
BOOST_CHECK(w4.getStatus() == Well::Status::SHUT );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -202,36 +202,36 @@ BOOST_AUTO_TEST_CASE(WELL_CLOSE_EXAMPLE) {
|
||||
sim.well_rate("P4", data::Rates::opt::wat, prod_wpr_P4);
|
||||
|
||||
{
|
||||
const auto& w1 = td.schedule.getWell2("P1", 15);
|
||||
const auto& w2 = td.schedule.getWell2("P2", 15);
|
||||
const auto& w3 = td.schedule.getWell2("P3", 15);
|
||||
const auto& w4 = td.schedule.getWell2("P4", 15);
|
||||
const auto& w1 = td.schedule.getWell("P1", 15);
|
||||
const auto& w2 = td.schedule.getWell("P2", 15);
|
||||
const auto& w3 = td.schedule.getWell("P3", 15);
|
||||
const auto& w4 = td.schedule.getWell("P4", 15);
|
||||
|
||||
BOOST_CHECK(w1.getStatus() == Well2::Status::OPEN );
|
||||
BOOST_CHECK(w2.getStatus() == Well2::Status::OPEN );
|
||||
BOOST_CHECK(w3.getStatus() == Well2::Status::OPEN );
|
||||
BOOST_CHECK(w4.getStatus() == Well2::Status::OPEN );
|
||||
BOOST_CHECK(w1.getStatus() == Well::Status::OPEN );
|
||||
BOOST_CHECK(w2.getStatus() == Well::Status::OPEN );
|
||||
BOOST_CHECK(w3.getStatus() == Well::Status::OPEN );
|
||||
BOOST_CHECK(w4.getStatus() == Well::Status::OPEN );
|
||||
}
|
||||
|
||||
|
||||
sim.run(td.schedule, io, false);
|
||||
{
|
||||
const auto& w1 = td.schedule.getWell2("P1", 15);
|
||||
const auto& w3 = td.schedule.getWell2("P3", 15);
|
||||
BOOST_CHECK(w1.getStatus() == Well2::Status::OPEN );
|
||||
BOOST_CHECK(w3.getStatus() == Well2::Status::OPEN );
|
||||
const auto& w1 = td.schedule.getWell("P1", 15);
|
||||
const auto& w3 = td.schedule.getWell("P3", 15);
|
||||
BOOST_CHECK(w1.getStatus() == Well::Status::OPEN );
|
||||
BOOST_CHECK(w3.getStatus() == Well::Status::OPEN );
|
||||
}
|
||||
{
|
||||
const auto& w2_5 = td.schedule.getWell2("P2", 5);
|
||||
const auto& w2_6 = td.schedule.getWell2("P2", 6);
|
||||
BOOST_CHECK(w2_5.getStatus() == Well2::Status::OPEN );
|
||||
BOOST_CHECK(w2_6.getStatus() == Well2::Status::SHUT );
|
||||
const auto& w2_5 = td.schedule.getWell("P2", 5);
|
||||
const auto& w2_6 = td.schedule.getWell("P2", 6);
|
||||
BOOST_CHECK(w2_5.getStatus() == Well::Status::OPEN );
|
||||
BOOST_CHECK(w2_6.getStatus() == Well::Status::SHUT );
|
||||
}
|
||||
{
|
||||
const auto& w4_10 = td.schedule.getWell2("P4", 10);
|
||||
const auto& w4_11 = td.schedule.getWell2("P4", 11);
|
||||
BOOST_CHECK(w4_10.getStatus() == Well2::Status::OPEN );
|
||||
BOOST_CHECK(w4_11.getStatus() == Well2::Status::SHUT );
|
||||
const auto& w4_10 = td.schedule.getWell("P4", 10);
|
||||
const auto& w4_11 = td.schedule.getWell("P4", 11);
|
||||
BOOST_CHECK(w4_10.getStatus() == Well::Status::OPEN );
|
||||
BOOST_CHECK(w4_11.getStatus() == Well::Status::SHUT );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -207,7 +207,7 @@ BOOST_AUTO_TEST_CASE(loadCOMPDATTESTSPE1) {
|
||||
Opm::Schedule sched(deck, state);
|
||||
const auto& units = deck.getActiveUnitSystem();
|
||||
|
||||
const auto& prod = sched.getWell2("PROD", 0);
|
||||
const auto& prod = sched.getWell("PROD", 0);
|
||||
const auto& connections = prod.getConnections();
|
||||
const auto& conn0 = connections[0];
|
||||
/* Expected values come from Eclipse simulation. */
|
||||
@@ -320,7 +320,7 @@ BOOST_AUTO_TEST_CASE(loadCOMPDATTESTSPE9) {
|
||||
{"PRODU26" ,3 , 0.176, 118.6}};
|
||||
|
||||
for (const auto& ec : expected) {
|
||||
const auto& well = sched.getWell2(ec.well, 0);
|
||||
const auto& well = sched.getWell(ec.well, 0);
|
||||
const auto& connections = well.getConnections();
|
||||
const auto& conn = connections[ec.ci - 1];
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <opm/parser/eclipse/EclipseState/Util/Value.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Grid/EclipseGrid.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/Group.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GuideRateModel.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Group/GuideRate.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
|
||||
@@ -44,13 +44,13 @@ using namespace Opm;
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(CreateGroup_CorrectNameAndDefaultValues) {
|
||||
Opm::Group2 group("G1" , 1, 0, 0, UnitSystem::newMETRIC());
|
||||
Opm::Group group("G1" , 1, 0, 0, UnitSystem::newMETRIC());
|
||||
BOOST_CHECK_EQUAL( "G1" , group.name() );
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(CreateGroupCreateTimeOK) {
|
||||
Opm::Group2 group("G1" , 1, 5, 0, UnitSystem::newMETRIC());
|
||||
Opm::Group group("G1" , 1, 5, 0, UnitSystem::newMETRIC());
|
||||
BOOST_CHECK_EQUAL( false, group.defined( 4 ));
|
||||
BOOST_CHECK_EQUAL( true, group.defined( 5 ));
|
||||
BOOST_CHECK_EQUAL( true, group.defined( 6 ));
|
||||
@@ -59,8 +59,8 @@ BOOST_AUTO_TEST_CASE(CreateGroupCreateTimeOK) {
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(CreateGroup_SetInjectorProducer_CorrectStatusSet) {
|
||||
Opm::Group2 group1("IGROUP" , 1, 0, 0, UnitSystem::newMETRIC());
|
||||
Opm::Group2 group2("PGROUP" , 2, 0, 0, UnitSystem::newMETRIC());
|
||||
Opm::Group group1("IGROUP" , 1, 0, 0, UnitSystem::newMETRIC());
|
||||
Opm::Group group2("PGROUP" , 2, 0, 0, UnitSystem::newMETRIC());
|
||||
|
||||
group1.setProductionGroup();
|
||||
BOOST_CHECK(group1.isProductionGroup());
|
||||
@@ -74,16 +74,16 @@ BOOST_AUTO_TEST_CASE(CreateGroup_SetInjectorProducer_CorrectStatusSet) {
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ControlModeOK) {
|
||||
Opm::Group2 group("G1" , 1, 0, 0, UnitSystem::newMETRIC());
|
||||
Opm::Group group("G1" , 1, 0, 0, UnitSystem::newMETRIC());
|
||||
Opm::SummaryState st(std::chrono::system_clock::now());
|
||||
const auto& inj = group.injectionControls(st);
|
||||
BOOST_CHECK( Opm::Group2::InjectionCMode::NONE == inj.cmode);
|
||||
BOOST_CHECK( Opm::Group::InjectionCMode::NONE == inj.cmode);
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(GroupChangePhaseSameTimeThrows) {
|
||||
Opm::Group2 group("G1" , 1, 0, 0, UnitSystem::newMETRIC());
|
||||
Opm::Group group("G1" , 1, 0, 0, UnitSystem::newMETRIC());
|
||||
Opm::SummaryState st(std::chrono::system_clock::now());
|
||||
const auto& inj = group.injectionControls(st);
|
||||
BOOST_CHECK_EQUAL( Opm::Phase::WATER , inj.phase); // Default phase - assumed WATER
|
||||
@@ -94,7 +94,7 @@ BOOST_AUTO_TEST_CASE(GroupChangePhaseSameTimeThrows) {
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(GroupDoesNotHaveWell) {
|
||||
Opm::Group2 group("G1" , 1, 0, 0, UnitSystem::newMETRIC());
|
||||
Opm::Group group("G1" , 1, 0, 0, UnitSystem::newMETRIC());
|
||||
|
||||
BOOST_CHECK_EQUAL(false , group.hasWell("NO"));
|
||||
BOOST_CHECK_EQUAL(0U , group.numWells());
|
||||
@@ -135,7 +135,7 @@ BOOST_AUTO_TEST_CASE(createDeckWithGEFAC) {
|
||||
BOOST_CHECK_EQUAL(group_names.size(), 1);
|
||||
BOOST_CHECK_EQUAL(group_names[0], "PRODUC");
|
||||
|
||||
const auto& group1 = schedule.getGroup2("PRODUC", 0);
|
||||
const auto& group1 = schedule.getGroup("PRODUC", 0);
|
||||
BOOST_CHECK_EQUAL(group1.getGroupEfficiencyFactor(), 0.85);
|
||||
BOOST_CHECK(group1.getTransferGroupEfficiencyFactor());
|
||||
}
|
||||
@@ -183,13 +183,13 @@ BOOST_AUTO_TEST_CASE(createDeckWithWGRUPCONandWCONPROD) {
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
Runspec runspec (deck );
|
||||
Opm::Schedule schedule(deck, grid, eclipseProperties, runspec);
|
||||
const auto& currentWell = schedule.getWell2("B-37T2", 0);
|
||||
const Opm::Well2::WellProductionProperties& wellProductionProperties = currentWell.getProductionProperties();
|
||||
BOOST_CHECK(wellProductionProperties.controlMode == Opm::Well2::ProducerCMode::GRUP);
|
||||
const auto& currentWell = schedule.getWell("B-37T2", 0);
|
||||
const Opm::Well::WellProductionProperties& wellProductionProperties = currentWell.getProductionProperties();
|
||||
BOOST_CHECK(wellProductionProperties.controlMode == Opm::Well::ProducerCMode::GRUP);
|
||||
|
||||
BOOST_CHECK_EQUAL(currentWell.isAvailableForGroupControl(), true);
|
||||
BOOST_CHECK_EQUAL(currentWell.getGuideRate(), 30);
|
||||
BOOST_CHECK(currentWell.getGuideRatePhase() == Opm::Well2::GuideRateTarget::OIL);
|
||||
BOOST_CHECK(currentWell.getGuideRatePhase() == Opm::Well::GuideRateTarget::OIL);
|
||||
BOOST_CHECK_EQUAL(currentWell.getGuideRateScalingFactor(), 1.0);
|
||||
|
||||
|
||||
@@ -228,18 +228,18 @@ BOOST_AUTO_TEST_CASE(createDeckWithGRUPNET) {
|
||||
Runspec runspec (deck );
|
||||
Opm::Schedule schedule(deck, grid, eclipseProperties, runspec);
|
||||
|
||||
const auto& group1 = schedule.getGroup2("PROD", 0);
|
||||
const auto& group2 = schedule.getGroup2("MANI-E2", 0);
|
||||
const auto& group3 = schedule.getGroup2("MANI-K1", 0);
|
||||
const auto& group1 = schedule.getGroup("PROD", 0);
|
||||
const auto& group2 = schedule.getGroup("MANI-E2", 0);
|
||||
const auto& group3 = schedule.getGroup("MANI-K1", 0);
|
||||
BOOST_CHECK_EQUAL(group1.getGroupNetVFPTable(), 0);
|
||||
BOOST_CHECK_EQUAL(group2.getGroupNetVFPTable(), 9);
|
||||
BOOST_CHECK_EQUAL(group3.getGroupNetVFPTable(), 9999);
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Group2Create) {
|
||||
Opm::Group2 g1("NAME", 1, 1, 0, UnitSystem::newMETRIC());
|
||||
Opm::Group2 g2("NAME", 1, 1, 0, UnitSystem::newMETRIC());
|
||||
BOOST_AUTO_TEST_CASE(GroupCreate) {
|
||||
Opm::Group g1("NAME", 1, 1, 0, UnitSystem::newMETRIC());
|
||||
Opm::Group g2("NAME", 1, 1, 0, UnitSystem::newMETRIC());
|
||||
|
||||
BOOST_CHECK( g1.addWell("W1") );
|
||||
BOOST_CHECK( !g1.addWell("W1") );
|
||||
@@ -287,14 +287,14 @@ BOOST_AUTO_TEST_CASE(createDeckWithGCONPROD) {
|
||||
Opm::Schedule schedule(deck, grid, eclipseProperties, runspec);
|
||||
SummaryState st(std::chrono::system_clock::now());
|
||||
|
||||
const auto& group1 = schedule.getGroup2("G1", 0);
|
||||
const auto& group2 = schedule.getGroup2("G2", 0);
|
||||
const auto& group1 = schedule.getGroup("G1", 0);
|
||||
const auto& group2 = schedule.getGroup("G2", 0);
|
||||
|
||||
auto ctrl1 = group1.productionControls(st);
|
||||
auto ctrl2 = group2.productionControls(st);
|
||||
|
||||
BOOST_CHECK(ctrl1.exceed_action == Group2::ExceedAction::RATE);
|
||||
BOOST_CHECK(ctrl2.exceed_action == Group2::ExceedAction::CON);
|
||||
BOOST_CHECK(ctrl1.exceed_action == Group::ExceedAction::RATE);
|
||||
BOOST_CHECK(ctrl2.exceed_action == Group::ExceedAction::CON);
|
||||
}
|
||||
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -75,16 +75,16 @@ BOOST_AUTO_TEST_CASE(WTEST_STATE2) {
|
||||
BOOST_CHECK_EQUAL(st.sizeWells(), 1);
|
||||
|
||||
const UnitSystem us{};
|
||||
std::vector<Well2> wells;
|
||||
wells.emplace_back("WELL_NAME", "A", 0, 0, 1, 1, 200., Phase::OIL, Well2::ProducerCMode::NONE, Connection::Order::TRACK, us, 0.);
|
||||
std::vector<Well> wells;
|
||||
wells.emplace_back("WELL_NAME", "A", 0, 0, 1, 1, 200., Phase::OIL, Well::ProducerCMode::NONE, Connection::Order::TRACK, us, 0.);
|
||||
{
|
||||
wells[0].updateStatus(Well2::Status::SHUT);
|
||||
wells[0].updateStatus(Well::Status::SHUT);
|
||||
auto shut_wells = st.updateWells(wc, wells, 5000);
|
||||
BOOST_CHECK_EQUAL(shut_wells.size(), 0);
|
||||
}
|
||||
|
||||
{
|
||||
wells[0].updateStatus(Well2::Status::OPEN);
|
||||
wells[0].updateStatus(Well::Status::OPEN);
|
||||
auto shut_wells = st.updateWells(wc, wells, 5000);
|
||||
BOOST_CHECK_EQUAL( shut_wells.size(), 1);
|
||||
}
|
||||
@@ -109,18 +109,18 @@ BOOST_AUTO_TEST_CASE(WTEST_STATE) {
|
||||
BOOST_CHECK_EQUAL(st.sizeWells(), 3);
|
||||
|
||||
const UnitSystem us{};
|
||||
std::vector<Well2> wells;
|
||||
wells.emplace_back("WELL_NAME", "A", 0, 0, 1, 1, 200., Phase::OIL, Well2::ProducerCMode::NONE, Connection::Order::TRACK, us, 0.);
|
||||
wells.emplace_back("WELLX", "A", 0, 0, 2, 2, 200., Phase::OIL, Well2::ProducerCMode::NONE, Connection::Order::TRACK, us, 0.);
|
||||
std::vector<Well> wells;
|
||||
wells.emplace_back("WELL_NAME", "A", 0, 0, 1, 1, 200., Phase::OIL, Well::ProducerCMode::NONE, Connection::Order::TRACK, us, 0.);
|
||||
wells.emplace_back("WELLX", "A", 0, 0, 2, 2, 200., Phase::OIL, Well::ProducerCMode::NONE, Connection::Order::TRACK, us, 0.);
|
||||
|
||||
WellTestConfig wc;
|
||||
{
|
||||
wells[0].updateStatus(Well2::Status::SHUT);
|
||||
wells[0].updateStatus(Well::Status::SHUT);
|
||||
auto shut_wells = st.updateWells(wc, wells, 110. * day);
|
||||
BOOST_CHECK_EQUAL(shut_wells.size(), 0);
|
||||
}
|
||||
{
|
||||
wells[0].updateStatus(Well2::Status::OPEN);
|
||||
wells[0].updateStatus(Well::Status::OPEN);
|
||||
auto shut_wells = st.updateWells(wc, wells, 110. * day);
|
||||
BOOST_CHECK_EQUAL(shut_wells.size(), 0);
|
||||
}
|
||||
@@ -151,10 +151,10 @@ BOOST_AUTO_TEST_CASE(WTEST_STATE) {
|
||||
wc.add_well("WELL_NAME", WellTestConfig::Reason::PHYSICAL, 1000. * day, 3, 0, 5);
|
||||
|
||||
|
||||
wells[0].updateStatus(Well2::Status::SHUT);
|
||||
wells[0].updateStatus(Well::Status::SHUT);
|
||||
BOOST_CHECK_EQUAL( st.updateWells(wc, wells, 4100. * day).size(), 0);
|
||||
|
||||
wells[0].updateStatus(Well2::Status::OPEN);
|
||||
wells[0].updateStatus(Well::Status::OPEN);
|
||||
BOOST_CHECK_EQUAL( st.updateWells(wc, wells, 4100. * day).size(), 1);
|
||||
|
||||
BOOST_CHECK_EQUAL( st.updateWells(wc, wells, 5200. * day).size(), 1);
|
||||
@@ -180,11 +180,11 @@ BOOST_AUTO_TEST_CASE(WTEST_STATE_COMPLETIONS) {
|
||||
BOOST_CHECK_EQUAL(st.sizeCompletions(), 3);
|
||||
|
||||
const UnitSystem us{};
|
||||
std::vector<Well2> wells;
|
||||
wells.emplace_back("WELL_NAME", "A", 0, 0, 1, 1, 200., Phase::OIL, Well2::ProducerCMode::NONE, Connection::Order::TRACK, us, 0.);
|
||||
wells[0].updateStatus(Well2::Status::OPEN);
|
||||
wells.emplace_back("WELLX", "A", 0, 0, 2, 2, 200., Phase::OIL, Well2::ProducerCMode::NONE, Connection::Order::TRACK, us, 0.);
|
||||
wells[1].updateStatus(Well2::Status::OPEN);
|
||||
std::vector<Well> wells;
|
||||
wells.emplace_back("WELL_NAME", "A", 0, 0, 1, 1, 200., Phase::OIL, Well::ProducerCMode::NONE, Connection::Order::TRACK, us, 0.);
|
||||
wells[0].updateStatus(Well::Status::OPEN);
|
||||
wells.emplace_back("WELLX", "A", 0, 0, 2, 2, 200., Phase::OIL, Well::ProducerCMode::NONE, Connection::Order::TRACK, us, 0.);
|
||||
wells[1].updateStatus(Well::Status::OPEN);
|
||||
|
||||
auto closed_completions = st.updateWells(wc, wells, 5000);
|
||||
BOOST_CHECK_EQUAL( closed_completions.size(), 0);
|
||||
|
||||
@@ -205,10 +205,10 @@ BOOST_AUTO_TEST_CASE(TestDynamicWSOLVENT) {
|
||||
const auto& record = keyword.getRecord(0);
|
||||
const std::string& well_name = record.getItem("WELL").getTrimmedString(0);
|
||||
BOOST_CHECK_EQUAL(well_name, "W_1");
|
||||
BOOST_CHECK_EQUAL(schedule.getWell2("W_1", 0).getSolventFraction(),0); //default 0
|
||||
BOOST_CHECK_EQUAL(schedule.getWell2("W_1", 1).getSolventFraction(),1);
|
||||
BOOST_CHECK_EQUAL(schedule.getWell2("W_1", 2).getSolventFraction(),1);
|
||||
BOOST_CHECK_EQUAL(schedule.getWell2("W_1", 3).getSolventFraction(),0);
|
||||
BOOST_CHECK_EQUAL(schedule.getWell("W_1", 0).getSolventFraction(),0); //default 0
|
||||
BOOST_CHECK_EQUAL(schedule.getWell("W_1", 1).getSolventFraction(),1);
|
||||
BOOST_CHECK_EQUAL(schedule.getWell("W_1", 2).getSolventFraction(),1);
|
||||
BOOST_CHECK_EQUAL(schedule.getWell("W_1", 3).getSolventFraction(),0);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(TestOilInjector) {
|
||||
|
||||
@@ -52,7 +52,7 @@ namespace Opm {
|
||||
inline std::ostream& operator<<( std::ostream& stream, const Connection& c ) {
|
||||
return stream << "(" << c.getI() << "," << c.getJ() << "," << c.getK() << ")";
|
||||
}
|
||||
inline std::ostream& operator<<( std::ostream& stream, const Well2& well ) {
|
||||
inline std::ostream& operator<<( std::ostream& stream, const Well& well ) {
|
||||
return stream << "(" << well.name() << ")";
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@ BOOST_AUTO_TEST_CASE(WellCOMPDATtestTRACK) {
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
Opm::Runspec runspec (deck);
|
||||
Opm::Schedule schedule(deck, grid , eclipseProperties, runspec);
|
||||
const auto& op_1 = schedule.getWell2("OP_1", 2);
|
||||
const auto& op_1 = schedule.getWell("OP_1", 2);
|
||||
|
||||
const auto& completions = op_1.getConnections();
|
||||
BOOST_CHECK_EQUAL(9U, completions.size());
|
||||
@@ -129,7 +129,7 @@ BOOST_AUTO_TEST_CASE(WellCOMPDATtestDefaultTRACK) {
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
Opm::Runspec runspec (deck);
|
||||
Opm::Schedule schedule(deck, grid , eclipseProperties, runspec);
|
||||
const auto& op_1 = schedule.getWell2("OP_1", 2);
|
||||
const auto& op_1 = schedule.getWell("OP_1", 2);
|
||||
|
||||
const auto& completions = op_1.getConnections();
|
||||
BOOST_CHECK_EQUAL(9U, completions.size());
|
||||
@@ -172,7 +172,7 @@ BOOST_AUTO_TEST_CASE(WellCOMPDATtestINPUT) {
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
Opm::Runspec runspec (deck);
|
||||
Opm::Schedule schedule(deck, grid , eclipseProperties, runspec, Opm::ParseContext(), errors);
|
||||
const auto& op_1 = schedule.getWell2("OP_1", 2);
|
||||
const auto& op_1 = schedule.getWell("OP_1", 2);
|
||||
|
||||
const auto& completions = op_1.getConnections();
|
||||
BOOST_CHECK_EQUAL(9U, completions.size());
|
||||
@@ -190,7 +190,7 @@ BOOST_AUTO_TEST_CASE(WellCOMPDATtestINPUT) {
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(NewWellZeroCompletions) {
|
||||
Opm::Well2 well("WELL1", "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well2::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well well("WELL1", "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
BOOST_CHECK_EQUAL( 0U , well.getConnections( ).size() );
|
||||
}
|
||||
|
||||
@@ -199,7 +199,7 @@ BOOST_AUTO_TEST_CASE(isProducerCorrectlySet) {
|
||||
// HACK: This test checks correctly setting of isProducer/isInjector. This property depends on which of
|
||||
// WellProductionProperties/WellInjectionProperties is set last, independent of actual values.
|
||||
{
|
||||
Opm::Well2 well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well2::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
|
||||
|
||||
/* 1: Well is created as producer */
|
||||
@@ -207,7 +207,7 @@ BOOST_AUTO_TEST_CASE(isProducerCorrectlySet) {
|
||||
BOOST_CHECK_EQUAL( true , well.isProducer());
|
||||
|
||||
/* Set a surface injection rate => Well becomes an Injector */
|
||||
auto injectionProps1 = std::make_shared<Opm::Well2::WellInjectionProperties>(well.getInjectionProperties());
|
||||
auto injectionProps1 = std::make_shared<Opm::Well::WellInjectionProperties>(well.getInjectionProperties());
|
||||
injectionProps1->surfaceInjectionRate.reset(100);
|
||||
well.updateInjection(injectionProps1);
|
||||
BOOST_CHECK_EQUAL( true , well.isInjector());
|
||||
@@ -217,10 +217,10 @@ BOOST_AUTO_TEST_CASE(isProducerCorrectlySet) {
|
||||
|
||||
|
||||
{
|
||||
Opm::Well2 well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well2::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
|
||||
/* Set a reservoir injection rate => Well becomes an Injector */
|
||||
auto injectionProps2 = std::make_shared<Opm::Well2::WellInjectionProperties>(well.getInjectionProperties());
|
||||
auto injectionProps2 = std::make_shared<Opm::Well::WellInjectionProperties>(well.getInjectionProperties());
|
||||
injectionProps2->reservoirInjectionRate.reset(200);
|
||||
well.updateInjection(injectionProps2);
|
||||
BOOST_CHECK_EQUAL( false , well.isProducer());
|
||||
@@ -228,13 +228,13 @@ BOOST_AUTO_TEST_CASE(isProducerCorrectlySet) {
|
||||
}
|
||||
|
||||
{
|
||||
Opm::Well2 well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well2::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
|
||||
/* Set rates => Well becomes a producer; injection rate should be set to 0. */
|
||||
auto injectionProps3 = std::make_shared<Opm::Well2::WellInjectionProperties>(well.getInjectionProperties());
|
||||
auto injectionProps3 = std::make_shared<Opm::Well::WellInjectionProperties>(well.getInjectionProperties());
|
||||
well.updateInjection(injectionProps3);
|
||||
|
||||
auto properties = std::make_shared<Opm::Well2::WellProductionProperties>( well.getProductionProperties() );
|
||||
auto properties = std::make_shared<Opm::Well::WellProductionProperties>( well.getProductionProperties() );
|
||||
properties->OilRate.reset(100);
|
||||
properties->GasRate.reset(200);
|
||||
properties->WaterRate.reset(300);
|
||||
@@ -251,7 +251,7 @@ BOOST_AUTO_TEST_CASE(isProducerCorrectlySet) {
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(GroupnameCorretlySet) {
|
||||
Opm::Well2 well("WELL1" , "G1", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well2::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well well("WELL1" , "G1", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
|
||||
BOOST_CHECK_EQUAL("G1" , well.groupName());
|
||||
well.updateGroup( "GROUP2");
|
||||
@@ -260,7 +260,7 @@ BOOST_AUTO_TEST_CASE(GroupnameCorretlySet) {
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(addWELSPECS_setData_dataSet) {
|
||||
Opm::Well2 well("WELL1", "GROUP", 0, 1, 23, 42, 2334.32, Opm::Phase::WATER, Opm::Well2::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well well("WELL1", "GROUP", 0, 1, 23, 42, 2334.32, Opm::Phase::WATER, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
|
||||
BOOST_CHECK_EQUAL(23, well.getHeadI());
|
||||
BOOST_CHECK_EQUAL(42, well.getHeadJ());
|
||||
@@ -270,34 +270,34 @@ BOOST_AUTO_TEST_CASE(addWELSPECS_setData_dataSet) {
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(XHPLimitDefault) {
|
||||
Opm::Well2 well("WELL1", "GROUP", 0, 1, 23, 42, 2334.32, Opm::Phase::WATER, Opm::Well2::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well well("WELL1", "GROUP", 0, 1, 23, 42, 2334.32, Opm::Phase::WATER, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
|
||||
|
||||
auto productionProps = std::make_shared<Opm::Well2::WellProductionProperties>(well.getProductionProperties());
|
||||
auto productionProps = std::make_shared<Opm::Well::WellProductionProperties>(well.getProductionProperties());
|
||||
productionProps->BHPLimit.reset(100);
|
||||
productionProps->addProductionControl(Opm::Well2::ProducerCMode::BHP);
|
||||
productionProps->addProductionControl(Opm::Well::ProducerCMode::BHP);
|
||||
well.updateProduction(productionProps);
|
||||
BOOST_CHECK_EQUAL( 100 , well.getProductionProperties().BHPLimit.get<double>());
|
||||
BOOST_CHECK_EQUAL( true, well.getProductionProperties().hasProductionControl( Opm::Well2::ProducerCMode::BHP ));
|
||||
BOOST_CHECK_EQUAL( true, well.getProductionProperties().hasProductionControl( Opm::Well::ProducerCMode::BHP ));
|
||||
|
||||
auto injProps = std::make_shared<Opm::Well2::WellInjectionProperties>(well.getInjectionProperties());
|
||||
auto injProps = std::make_shared<Opm::Well::WellInjectionProperties>(well.getInjectionProperties());
|
||||
injProps->THPLimit.reset(200);
|
||||
well.updateInjection(injProps);
|
||||
BOOST_CHECK_EQUAL( 200 , well.getInjectionProperties().THPLimit.get<double>());
|
||||
BOOST_CHECK( !well.getInjectionProperties().hasInjectionControl( Opm::Well2::InjectorCMode::THP ));
|
||||
BOOST_CHECK( !well.getInjectionProperties().hasInjectionControl( Opm::Well::InjectorCMode::THP ));
|
||||
}
|
||||
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(InjectorType) {
|
||||
Opm::Well2 well("WELL1", "GROUP", 0, 1, 23, 42, 2334.32, Opm::Phase::WATER, Opm::Well2::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well well("WELL1", "GROUP", 0, 1, 23, 42, 2334.32, Opm::Phase::WATER, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
|
||||
auto injectionProps = std::make_shared<Opm::Well2::WellInjectionProperties>(well.getInjectionProperties());
|
||||
injectionProps->injectorType = Opm::Well2::InjectorType::WATER;
|
||||
auto injectionProps = std::make_shared<Opm::Well::WellInjectionProperties>(well.getInjectionProperties());
|
||||
injectionProps->injectorType = Opm::Well::InjectorType::WATER;
|
||||
well.updateInjection(injectionProps);
|
||||
// TODO: Should we test for something other than wate here, as long as
|
||||
// the default value for InjectorType is WellInjector::WATER?
|
||||
BOOST_CHECK( Opm::Well2::InjectorType::WATER == well.getInjectionProperties().injectorType);
|
||||
BOOST_CHECK( Opm::Well::InjectorType::WATER == well.getInjectionProperties().injectorType);
|
||||
}
|
||||
|
||||
|
||||
@@ -306,26 +306,26 @@ BOOST_AUTO_TEST_CASE(InjectorType) {
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WellHaveProductionControlLimit) {
|
||||
Opm::Well2 well("WELL1", "GROUP", 0, 1, 23, 42, 2334.32, Opm::Phase::WATER, Opm::Well2::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well well("WELL1", "GROUP", 0, 1, 23, 42, 2334.32, Opm::Phase::WATER, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
|
||||
|
||||
BOOST_CHECK( !well.getProductionProperties().hasProductionControl( Opm::Well2::ProducerCMode::ORAT ));
|
||||
BOOST_CHECK( !well.getProductionProperties().hasProductionControl( Opm::Well2::ProducerCMode::RESV ));
|
||||
BOOST_CHECK( !well.getProductionProperties().hasProductionControl( Opm::Well::ProducerCMode::ORAT ));
|
||||
BOOST_CHECK( !well.getProductionProperties().hasProductionControl( Opm::Well::ProducerCMode::RESV ));
|
||||
|
||||
auto properties1 = std::make_shared<Opm::Well2::WellProductionProperties>(well.getProductionProperties());
|
||||
auto properties1 = std::make_shared<Opm::Well::WellProductionProperties>(well.getProductionProperties());
|
||||
properties1->OilRate.reset(100);
|
||||
properties1->addProductionControl(Opm::Well2::ProducerCMode::ORAT);
|
||||
properties1->addProductionControl(Opm::Well::ProducerCMode::ORAT);
|
||||
well.updateProduction(properties1);
|
||||
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::Well2::ProducerCMode::ORAT ));
|
||||
BOOST_CHECK( !well.getProductionProperties().hasProductionControl( Opm::Well2::ProducerCMode::RESV ));
|
||||
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::Well::ProducerCMode::ORAT ));
|
||||
BOOST_CHECK( !well.getProductionProperties().hasProductionControl( Opm::Well::ProducerCMode::RESV ));
|
||||
|
||||
auto properties2 = std::make_shared<Opm::Well2::WellProductionProperties>(well.getProductionProperties());
|
||||
auto properties2 = std::make_shared<Opm::Well::WellProductionProperties>(well.getProductionProperties());
|
||||
properties2->ResVRate.reset( 100 );
|
||||
properties2->addProductionControl(Opm::Well2::ProducerCMode::RESV);
|
||||
properties2->addProductionControl(Opm::Well::ProducerCMode::RESV);
|
||||
well.updateProduction(properties2);
|
||||
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::Well2::ProducerCMode::RESV ));
|
||||
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::Well::ProducerCMode::RESV ));
|
||||
|
||||
auto properties3 = std::make_shared<Opm::Well2::WellProductionProperties>(well.getProductionProperties());
|
||||
auto properties3 = std::make_shared<Opm::Well::WellProductionProperties>(well.getProductionProperties());
|
||||
properties3->OilRate.reset(100);
|
||||
properties3->WaterRate.reset(100);
|
||||
properties3->GasRate.reset(100);
|
||||
@@ -333,80 +333,80 @@ BOOST_AUTO_TEST_CASE(WellHaveProductionControlLimit) {
|
||||
properties3->ResVRate.reset(100);
|
||||
properties3->BHPLimit.reset(100);
|
||||
properties3->THPLimit.reset(100);
|
||||
properties3->addProductionControl(Opm::Well2::ProducerCMode::ORAT);
|
||||
properties3->addProductionControl(Opm::Well2::ProducerCMode::LRAT);
|
||||
properties3->addProductionControl(Opm::Well2::ProducerCMode::BHP);
|
||||
properties3->addProductionControl(Opm::Well::ProducerCMode::ORAT);
|
||||
properties3->addProductionControl(Opm::Well::ProducerCMode::LRAT);
|
||||
properties3->addProductionControl(Opm::Well::ProducerCMode::BHP);
|
||||
well.updateProduction(properties3);
|
||||
|
||||
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::Well2::ProducerCMode::ORAT ));
|
||||
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::Well2::ProducerCMode::LRAT ));
|
||||
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::Well2::ProducerCMode::BHP ));
|
||||
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::Well::ProducerCMode::ORAT ));
|
||||
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::Well::ProducerCMode::LRAT ));
|
||||
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::Well::ProducerCMode::BHP ));
|
||||
|
||||
auto properties4 = std::make_shared<Opm::Well2::WellProductionProperties>(well.getProductionProperties());
|
||||
properties4->dropProductionControl( Opm::Well2::ProducerCMode::LRAT );
|
||||
auto properties4 = std::make_shared<Opm::Well::WellProductionProperties>(well.getProductionProperties());
|
||||
properties4->dropProductionControl( Opm::Well::ProducerCMode::LRAT );
|
||||
well.updateProduction(properties4);
|
||||
|
||||
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::Well2::ProducerCMode::ORAT ));
|
||||
BOOST_CHECK(!well.getProductionProperties().hasProductionControl( Opm::Well2::ProducerCMode::LRAT ));
|
||||
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::Well2::ProducerCMode::BHP ));
|
||||
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::Well::ProducerCMode::ORAT ));
|
||||
BOOST_CHECK(!well.getProductionProperties().hasProductionControl( Opm::Well::ProducerCMode::LRAT ));
|
||||
BOOST_CHECK( well.getProductionProperties().hasProductionControl( Opm::Well::ProducerCMode::BHP ));
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WellHaveInjectionControlLimit) {
|
||||
Opm::Well2 well("WELL1", "GROUP", 0, 1, 23, 42, 2334.32, Opm::Phase::WATER, Opm::Well2::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well well("WELL1", "GROUP", 0, 1, 23, 42, 2334.32, Opm::Phase::WATER, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
|
||||
BOOST_CHECK( !well.getInjectionProperties().hasInjectionControl( Opm::Well2::InjectorCMode::RATE ));
|
||||
BOOST_CHECK( !well.getInjectionProperties().hasInjectionControl( Opm::Well2::InjectorCMode::RESV ));
|
||||
BOOST_CHECK( !well.getInjectionProperties().hasInjectionControl( Opm::Well::InjectorCMode::RATE ));
|
||||
BOOST_CHECK( !well.getInjectionProperties().hasInjectionControl( Opm::Well::InjectorCMode::RESV ));
|
||||
|
||||
auto injProps1 = std::make_shared<Opm::Well2::WellInjectionProperties>(well.getInjectionProperties());
|
||||
auto injProps1 = std::make_shared<Opm::Well::WellInjectionProperties>(well.getInjectionProperties());
|
||||
injProps1->surfaceInjectionRate.reset(100);
|
||||
injProps1->addInjectionControl(Opm::Well2::InjectorCMode::RATE);
|
||||
injProps1->addInjectionControl(Opm::Well::InjectorCMode::RATE);
|
||||
well.updateInjection(injProps1);
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well2::InjectorCMode::RATE ));
|
||||
BOOST_CHECK( !well.getInjectionProperties().hasInjectionControl( Opm::Well2::InjectorCMode::RESV ));
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well::InjectorCMode::RATE ));
|
||||
BOOST_CHECK( !well.getInjectionProperties().hasInjectionControl( Opm::Well::InjectorCMode::RESV ));
|
||||
|
||||
auto injProps2 = std::make_shared<Opm::Well2::WellInjectionProperties>(well.getInjectionProperties());
|
||||
auto injProps2 = std::make_shared<Opm::Well::WellInjectionProperties>(well.getInjectionProperties());
|
||||
injProps2->reservoirInjectionRate.reset(100);
|
||||
injProps2->addInjectionControl(Opm::Well2::InjectorCMode::RESV);
|
||||
injProps2->addInjectionControl(Opm::Well::InjectorCMode::RESV);
|
||||
well.updateInjection(injProps2);
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well2::InjectorCMode::RESV ));
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well::InjectorCMode::RESV ));
|
||||
|
||||
auto injProps3 = std::make_shared<Opm::Well2::WellInjectionProperties>(well.getInjectionProperties());
|
||||
auto injProps3 = std::make_shared<Opm::Well::WellInjectionProperties>(well.getInjectionProperties());
|
||||
injProps3->BHPLimit.reset(100);
|
||||
injProps3->addInjectionControl(Opm::Well2::InjectorCMode::BHP);
|
||||
injProps3->addInjectionControl(Opm::Well::InjectorCMode::BHP);
|
||||
injProps3->THPLimit.reset(100);
|
||||
injProps3->addInjectionControl(Opm::Well2::InjectorCMode::THP);
|
||||
injProps3->addInjectionControl(Opm::Well::InjectorCMode::THP);
|
||||
well.updateInjection(injProps3);
|
||||
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well2::InjectorCMode::RATE ));
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well2::InjectorCMode::RESV ));
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well2::InjectorCMode::THP ));
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well2::InjectorCMode::BHP ));
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well::InjectorCMode::RATE ));
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well::InjectorCMode::RESV ));
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well::InjectorCMode::THP ));
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well::InjectorCMode::BHP ));
|
||||
|
||||
|
||||
auto injProps4 = std::make_shared<Opm::Well2::WellInjectionProperties>(well.getInjectionProperties());
|
||||
injProps4->dropInjectionControl( Opm::Well2::InjectorCMode::RESV );
|
||||
auto injProps4 = std::make_shared<Opm::Well::WellInjectionProperties>(well.getInjectionProperties());
|
||||
injProps4->dropInjectionControl( Opm::Well::InjectorCMode::RESV );
|
||||
well.updateInjection(injProps4);
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well2::InjectorCMode::RATE ));
|
||||
BOOST_CHECK( !well.getInjectionProperties().hasInjectionControl( Opm::Well2::InjectorCMode::RESV ));
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well2::InjectorCMode::THP ));
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well2::InjectorCMode::BHP ));
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well::InjectorCMode::RATE ));
|
||||
BOOST_CHECK( !well.getInjectionProperties().hasInjectionControl( Opm::Well::InjectorCMode::RESV ));
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well::InjectorCMode::THP ));
|
||||
BOOST_CHECK( well.getInjectionProperties().hasInjectionControl( Opm::Well::InjectorCMode::BHP ));
|
||||
}
|
||||
/*********************************************************************/
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WellGuideRatePhase_GuideRatePhaseSet) {
|
||||
Opm::Well2 well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well2::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
|
||||
BOOST_CHECK(Opm::Well2::GuideRateTarget::UNDEFINED == well.getGuideRatePhase());
|
||||
BOOST_CHECK(Opm::Well::GuideRateTarget::UNDEFINED == well.getGuideRatePhase());
|
||||
|
||||
BOOST_CHECK(well.updateWellGuideRate(true, 100, Opm::Well2::GuideRateTarget::RAT, 66.0));
|
||||
BOOST_CHECK(Opm::Well2::GuideRateTarget::RAT == well.getGuideRatePhase());
|
||||
BOOST_CHECK(well.updateWellGuideRate(true, 100, Opm::Well::GuideRateTarget::RAT, 66.0));
|
||||
BOOST_CHECK(Opm::Well::GuideRateTarget::RAT == well.getGuideRatePhase());
|
||||
BOOST_CHECK_EQUAL(100, well.getGuideRate());
|
||||
BOOST_CHECK_EQUAL(66.0, well.getGuideRateScalingFactor());
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WellEfficiencyFactorSet) {
|
||||
Opm::Well2 well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well2::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well well("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
|
||||
BOOST_CHECK_EQUAL(1.0, well.getEfficiencyFactor());
|
||||
BOOST_CHECK( well.updateEfficiencyFactor(0.9));
|
||||
@@ -486,12 +486,12 @@ namespace {
|
||||
}
|
||||
|
||||
|
||||
Opm::Well2::WellProductionProperties properties(const std::string& input) {
|
||||
Opm::Well::WellProductionProperties properties(const std::string& input) {
|
||||
Opm::Parser parser;
|
||||
|
||||
auto deck = parser.parseString(input);
|
||||
const auto& record = deck.getKeyword("WCONHIST").getRecord(0);
|
||||
Opm::Well2::WellProductionProperties hist("W");
|
||||
Opm::Well::WellProductionProperties hist("W");
|
||||
hist.handleWCONHIST(record);
|
||||
|
||||
|
||||
@@ -538,13 +538,13 @@ namespace {
|
||||
}
|
||||
|
||||
|
||||
Opm::Well2::WellProductionProperties properties(const std::string& input)
|
||||
Opm::Well::WellProductionProperties properties(const std::string& input)
|
||||
{
|
||||
Opm::Parser parser;
|
||||
auto deck = parser.parseString(input);
|
||||
const auto& kwd = deck.getKeyword("WCONPROD");
|
||||
const auto& record = kwd.getRecord(0);
|
||||
Opm::Well2::WellProductionProperties pred("W");
|
||||
Opm::Well::WellProductionProperties pred("W");
|
||||
pred.handleWCONPROD("WELL", record);
|
||||
|
||||
return pred;
|
||||
@@ -555,100 +555,100 @@ namespace {
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WCH_All_Specified_BHP_Defaulted)
|
||||
{
|
||||
const Opm::Well2::WellProductionProperties& p =
|
||||
const Opm::Well::WellProductionProperties& p =
|
||||
WCONHIST::properties(WCONHIST::all_specified());
|
||||
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well2::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::LRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::RESV));
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::LRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::RESV));
|
||||
|
||||
BOOST_CHECK(p.controlMode == Opm::Well2::ProducerCMode::ORAT);
|
||||
BOOST_CHECK(p.controlMode == Opm::Well::ProducerCMode::ORAT);
|
||||
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well2::ProducerCMode::BHP));
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well::ProducerCMode::BHP));
|
||||
BOOST_CHECK_EQUAL(p.BHPLimit.get<double>(), 101325.);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WCH_ORAT_Defaulted_BHP_Defaulted)
|
||||
{
|
||||
const Opm::Well2::WellProductionProperties& p =
|
||||
const Opm::Well::WellProductionProperties& p =
|
||||
WCONHIST::properties(WCONHIST::orat_defaulted());
|
||||
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::ORAT));
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well2::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::LRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::RESV));
|
||||
BOOST_CHECK(p.controlMode == Opm::Well2::ProducerCMode::WRAT);
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::ORAT));
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::LRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::RESV));
|
||||
BOOST_CHECK(p.controlMode == Opm::Well::ProducerCMode::WRAT);
|
||||
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well2::ProducerCMode::BHP));
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well::ProducerCMode::BHP));
|
||||
BOOST_CHECK_EQUAL(p.BHPLimit.get<double>(), 101325.);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WCH_OWRAT_Defaulted_BHP_Defaulted)
|
||||
{
|
||||
const Opm::Well2::WellProductionProperties& p =
|
||||
const Opm::Well::WellProductionProperties& p =
|
||||
WCONHIST::properties(WCONHIST::owrat_defaulted());
|
||||
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::WRAT));
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well2::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::LRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::RESV));
|
||||
BOOST_CHECK(p.controlMode == Opm::Well2::ProducerCMode::GRAT);
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::WRAT));
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::LRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::RESV));
|
||||
BOOST_CHECK(p.controlMode == Opm::Well::ProducerCMode::GRAT);
|
||||
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well2::ProducerCMode::BHP));
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well::ProducerCMode::BHP));
|
||||
BOOST_CHECK_EQUAL(p.BHPLimit.get<double>(), 101325.);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WCH_Rates_Defaulted_BHP_Defaulted)
|
||||
{
|
||||
const Opm::Well2::WellProductionProperties& p =
|
||||
const Opm::Well::WellProductionProperties& p =
|
||||
WCONHIST::properties(WCONHIST::all_defaulted());
|
||||
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::GRAT));
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well2::ProducerCMode::LRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::RESV));
|
||||
BOOST_CHECK(p.controlMode == Opm::Well2::ProducerCMode::LRAT);
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::GRAT));
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well::ProducerCMode::LRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::RESV));
|
||||
BOOST_CHECK(p.controlMode == Opm::Well::ProducerCMode::LRAT);
|
||||
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well2::ProducerCMode::BHP));
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well::ProducerCMode::BHP));
|
||||
BOOST_CHECK_EQUAL(p.BHPLimit.get<double>(), 101325.);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WCH_Rates_Defaulted_BHP_Specified)
|
||||
{
|
||||
const Opm::Well2::WellProductionProperties& p =
|
||||
const Opm::Well::WellProductionProperties& p =
|
||||
WCONHIST::properties(WCONHIST::all_defaulted_with_bhp());
|
||||
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::LRAT));
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well2::ProducerCMode::RESV));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::LRAT));
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well::ProducerCMode::RESV));
|
||||
|
||||
BOOST_CHECK(p.controlMode == Opm::Well2::ProducerCMode::RESV);
|
||||
BOOST_CHECK(p.controlMode == Opm::Well::ProducerCMode::RESV);
|
||||
|
||||
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::Well2::ProducerCMode::BHP));
|
||||
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::Well::ProducerCMode::BHP));
|
||||
BOOST_CHECK_EQUAL(p.BHPLimit.get<double>(), 101325.);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WCH_Rates_NON_Defaulted_VFP)
|
||||
{
|
||||
const Opm::Well2::WellProductionProperties& p =
|
||||
const Opm::Well::WellProductionProperties& p =
|
||||
WCONHIST::properties(WCONHIST::all_defaulted_with_bhp_vfp_table());
|
||||
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::LRAT));
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well2::ProducerCMode::RESV));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::LRAT));
|
||||
BOOST_CHECK(p.hasProductionControl(Opm::Well::ProducerCMode::RESV));
|
||||
|
||||
BOOST_CHECK(p.controlMode == Opm::Well2::ProducerCMode::RESV);
|
||||
BOOST_CHECK(p.controlMode == Opm::Well::ProducerCMode::RESV);
|
||||
|
||||
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::Well2::ProducerCMode::BHP));
|
||||
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::Well::ProducerCMode::BHP));
|
||||
BOOST_CHECK_EQUAL(p.VFPTableNumber, 3);
|
||||
BOOST_CHECK_EQUAL(p.ALQValue, 10.);
|
||||
BOOST_CHECK_EQUAL(p.BHPLimit.get<double>(), 101325.);
|
||||
@@ -656,36 +656,36 @@ BOOST_AUTO_TEST_CASE(WCH_Rates_NON_Defaulted_VFP)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WCH_BHP_Specified)
|
||||
{
|
||||
const Opm::Well2::WellProductionProperties& p =
|
||||
const Opm::Well::WellProductionProperties& p =
|
||||
WCONHIST::properties(WCONHIST::bhp_defaulted());
|
||||
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::LRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::RESV));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::LRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::RESV));
|
||||
|
||||
BOOST_CHECK(p.controlMode == Opm::Well2::ProducerCMode::BHP);
|
||||
BOOST_CHECK(p.controlMode == Opm::Well::ProducerCMode::BHP);
|
||||
|
||||
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::Well2::ProducerCMode::BHP));
|
||||
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::Well::ProducerCMode::BHP));
|
||||
|
||||
BOOST_CHECK_EQUAL(p.BHPLimit.get<double>(), 5.e7); // 500 barsa
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WCONPROD_ORAT_CMode)
|
||||
{
|
||||
const Opm::Well2::WellProductionProperties& p = WCONPROD::properties(WCONPROD::orat_CMODE_other_defaulted());
|
||||
const Opm::Well::WellProductionProperties& p = WCONPROD::properties(WCONPROD::orat_CMODE_other_defaulted());
|
||||
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well2::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well2::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well2::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::LRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::RESV));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::THP));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::LRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::RESV));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::THP));
|
||||
|
||||
BOOST_CHECK(p.controlMode == Opm::Well2::ProducerCMode::ORAT);
|
||||
BOOST_CHECK(p.controlMode == Opm::Well::ProducerCMode::ORAT);
|
||||
|
||||
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::Well2::ProducerCMode::BHP));
|
||||
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::Well::ProducerCMode::BHP));
|
||||
|
||||
BOOST_CHECK_EQUAL(p.VFPTableNumber, 0);
|
||||
BOOST_CHECK_EQUAL(p.ALQValue, 0.);
|
||||
@@ -693,19 +693,19 @@ BOOST_AUTO_TEST_CASE(WCONPROD_ORAT_CMode)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WCONPROD_THP_CMode)
|
||||
{
|
||||
const Opm::Well2::WellProductionProperties& p =
|
||||
const Opm::Well::WellProductionProperties& p =
|
||||
WCONPROD::properties(WCONPROD::thp_CMODE());
|
||||
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well2::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well2::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well2::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::LRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::RESV));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well2::ProducerCMode::THP));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::LRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::RESV));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well::ProducerCMode::THP));
|
||||
|
||||
BOOST_CHECK(p.controlMode == Opm::Well2::ProducerCMode::THP);
|
||||
BOOST_CHECK(p.controlMode == Opm::Well::ProducerCMode::THP);
|
||||
|
||||
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::Well2::ProducerCMode::BHP));
|
||||
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::Well::ProducerCMode::BHP));
|
||||
|
||||
BOOST_CHECK_EQUAL(p.VFPTableNumber, 8);
|
||||
BOOST_CHECK_EQUAL(p.ALQValue, 13.);
|
||||
@@ -715,19 +715,19 @@ BOOST_AUTO_TEST_CASE(WCONPROD_THP_CMode)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WCONPROD_BHP_CMode)
|
||||
{
|
||||
const Opm::Well2::WellProductionProperties& p =
|
||||
const Opm::Well::WellProductionProperties& p =
|
||||
WCONPROD::properties(WCONPROD::bhp_CMODE());
|
||||
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well2::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well2::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well2::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::LRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well2::ProducerCMode::RESV));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well2::ProducerCMode::THP));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well::ProducerCMode::WRAT));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::LRAT));
|
||||
BOOST_CHECK( !p.hasProductionControl(Opm::Well::ProducerCMode::RESV));
|
||||
BOOST_CHECK( p.hasProductionControl(Opm::Well::ProducerCMode::THP));
|
||||
|
||||
BOOST_CHECK(p.controlMode == Opm::Well2::ProducerCMode::BHP);
|
||||
BOOST_CHECK(p.controlMode == Opm::Well::ProducerCMode::BHP);
|
||||
|
||||
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::Well2::ProducerCMode::BHP));
|
||||
BOOST_CHECK_EQUAL(true, p.hasProductionControl(Opm::Well::ProducerCMode::BHP));
|
||||
|
||||
BOOST_CHECK_EQUAL(p.VFPTableNumber, 8);
|
||||
BOOST_CHECK_EQUAL(p.ALQValue, 13.);
|
||||
@@ -746,19 +746,19 @@ BOOST_AUTO_TEST_CASE(BHP_CMODE)
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(CMODE_DEFAULT) {
|
||||
const Opm::Well2::WellProductionProperties Pproperties("W");
|
||||
const Opm::Well2::WellInjectionProperties Iproperties("W");
|
||||
const Opm::Well::WellProductionProperties Pproperties("W");
|
||||
const Opm::Well::WellInjectionProperties Iproperties("W");
|
||||
|
||||
BOOST_CHECK( Pproperties.controlMode == Opm::Well2::ProducerCMode::CMODE_UNDEFINED );
|
||||
BOOST_CHECK( Iproperties.controlMode == Opm::Well2::InjectorCMode::CMODE_UNDEFINED );
|
||||
BOOST_CHECK( Pproperties.controlMode == Opm::Well::ProducerCMode::CMODE_UNDEFINED );
|
||||
BOOST_CHECK( Iproperties.controlMode == Opm::Well::InjectorCMode::CMODE_UNDEFINED );
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(WELL_CONTROLS) {
|
||||
Opm::Well2 well("WELL", "GROUP", 0, 0, 0, 0, 1000, Opm::Phase::OIL, Opm::Well2::ProducerCMode::CMODE_UNDEFINED, Opm::Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well2::WellProductionProperties prod("OP1");
|
||||
Opm::Well well("WELL", "GROUP", 0, 0, 0, 0, 1000, Opm::Phase::OIL, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Opm::Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well::WellProductionProperties prod("OP1");
|
||||
Opm::SummaryState st(std::chrono::system_clock::now());
|
||||
well.productionControls(st);
|
||||
|
||||
@@ -778,14 +778,14 @@ BOOST_AUTO_TEST_CASE(WELL_CONTROLS) {
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(ExtraAccessors) {
|
||||
Opm::Well2 inj("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well2::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well2 prod("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well2::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well inj("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
Opm::Well prod("WELL1" , "GROUP", 0, 1, 0, 0, 0.0, Opm::Phase::OIL, Opm::Well::ProducerCMode::CMODE_UNDEFINED, Connection::Order::DEPTH, UnitSystem::newMETRIC(), 0);
|
||||
|
||||
auto inj_props= std::make_shared<Opm::Well2::WellInjectionProperties>(inj.getInjectionProperties());
|
||||
auto inj_props= std::make_shared<Opm::Well::WellInjectionProperties>(inj.getInjectionProperties());
|
||||
inj_props->VFPTableNumber = 100;
|
||||
inj.updateInjection(inj_props);
|
||||
|
||||
auto prod_props = std::make_shared<Opm::Well2::WellProductionProperties>( prod.getProductionProperties() );
|
||||
auto prod_props = std::make_shared<Opm::Well::WellProductionProperties>( prod.getProductionProperties() );
|
||||
prod_props->VFPTableNumber = 200;
|
||||
prod.updateProduction(prod_props);
|
||||
|
||||
|
||||
@@ -152,12 +152,12 @@ BOOST_AUTO_TEST_CASE(TestDynamicWTRACER) {
|
||||
const auto& record = keyword.getRecord(0);
|
||||
const std::string& well_name = record.getItem("WELL").getTrimmedString(0);
|
||||
BOOST_CHECK_EQUAL(well_name, "W_1");
|
||||
BOOST_CHECK_EQUAL(schedule.getWell2("W_1", 0).getTracerProperties().getConcentration("I1"),0); //default 0
|
||||
BOOST_CHECK_EQUAL(schedule.getWell2("W_1", 0).getTracerProperties().getConcentration("I2"),0); //default 0
|
||||
BOOST_CHECK_EQUAL(schedule.getWell2("W_1", 1).getTracerProperties().getConcentration("I1"),1);
|
||||
BOOST_CHECK_EQUAL(schedule.getWell2("W_1", 2).getTracerProperties().getConcentration("I1"),1);
|
||||
BOOST_CHECK_EQUAL(schedule.getWell2("W_1", 4).getTracerProperties().getConcentration("I1"),0);
|
||||
BOOST_CHECK_EQUAL(schedule.getWell2("W_1", 4).getTracerProperties().getConcentration("I2"),1);
|
||||
BOOST_CHECK_EQUAL(schedule.getWell("W_1", 0).getTracerProperties().getConcentration("I1"),0); //default 0
|
||||
BOOST_CHECK_EQUAL(schedule.getWell("W_1", 0).getTracerProperties().getConcentration("I2"),0); //default 0
|
||||
BOOST_CHECK_EQUAL(schedule.getWell("W_1", 1).getTracerProperties().getConcentration("I1"),1);
|
||||
BOOST_CHECK_EQUAL(schedule.getWell("W_1", 2).getTracerProperties().getConcentration("I1"),1);
|
||||
BOOST_CHECK_EQUAL(schedule.getWell("W_1", 4).getTracerProperties().getConcentration("I1"),0);
|
||||
BOOST_CHECK_EQUAL(schedule.getWell("W_1", 4).getTracerProperties().getConcentration("I2"),1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -579,7 +579,7 @@ BOOST_AUTO_TEST_CASE( MULTISEGMENT_ABS ) {
|
||||
// checking the relation between segments and completions
|
||||
// and also the depth of completions
|
||||
BOOST_CHECK(sched.hasWell("PROD01"));
|
||||
const auto& well = sched.getWell2("PROD01", 0);
|
||||
const auto& well = sched.getWell("PROD01", 0);
|
||||
const auto& connections = well.getConnections();
|
||||
BOOST_CHECK_EQUAL(7U, connections.size());
|
||||
|
||||
@@ -1363,22 +1363,22 @@ BOOST_AUTO_TEST_CASE( WCONPROD ) {
|
||||
BOOST_CHECK(sched.hasWell("PROX5"));
|
||||
|
||||
{
|
||||
const auto& well0 = sched.getWell2("PROD2", 0 );
|
||||
const auto& well1 = sched.getWell2("PROD2", 1 );
|
||||
const auto& well0 = sched.getWell("PROD2", 0 );
|
||||
const auto& well1 = sched.getWell("PROD2", 1 );
|
||||
BOOST_CHECK_CLOSE(1000/Metric::Time, well0.getProductionProperties().OilRate.get<double>(), 0.001);
|
||||
BOOST_CHECK_CLOSE(1500/Metric::Time, well1.getProductionProperties().OilRate.get<double>(), 0.001);
|
||||
}
|
||||
|
||||
{
|
||||
const auto& well0 = sched.getWell2("PROD3", 0 );
|
||||
const auto& well1 = sched.getWell2("PROD3", 1 );
|
||||
const auto& well0 = sched.getWell("PROD3", 0 );
|
||||
const auto& well1 = sched.getWell("PROD3", 1 );
|
||||
BOOST_CHECK_CLOSE(0/Metric::Time, well0.getProductionProperties().OilRate.get<double>(), 0.001);
|
||||
BOOST_CHECK_CLOSE(1500/Metric::Time, well1.getProductionProperties().OilRate.get<double>(), 0.001);
|
||||
}
|
||||
|
||||
{
|
||||
const auto& well0 = sched.getWell2("PROX5", 0);
|
||||
const auto& well1 = sched.getWell2("PROX5", 1);
|
||||
const auto& well0 = sched.getWell("PROX5", 0);
|
||||
const auto& well1 = sched.getWell("PROX5", 1);
|
||||
BOOST_CHECK_CLOSE(2000/Metric::Time, well0.getProductionProperties().OilRate.get<double>(), 0.001);
|
||||
BOOST_CHECK_CLOSE(2000/Metric::Time, well1.getProductionProperties().OilRate.get<double>(), 0.001);
|
||||
}
|
||||
@@ -1404,8 +1404,8 @@ BOOST_AUTO_TEST_CASE( WCONINJE ) {
|
||||
BOOST_CHECK(sched.hasWell("INJX5"));
|
||||
|
||||
{
|
||||
const auto& well0 = sched.getWell2("INJE2", 0);
|
||||
const auto& well1 = sched.getWell2("INJE2", 1);
|
||||
const auto& well0 = sched.getWell("INJE2", 0);
|
||||
const auto& well1 = sched.getWell("INJE2", 1);
|
||||
const auto controls0 = well0.injectionControls(st);
|
||||
const auto controls1 = well1.injectionControls(st);
|
||||
BOOST_CHECK_CLOSE(1000/Metric::Time, controls0.surface_rate, 0.001);
|
||||
@@ -1413,14 +1413,14 @@ BOOST_AUTO_TEST_CASE( WCONINJE ) {
|
||||
}
|
||||
|
||||
{
|
||||
const auto& well1 = sched.getWell2("INJE3", 1);
|
||||
const auto& well1 = sched.getWell("INJE3", 1);
|
||||
const auto controls1 = well1.injectionControls(st);
|
||||
BOOST_CHECK_CLOSE(1500/Metric::Time, controls1.surface_rate, 0.001);
|
||||
}
|
||||
|
||||
{
|
||||
const auto& well0 = sched.getWell2("INJX5", 0);
|
||||
const auto& well1 = sched.getWell2("INJX5", 1);
|
||||
const auto& well0 = sched.getWell("INJX5", 0);
|
||||
const auto& well1 = sched.getWell("INJX5", 1);
|
||||
const auto controls0 = well0.injectionControls(st);
|
||||
const auto controls1 = well1.injectionControls(st);
|
||||
BOOST_CHECK_CLOSE(2000/Metric::Time, controls0.surface_rate, 0.001);
|
||||
|
||||
@@ -113,9 +113,9 @@ BOOST_AUTO_TEST_CASE(WellTestRefDepth) {
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck , grid , eclipseProperties, runspec);
|
||||
|
||||
const auto& well1 = sched.getWell2atEnd("W_1");
|
||||
const auto& well2 = sched.getWell2atEnd("W_2");
|
||||
const auto& well4 = sched.getWell2atEnd("W_4");
|
||||
const auto& well1 = sched.getWellatEnd("W_1");
|
||||
const auto& well2 = sched.getWellatEnd("W_2");
|
||||
const auto& well4 = sched.getWellatEnd("W_4");
|
||||
BOOST_CHECK_EQUAL( well1.getRefDepth() , grid.getCellDepth( 29 , 36 , 0 ));
|
||||
BOOST_CHECK_EQUAL( well2.getRefDepth() , 100 );
|
||||
BOOST_CHECK_THROW( well4.getRefDepth() , std::invalid_argument );
|
||||
@@ -140,10 +140,10 @@ BOOST_AUTO_TEST_CASE(WellTesting) {
|
||||
BOOST_CHECK(sched.hasWell("W_2"));
|
||||
BOOST_CHECK(sched.hasWell("W_3"));
|
||||
|
||||
BOOST_CHECK_CLOSE( 777/Metric::Time , sched.getWell2("W_2", 7).getProductionProperties().ResVRate.get<double>() , 0.0001);
|
||||
BOOST_CHECK_EQUAL( 0 , sched.getWell2("W_2", 8).getProductionProperties().ResVRate.get<double>());
|
||||
BOOST_CHECK_CLOSE( 777/Metric::Time , sched.getWell("W_2", 7).getProductionProperties().ResVRate.get<double>() , 0.0001);
|
||||
BOOST_CHECK_EQUAL( 0 , sched.getWell("W_2", 8).getProductionProperties().ResVRate.get<double>());
|
||||
|
||||
BOOST_CHECK( Well2::Status::SHUT == sched.getWell2("W_2", 3).getStatus());
|
||||
BOOST_CHECK( Well::Status::SHUT == sched.getWell("W_2", 3).getStatus());
|
||||
|
||||
{
|
||||
const auto& rft_config = sched.rftConfig();
|
||||
@@ -154,82 +154,82 @@ BOOST_AUTO_TEST_CASE(WellTesting) {
|
||||
BOOST_CHECK( rft_config.rft("W_1", 3));
|
||||
}
|
||||
{
|
||||
const auto & prop3 = sched.getWell2("W_2", 3).getProductionProperties();
|
||||
BOOST_CHECK( Well2::ProducerCMode::ORAT == prop3.controlMode);
|
||||
BOOST_CHECK( prop3.hasProductionControl(Well2::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( !prop3.hasProductionControl(Well2::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !prop3.hasProductionControl(Well2::ProducerCMode::WRAT));
|
||||
const auto & prop3 = sched.getWell("W_2", 3).getProductionProperties();
|
||||
BOOST_CHECK( Well::ProducerCMode::ORAT == prop3.controlMode);
|
||||
BOOST_CHECK( prop3.hasProductionControl(Well::ProducerCMode::ORAT));
|
||||
BOOST_CHECK( !prop3.hasProductionControl(Well::ProducerCMode::GRAT));
|
||||
BOOST_CHECK( !prop3.hasProductionControl(Well::ProducerCMode::WRAT));
|
||||
}
|
||||
|
||||
|
||||
BOOST_CHECK( Well2::Status::AUTO == sched.getWell2("W_3", 3).getStatus());
|
||||
BOOST_CHECK( Well::Status::AUTO == sched.getWell("W_3", 3).getStatus());
|
||||
{
|
||||
const auto& prop7 = sched.getWell2("W_3", 7).getProductionProperties();
|
||||
const auto& prop7 = sched.getWell("W_3", 7).getProductionProperties();
|
||||
BOOST_CHECK_CLOSE( 999/Metric::Time , prop7.LiquidRate.get<double>() , 0.001);
|
||||
BOOST_CHECK( Well2::ProducerCMode::RESV == prop7.controlMode);
|
||||
BOOST_CHECK( Well::ProducerCMode::RESV == prop7.controlMode);
|
||||
}
|
||||
BOOST_CHECK_CLOSE( 8000./Metric::Time , sched.getWell2("W_3", 3).getProductionProperties().LiquidRate.get<double>(), 1.e-12);
|
||||
BOOST_CHECK_CLOSE( 18000./Metric::Time, sched.getWell2("W_3", 8).getProductionProperties().LiquidRate.get<double>(), 1.e-12);
|
||||
BOOST_CHECK_CLOSE( 8000./Metric::Time , sched.getWell("W_3", 3).getProductionProperties().LiquidRate.get<double>(), 1.e-12);
|
||||
BOOST_CHECK_CLOSE( 18000./Metric::Time, sched.getWell("W_3", 8).getProductionProperties().LiquidRate.get<double>(), 1.e-12);
|
||||
|
||||
|
||||
{
|
||||
BOOST_CHECK_EQUAL(sched.getWell2("W_1", 3).getProductionProperties().predictionMode, false);
|
||||
BOOST_CHECK_CLOSE(sched.getWell2("W_1", 3).getProductionProperties().WaterRate.get<double>() , 4/Metric::Time, 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell2("W_1", 3).getProductionProperties().GasRate.get<double>() , 12345/Metric::Time, 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell2("W_1", 3).getProductionProperties().OilRate.get<double>() , 4000/Metric::Time, 0.001);
|
||||
BOOST_CHECK_EQUAL(sched.getWell("W_1", 3).getProductionProperties().predictionMode, false);
|
||||
BOOST_CHECK_CLOSE(sched.getWell("W_1", 3).getProductionProperties().WaterRate.get<double>() , 4/Metric::Time, 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell("W_1", 3).getProductionProperties().GasRate.get<double>() , 12345/Metric::Time, 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell("W_1", 3).getProductionProperties().OilRate.get<double>() , 4000/Metric::Time, 0.001);
|
||||
|
||||
BOOST_CHECK_CLOSE(sched.getWell2("W_1", 4).getProductionProperties().OilRate.get<double>() , 4000/Metric::Time, 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell2("W_1", 4).getProductionProperties().WaterRate.get<double>() , 4/Metric::Time, 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell2("W_1", 4).getProductionProperties().GasRate.get<double>() , 12345/Metric::Time,0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell("W_1", 4).getProductionProperties().OilRate.get<double>() , 4000/Metric::Time, 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell("W_1", 4).getProductionProperties().WaterRate.get<double>() , 4/Metric::Time, 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell("W_1", 4).getProductionProperties().GasRate.get<double>() , 12345/Metric::Time,0.001);
|
||||
|
||||
BOOST_CHECK_CLOSE(sched.getWell2("W_1", 5).getProductionProperties().WaterRate.get<double>(), 4/Metric::Time, 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell2("W_1", 5).getProductionProperties().GasRate.get<double>() , 12345/Metric::Time, 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell2("W_1", 5).getProductionProperties().OilRate.get<double>() , 4000/Metric::Time, 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell("W_1", 5).getProductionProperties().WaterRate.get<double>(), 4/Metric::Time, 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell("W_1", 5).getProductionProperties().GasRate.get<double>() , 12345/Metric::Time, 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell("W_1", 5).getProductionProperties().OilRate.get<double>() , 4000/Metric::Time, 0.001);
|
||||
|
||||
|
||||
BOOST_CHECK_EQUAL(sched.getWell2("W_1", 6).getProductionProperties().predictionMode, false);
|
||||
BOOST_CHECK_CLOSE(sched.getWell2("W_1", 6).getProductionProperties().OilRate.get<double>() , 14000/Metric::Time, 0.001);
|
||||
BOOST_CHECK_EQUAL(sched.getWell("W_1", 6).getProductionProperties().predictionMode, false);
|
||||
BOOST_CHECK_CLOSE(sched.getWell("W_1", 6).getProductionProperties().OilRate.get<double>() , 14000/Metric::Time, 0.001);
|
||||
|
||||
BOOST_CHECK_EQUAL(sched.getWell2("W_1", 7).getProductionProperties().predictionMode, true);
|
||||
BOOST_CHECK_CLOSE(sched.getWell2("W_1", 7).getProductionProperties().OilRate.get<double>() , 11000/Metric::Time, 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell2("W_1", 7).getProductionProperties().WaterRate.get<double>() , 44/Metric::Time, 0.001);
|
||||
BOOST_CHECK_EQUAL(sched.getWell("W_1", 7).getProductionProperties().predictionMode, true);
|
||||
BOOST_CHECK_CLOSE(sched.getWell("W_1", 7).getProductionProperties().OilRate.get<double>() , 11000/Metric::Time, 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell("W_1", 7).getProductionProperties().WaterRate.get<double>() , 44/Metric::Time, 0.001);
|
||||
|
||||
|
||||
BOOST_CHECK_EQUAL(sched.getWell2("W_1", 8).getProductionProperties().predictionMode, false);
|
||||
BOOST_CHECK_CLOSE(sched.getWell2("W_1", 8).getProductionProperties().OilRate.get<double>() , 13000/Metric::Time , 0.001);
|
||||
BOOST_CHECK_EQUAL(sched.getWell("W_1", 8).getProductionProperties().predictionMode, false);
|
||||
BOOST_CHECK_CLOSE(sched.getWell("W_1", 8).getProductionProperties().OilRate.get<double>() , 13000/Metric::Time , 0.001);
|
||||
|
||||
BOOST_CHECK_CLOSE(sched.getWell2("W_1", 10).getInjectionProperties().BHPLimit.get<double>(), 123.00 * Metric::Pressure , 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell2("W_1", 10).getInjectionProperties().THPLimit.get<double>(), 678.00 * Metric::Pressure , 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell("W_1", 10).getInjectionProperties().BHPLimit.get<double>(), 123.00 * Metric::Pressure , 0.001);
|
||||
BOOST_CHECK_CLOSE(sched.getWell("W_1", 10).getInjectionProperties().THPLimit.get<double>(), 678.00 * Metric::Pressure , 0.001);
|
||||
|
||||
|
||||
|
||||
BOOST_CHECK( sched.getWell2("W_1", 9).isInjector());
|
||||
BOOST_CHECK( sched.getWell("W_1", 9).isInjector());
|
||||
{
|
||||
SummaryState st(std::chrono::system_clock::now());
|
||||
const auto controls = sched.getWell2("W_1", 9).injectionControls(st);
|
||||
const auto controls = sched.getWell("W_1", 9).injectionControls(st);
|
||||
BOOST_CHECK_CLOSE(20000/Metric::Time , controls.surface_rate , 0.001);
|
||||
BOOST_CHECK_CLOSE(200000/Metric::Time , controls.reservoir_rate, 0.001);
|
||||
BOOST_CHECK_CLOSE(6895 * Metric::Pressure , controls.bhp_limit, 0.001);
|
||||
BOOST_CHECK_CLOSE(0 , controls.thp_limit , 0.001);
|
||||
BOOST_CHECK( Well2::InjectorCMode::RESV == controls.cmode);
|
||||
BOOST_CHECK( controls.hasControl(Well2::InjectorCMode::RATE ));
|
||||
BOOST_CHECK( controls.hasControl(Well2::InjectorCMode::RESV ));
|
||||
BOOST_CHECK( !controls.hasControl(Well2::InjectorCMode::THP));
|
||||
BOOST_CHECK( controls.hasControl(Well2::InjectorCMode::BHP));
|
||||
BOOST_CHECK( Well::InjectorCMode::RESV == controls.cmode);
|
||||
BOOST_CHECK( controls.hasControl(Well::InjectorCMode::RATE ));
|
||||
BOOST_CHECK( controls.hasControl(Well::InjectorCMode::RESV ));
|
||||
BOOST_CHECK( !controls.hasControl(Well::InjectorCMode::THP));
|
||||
BOOST_CHECK( controls.hasControl(Well::InjectorCMode::BHP));
|
||||
}
|
||||
|
||||
|
||||
BOOST_CHECK( Well2::Status::OPEN == sched.getWell2("W_1", 11).getStatus( ));
|
||||
BOOST_CHECK( Well2::Status::OPEN == sched.getWell2("W_1", 12).getStatus( ));
|
||||
BOOST_CHECK( Well2::Status::SHUT == sched.getWell2("W_1", 13).getStatus( ));
|
||||
BOOST_CHECK( Well2::Status::OPEN == sched.getWell2("W_1", 14).getStatus( ));
|
||||
BOOST_CHECK( Well::Status::OPEN == sched.getWell("W_1", 11).getStatus( ));
|
||||
BOOST_CHECK( Well::Status::OPEN == sched.getWell("W_1", 12).getStatus( ));
|
||||
BOOST_CHECK( Well::Status::SHUT == sched.getWell("W_1", 13).getStatus( ));
|
||||
BOOST_CHECK( Well::Status::OPEN == sched.getWell("W_1", 14).getStatus( ));
|
||||
{
|
||||
SummaryState st(std::chrono::system_clock::now());
|
||||
const auto controls = sched.getWell2("W_1", 12).injectionControls(st);
|
||||
BOOST_CHECK( controls.hasControl(Well2::InjectorCMode::RATE ));
|
||||
BOOST_CHECK( !controls.hasControl(Well2::InjectorCMode::RESV));
|
||||
BOOST_CHECK( controls.hasControl(Well2::InjectorCMode::THP ));
|
||||
BOOST_CHECK( controls.hasControl(Well2::InjectorCMode::BHP ));
|
||||
const auto controls = sched.getWell("W_1", 12).injectionControls(st);
|
||||
BOOST_CHECK( controls.hasControl(Well::InjectorCMode::RATE ));
|
||||
BOOST_CHECK( !controls.hasControl(Well::InjectorCMode::RESV));
|
||||
BOOST_CHECK( controls.hasControl(Well::InjectorCMode::THP ));
|
||||
BOOST_CHECK( controls.hasControl(Well::InjectorCMode::BHP ));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -262,16 +262,16 @@ BOOST_AUTO_TEST_CASE(WellTestCOMPDAT) {
|
||||
BOOST_CHECK(sched.hasWell("W_2"));
|
||||
BOOST_CHECK(sched.hasWell("W_3"));
|
||||
{
|
||||
BOOST_CHECK_CLOSE(13000/Metric::Time , sched.getWell2("W_1", 8).getProductionProperties().OilRate.get<double>() , 0.0001);
|
||||
BOOST_CHECK_CLOSE(13000/Metric::Time , sched.getWell("W_1", 8).getProductionProperties().OilRate.get<double>() , 0.0001);
|
||||
{
|
||||
const auto& connections = sched.getWell2("W_1", 3).getConnections();
|
||||
const auto& connections = sched.getWell("W_1", 3).getConnections();
|
||||
BOOST_CHECK_EQUAL(4U, connections.size());
|
||||
|
||||
BOOST_CHECK(Connection::State::OPEN == connections.get(3).state());
|
||||
BOOST_CHECK_EQUAL(2.2836805555555556e-12 , connections.get(3).CF());
|
||||
}
|
||||
{
|
||||
const auto& connections = sched.getWell2("W_1", 7).getConnections();
|
||||
const auto& connections = sched.getWell("W_1", 7).getConnections();
|
||||
BOOST_CHECK_EQUAL(4U, connections.size() );
|
||||
BOOST_CHECK(Connection::State::SHUT == connections.get( 3 ).state() );
|
||||
}
|
||||
@@ -313,9 +313,9 @@ BOOST_AUTO_TEST_CASE(GroupTreeTest_GRUPTREE_WITH_REPARENT_correct_tree) {
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , eclipseProperties, runspec);
|
||||
|
||||
const auto& field_group = sched.getGroup2("FIELD", 1);
|
||||
const auto& new_group = sched.getGroup2("GROUP_NEW", 1);
|
||||
const auto& nils_group = sched.getGroup2("GROUP_NILS", 1);
|
||||
const auto& field_group = sched.getGroup("FIELD", 1);
|
||||
const auto& new_group = sched.getGroup("GROUP_NEW", 1);
|
||||
const auto& nils_group = sched.getGroup("GROUP_NILS", 1);
|
||||
BOOST_CHECK_EQUAL(field_group.groups().size(), 2);
|
||||
BOOST_CHECK( field_group.hasGroup("GROUP_NEW"));
|
||||
BOOST_CHECK( field_group.hasGroup("GROUP_BJARNE"));
|
||||
@@ -340,10 +340,10 @@ BOOST_AUTO_TEST_CASE( WellTestGroups ) {
|
||||
BOOST_CHECK( sched.hasGroup( "OP" ));
|
||||
|
||||
{
|
||||
auto& group = sched.getGroup2("INJ", 3);
|
||||
auto& group = sched.getGroup("INJ", 3);
|
||||
const auto& injection = group.injectionControls(st);
|
||||
BOOST_CHECK_EQUAL( Phase::WATER , injection.phase);
|
||||
BOOST_CHECK( Group2::InjectionCMode::VREP == injection.cmode);
|
||||
BOOST_CHECK( Group::InjectionCMode::VREP == injection.cmode);
|
||||
BOOST_CHECK_CLOSE( 10/Metric::Time , injection.surface_max_rate, 0.001);
|
||||
BOOST_CHECK_CLOSE( 20/Metric::Time , injection.resv_max_rate, 0.001);
|
||||
BOOST_CHECK_EQUAL( 0.75 , injection.target_reinj_fraction);
|
||||
@@ -353,18 +353,18 @@ BOOST_AUTO_TEST_CASE( WellTestGroups ) {
|
||||
BOOST_CHECK(group.isInjectionGroup());
|
||||
}
|
||||
{
|
||||
auto& group = sched.getGroup2("INJ", 6);
|
||||
auto& group = sched.getGroup("INJ", 6);
|
||||
const auto& injection = group.injectionControls(st);
|
||||
BOOST_CHECK_EQUAL( Phase::OIL , injection.phase);
|
||||
BOOST_CHECK( Group2::InjectionCMode::RATE == injection.cmode);
|
||||
BOOST_CHECK( Group::InjectionCMode::RATE == injection.cmode);
|
||||
BOOST_CHECK_CLOSE( 1000/Metric::Time , injection.surface_max_rate, 0.0001);
|
||||
BOOST_CHECK(group.isInjectionGroup());
|
||||
}
|
||||
|
||||
{
|
||||
auto& group = sched.getGroup2("OP", 3);
|
||||
auto& group = sched.getGroup("OP", 3);
|
||||
const auto& production = group.productionControls(st);
|
||||
BOOST_CHECK( Group2::ProductionCMode::ORAT == production.cmode);
|
||||
BOOST_CHECK( Group::ProductionCMode::ORAT == production.cmode);
|
||||
BOOST_CHECK_CLOSE( 10/Metric::Time , production.oil_target , 0.001);
|
||||
BOOST_CHECK_CLOSE( 20/Metric::Time , production.water_target , 0.001);
|
||||
BOOST_CHECK_CLOSE( 30/Metric::Time , production.gas_target , 0.001);
|
||||
@@ -386,7 +386,7 @@ BOOST_AUTO_TEST_CASE( WellTestGroupAndWellRelation ) {
|
||||
Schedule sched(deck, grid , eclipseProperties, runspec);
|
||||
|
||||
{
|
||||
auto& group1 = sched.getGroup2("GROUP1", 0);
|
||||
auto& group1 = sched.getGroup("GROUP1", 0);
|
||||
|
||||
BOOST_CHECK( group1.defined(0));
|
||||
BOOST_CHECK( group1.hasWell("W_1"));
|
||||
@@ -394,8 +394,8 @@ BOOST_AUTO_TEST_CASE( WellTestGroupAndWellRelation ) {
|
||||
}
|
||||
|
||||
{
|
||||
auto& group1 = sched.getGroup2("GROUP1", 1);
|
||||
auto& group2 = sched.getGroup2("GROUP2", 1);
|
||||
auto& group1 = sched.getGroup("GROUP1", 1);
|
||||
auto& group2 = sched.getGroup("GROUP2", 1);
|
||||
|
||||
BOOST_CHECK( group1.hasWell("W_1"));
|
||||
BOOST_CHECK( !group1.hasWell("W_2"));
|
||||
@@ -447,22 +447,22 @@ BOOST_AUTO_TEST_CASE(WellTestWGRUPCONWellPropertiesSet) {
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , eclipseProperties, runspec);
|
||||
|
||||
const auto& well1 = sched.getWell2("W_1", 0);
|
||||
const auto& well1 = sched.getWell("W_1", 0);
|
||||
BOOST_CHECK(well1.isAvailableForGroupControl( ));
|
||||
BOOST_CHECK_EQUAL(-1, well1.getGuideRate( ));
|
||||
BOOST_CHECK(Well2::GuideRateTarget::OIL == well1.getGuideRatePhase( ));
|
||||
BOOST_CHECK(Well::GuideRateTarget::OIL == well1.getGuideRatePhase( ));
|
||||
BOOST_CHECK_EQUAL(1.0, well1.getGuideRateScalingFactor( ));
|
||||
|
||||
const auto& well2 = sched.getWell2("W_2", 0);
|
||||
const auto& well2 = sched.getWell("W_2", 0);
|
||||
BOOST_CHECK(!well2.isAvailableForGroupControl( ));
|
||||
BOOST_CHECK_EQUAL(-1, well2.getGuideRate( ));
|
||||
BOOST_CHECK(Well2::GuideRateTarget::UNDEFINED == well2.getGuideRatePhase( ));
|
||||
BOOST_CHECK(Well::GuideRateTarget::UNDEFINED == well2.getGuideRatePhase( ));
|
||||
BOOST_CHECK_EQUAL(1.0, well2.getGuideRateScalingFactor( ));
|
||||
|
||||
const auto& well3 = sched.getWell2("W_3", 0);
|
||||
const auto& well3 = sched.getWell("W_3", 0);
|
||||
BOOST_CHECK(well3.isAvailableForGroupControl( ));
|
||||
BOOST_CHECK_EQUAL(100, well3.getGuideRate( ));
|
||||
BOOST_CHECK(Well2::GuideRateTarget::RAT == well3.getGuideRatePhase( ));
|
||||
BOOST_CHECK(Well::GuideRateTarget::RAT == well3.getGuideRatePhase( ));
|
||||
BOOST_CHECK_EQUAL(0.5, well3.getGuideRateScalingFactor( ));
|
||||
}
|
||||
|
||||
@@ -494,7 +494,7 @@ COMPDAT \n\
|
||||
Eclipse3DProperties eclipseProperties ( deck , table, grid);
|
||||
Runspec runspec (deck);
|
||||
Schedule sched(deck, grid , eclipseProperties, runspec);
|
||||
const auto& connections = sched.getWell2("W1", 0).getConnections();
|
||||
const auto& connections = sched.getWell("W1", 0).getConnections();
|
||||
BOOST_CHECK_EQUAL( 10 , connections.get(0).getI() );
|
||||
BOOST_CHECK_EQUAL( 20 , connections.get(0).getJ() );
|
||||
}
|
||||
@@ -529,20 +529,20 @@ BOOST_AUTO_TEST_CASE(WELLS_SHUT) {
|
||||
|
||||
|
||||
{
|
||||
const auto& well1 = sched.getWell2("W1", 1);
|
||||
const auto& well2 = sched.getWell2("W2", 1);
|
||||
const auto& well3 = sched.getWell2("W3", 1);
|
||||
BOOST_CHECK( Well2::Status::OPEN == well1.getStatus());
|
||||
BOOST_CHECK( Well2::Status::OPEN == well2.getStatus());
|
||||
BOOST_CHECK( Well2::Status::OPEN == well3.getStatus());
|
||||
const auto& well1 = sched.getWell("W1", 1);
|
||||
const auto& well2 = sched.getWell("W2", 1);
|
||||
const auto& well3 = sched.getWell("W3", 1);
|
||||
BOOST_CHECK( Well::Status::OPEN == well1.getStatus());
|
||||
BOOST_CHECK( Well::Status::OPEN == well2.getStatus());
|
||||
BOOST_CHECK( Well::Status::OPEN == well3.getStatus());
|
||||
}
|
||||
{
|
||||
const auto& well1 = sched.getWell2("W1", 2);
|
||||
const auto& well2 = sched.getWell2("W2", 2);
|
||||
const auto& well3 = sched.getWell2("W3", 2);
|
||||
BOOST_CHECK( Well2::Status::SHUT == well1.getStatus());
|
||||
BOOST_CHECK( Well2::Status::SHUT == well2.getStatus());
|
||||
BOOST_CHECK( Well2::Status::SHUT == well3.getStatus());
|
||||
const auto& well1 = sched.getWell("W1", 2);
|
||||
const auto& well2 = sched.getWell("W2", 2);
|
||||
const auto& well3 = sched.getWell("W3", 2);
|
||||
BOOST_CHECK( Well::Status::SHUT == well1.getStatus());
|
||||
BOOST_CHECK( Well::Status::SHUT == well2.getStatus());
|
||||
BOOST_CHECK( Well::Status::SHUT == well3.getStatus());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -563,51 +563,51 @@ BOOST_AUTO_TEST_CASE(WellTestWPOLYMER) {
|
||||
BOOST_CHECK(sched.hasWell("PROD01"));
|
||||
|
||||
{
|
||||
const auto& well1 = sched.getWell2("INJE01", 0);
|
||||
const auto& well1 = sched.getWell("INJE01", 0);
|
||||
BOOST_CHECK( well1.isInjector());
|
||||
const WellPolymerProperties& props_well10 = well1.getPolymerProperties();
|
||||
BOOST_CHECK_CLOSE(1.5*Metric::PolymerDensity, props_well10.m_polymerConcentration, 0.0001);
|
||||
}
|
||||
{
|
||||
const auto& well1 = sched.getWell2("INJE01", 1);
|
||||
const auto& well1 = sched.getWell("INJE01", 1);
|
||||
const WellPolymerProperties& props_well11 = well1.getPolymerProperties();
|
||||
BOOST_CHECK_CLOSE(1.0*Metric::PolymerDensity, props_well11.m_polymerConcentration, 0.0001);
|
||||
}
|
||||
{
|
||||
const auto& well1 = sched.getWell2("INJE01", 2);
|
||||
const auto& well1 = sched.getWell("INJE01", 2);
|
||||
const WellPolymerProperties& props_well12 = well1.getPolymerProperties();
|
||||
BOOST_CHECK_CLOSE(0.1*Metric::PolymerDensity, props_well12.m_polymerConcentration, 0.0001);
|
||||
}
|
||||
|
||||
{
|
||||
const auto& well2 = sched.getWell2("INJE02", 0);
|
||||
const auto& well2 = sched.getWell("INJE02", 0);
|
||||
BOOST_CHECK( well2.isInjector());
|
||||
const WellPolymerProperties& props_well20 = well2.getPolymerProperties();
|
||||
BOOST_CHECK_CLOSE(2.0*Metric::PolymerDensity, props_well20.m_polymerConcentration, 0.0001);
|
||||
}
|
||||
{
|
||||
const auto& well2 = sched.getWell2("INJE02", 1);
|
||||
const auto& well2 = sched.getWell("INJE02", 1);
|
||||
const WellPolymerProperties& props_well21 = well2.getPolymerProperties();
|
||||
BOOST_CHECK_CLOSE(1.5*Metric::PolymerDensity, props_well21.m_polymerConcentration, 0.0001);
|
||||
}
|
||||
{
|
||||
const auto& well2 = sched.getWell2("INJE02", 2);
|
||||
const auto& well2 = sched.getWell("INJE02", 2);
|
||||
const WellPolymerProperties& props_well22 = well2.getPolymerProperties();
|
||||
BOOST_CHECK_CLOSE(0.2*Metric::PolymerDensity, props_well22.m_polymerConcentration, 0.0001);
|
||||
}
|
||||
{
|
||||
const auto& well3 = sched.getWell2("INJE03", 0);
|
||||
const auto& well3 = sched.getWell("INJE03", 0);
|
||||
BOOST_CHECK( well3.isInjector());
|
||||
const WellPolymerProperties& props_well30 = well3.getPolymerProperties();
|
||||
BOOST_CHECK_CLOSE(2.5*Metric::PolymerDensity, props_well30.m_polymerConcentration, 0.0001);
|
||||
}
|
||||
{
|
||||
const auto& well3 = sched.getWell2("INJE03", 1);
|
||||
const auto& well3 = sched.getWell("INJE03", 1);
|
||||
const WellPolymerProperties& props_well31 = well3.getPolymerProperties();
|
||||
BOOST_CHECK_CLOSE(2.0*Metric::PolymerDensity, props_well31.m_polymerConcentration, 0.0001);
|
||||
}
|
||||
{
|
||||
const auto& well3 = sched.getWell2("INJE03", 2);
|
||||
const auto& well3 = sched.getWell("INJE03", 2);
|
||||
const WellPolymerProperties& props_well32 = well3.getPolymerProperties();
|
||||
BOOST_CHECK_CLOSE(0.3*Metric::PolymerDensity, props_well32.m_polymerConcentration, 0.0001);
|
||||
}
|
||||
@@ -630,51 +630,51 @@ BOOST_AUTO_TEST_CASE(WellTestWFOAM) {
|
||||
BOOST_CHECK(sched.hasWell("PROD01"));
|
||||
|
||||
{
|
||||
const auto& well1 = sched.getWell2("INJE01", 0);
|
||||
const auto& well1 = sched.getWell("INJE01", 0);
|
||||
BOOST_CHECK( well1.isInjector());
|
||||
const WellFoamProperties& props_well10 = well1.getFoamProperties();
|
||||
BOOST_CHECK_EQUAL(0.11, props_well10.m_foamConcentration);
|
||||
}
|
||||
{
|
||||
const auto& well1 = sched.getWell2("INJE01", 1);
|
||||
const auto& well1 = sched.getWell("INJE01", 1);
|
||||
const WellFoamProperties& props_well11 = well1.getFoamProperties();
|
||||
BOOST_CHECK_EQUAL(0.12, props_well11.m_foamConcentration);
|
||||
}
|
||||
{
|
||||
const auto& well1 = sched.getWell2("INJE01", 2);
|
||||
const auto& well1 = sched.getWell("INJE01", 2);
|
||||
const WellFoamProperties& props_well12 = well1.getFoamProperties();
|
||||
BOOST_CHECK_EQUAL(0.13, props_well12.m_foamConcentration);
|
||||
}
|
||||
|
||||
{
|
||||
const auto& well2 = sched.getWell2("INJE02", 0);
|
||||
const auto& well2 = sched.getWell("INJE02", 0);
|
||||
BOOST_CHECK( well2.isInjector());
|
||||
const WellFoamProperties& props_well20 = well2.getFoamProperties();
|
||||
BOOST_CHECK_EQUAL(0.0, props_well20.m_foamConcentration);
|
||||
}
|
||||
{
|
||||
const auto& well2 = sched.getWell2("INJE02", 1);
|
||||
const auto& well2 = sched.getWell("INJE02", 1);
|
||||
const WellFoamProperties& props_well21 = well2.getFoamProperties();
|
||||
BOOST_CHECK_EQUAL(0.22, props_well21.m_foamConcentration);
|
||||
}
|
||||
{
|
||||
const auto& well2 = sched.getWell2("INJE02", 2);
|
||||
const auto& well2 = sched.getWell("INJE02", 2);
|
||||
const WellFoamProperties& props_well22 = well2.getFoamProperties();
|
||||
BOOST_CHECK_EQUAL(0.0, props_well22.m_foamConcentration);
|
||||
}
|
||||
{
|
||||
const auto& well3 = sched.getWell2("INJE03", 0);
|
||||
const auto& well3 = sched.getWell("INJE03", 0);
|
||||
BOOST_CHECK( well3.isInjector());
|
||||
const WellFoamProperties& props_well30 = well3.getFoamProperties();
|
||||
BOOST_CHECK_EQUAL(0.31, props_well30.m_foamConcentration);
|
||||
}
|
||||
{
|
||||
const auto& well3 = sched.getWell2("INJE03", 1);
|
||||
const auto& well3 = sched.getWell("INJE03", 1);
|
||||
const WellFoamProperties& props_well31 = well3.getFoamProperties();
|
||||
BOOST_CHECK_EQUAL(0.0, props_well31.m_foamConcentration);
|
||||
}
|
||||
{
|
||||
const auto& well3 = sched.getWell2("INJE03", 2);
|
||||
const auto& well3 = sched.getWell("INJE03", 2);
|
||||
const WellFoamProperties& props_well32 = well3.getFoamProperties();
|
||||
BOOST_CHECK_EQUAL(0.33, props_well32.m_foamConcentration);
|
||||
}
|
||||
@@ -697,7 +697,7 @@ BOOST_AUTO_TEST_CASE(WellTestWECON) {
|
||||
BOOST_CHECK(sched.hasWell("PROD02"));
|
||||
|
||||
{
|
||||
const WellEconProductionLimits& econ_limit1 = sched.getWell2("PROD01", 0).getEconLimits();
|
||||
const WellEconProductionLimits& econ_limit1 = sched.getWell("PROD01", 0).getEconLimits();
|
||||
BOOST_CHECK(econ_limit1.onMinOilRate());
|
||||
BOOST_CHECK(econ_limit1.onMaxWaterCut());
|
||||
BOOST_CHECK(!(econ_limit1.onMinGasRate()));
|
||||
@@ -719,7 +719,7 @@ BOOST_AUTO_TEST_CASE(WellTestWECON) {
|
||||
BOOST_CHECK(econ_limit1.onAnyRateLimit());
|
||||
BOOST_CHECK(econ_limit1.onAnyEffectiveLimit());
|
||||
|
||||
const WellEconProductionLimits& econ_limit2 = sched.getWell2("PROD01", 1).getEconLimits();
|
||||
const WellEconProductionLimits& econ_limit2 = sched.getWell("PROD01", 1).getEconLimits();
|
||||
BOOST_CHECK(!(econ_limit2.onMinOilRate()));
|
||||
BOOST_CHECK(econ_limit2.onMaxWaterCut());
|
||||
BOOST_CHECK(econ_limit2.onMinGasRate());
|
||||
@@ -743,7 +743,7 @@ BOOST_AUTO_TEST_CASE(WellTestWECON) {
|
||||
}
|
||||
|
||||
{
|
||||
const WellEconProductionLimits& econ_limit1 = sched.getWell2("PROD02", 0).getEconLimits();
|
||||
const WellEconProductionLimits& econ_limit1 = sched.getWell("PROD02", 0).getEconLimits();
|
||||
BOOST_CHECK(!(econ_limit1.onMinOilRate()));
|
||||
BOOST_CHECK(!(econ_limit1.onMaxWaterCut()));
|
||||
BOOST_CHECK(!(econ_limit1.onMinGasRate()));
|
||||
@@ -765,7 +765,7 @@ BOOST_AUTO_TEST_CASE(WellTestWECON) {
|
||||
BOOST_CHECK(!(econ_limit1.onAnyRateLimit()));
|
||||
BOOST_CHECK(!(econ_limit1.onAnyEffectiveLimit()));
|
||||
|
||||
const WellEconProductionLimits& econ_limit2 = sched.getWell2("PROD02", 1).getEconLimits();
|
||||
const WellEconProductionLimits& econ_limit2 = sched.getWell("PROD02", 1).getEconLimits();
|
||||
BOOST_CHECK(!(econ_limit2.onMinOilRate()));
|
||||
BOOST_CHECK(econ_limit2.onMaxWaterCut());
|
||||
BOOST_CHECK(econ_limit2.onMinGasRate());
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
|
||||
|
||||
@@ -552,7 +552,7 @@ BOOST_AUTO_TEST_CASE (Declared_Connection_Data)
|
||||
const auto rptStep = std::size_t{1};
|
||||
|
||||
const auto ih = MockIH {
|
||||
static_cast<int>(simCase.sched.getWells2(rptStep).size())
|
||||
static_cast<int>(simCase.sched.getWells(rptStep).size())
|
||||
};
|
||||
|
||||
BOOST_CHECK_EQUAL(ih.nwells, MockIH::Sz{2});
|
||||
@@ -710,7 +710,7 @@ BOOST_AUTO_TEST_CASE (Declared_Connection_Data)
|
||||
BOOST_AUTO_TEST_CASE(InactiveCell) {
|
||||
auto simCase = SimulationCase{first_sim()};
|
||||
const auto rptStep = std::size_t{1};
|
||||
const auto ih = MockIH {static_cast<int>(simCase.sched.getWells2(rptStep).size())};
|
||||
const auto ih = MockIH {static_cast<int>(simCase.sched.getWells(rptStep).size())};
|
||||
const Opm::data::WellRates wrc = wr();
|
||||
auto conn0 = Opm::RestartIO::Helpers::AggregateConnectionData{ih.value};
|
||||
conn0.captureDeclaredConnData(simCase.sched,
|
||||
|
||||
@@ -492,7 +492,7 @@ BOOST_AUTO_TEST_CASE (Declared_Group_Data)
|
||||
const auto rptStep = std::size_t{1};
|
||||
|
||||
const auto ih = MockIH {
|
||||
static_cast<int>(simCase.sched.getWells2(rptStep).size())
|
||||
static_cast<int>(simCase.sched.getWells(rptStep).size())
|
||||
};
|
||||
|
||||
BOOST_CHECK_EQUAL(ih.nwells, MockIH::Sz{4});
|
||||
|
||||
@@ -618,7 +618,7 @@ BOOST_AUTO_TEST_CASE (Declared_MSW_Data)
|
||||
const auto rptStep = std::size_t{1};
|
||||
|
||||
const auto ih = MockIH {
|
||||
static_cast<int>(simCase.sched.getWells2(rptStep).size())
|
||||
static_cast<int>(simCase.sched.getWells(rptStep).size())
|
||||
};
|
||||
|
||||
BOOST_CHECK_EQUAL(ih.nwells, MockIH::Sz{2});
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Schedule.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well2.hpp>
|
||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@ BOOST_AUTO_TEST_CASE (Declared_Well_Data)
|
||||
const auto rptStep = std::size_t{1};
|
||||
|
||||
const auto ih = MockIH {
|
||||
static_cast<int>(simCase.sched.getWells2(rptStep).size())
|
||||
static_cast<int>(simCase.sched.getWells(rptStep).size())
|
||||
};
|
||||
|
||||
BOOST_CHECK_EQUAL(ih.nwells, MockIH::Sz{2});
|
||||
@@ -531,7 +531,7 @@ BOOST_AUTO_TEST_CASE (Dynamic_Well_Data_Step1)
|
||||
const auto rptStep = std::size_t{1};
|
||||
|
||||
const auto ih = MockIH {
|
||||
static_cast<int>(simCase.sched.getWells2(rptStep).size())
|
||||
static_cast<int>(simCase.sched.getWells(rptStep).size())
|
||||
};
|
||||
|
||||
const auto xw = well_rates_1();
|
||||
@@ -638,7 +638,7 @@ BOOST_AUTO_TEST_CASE (Dynamic_Well_Data_Step2)
|
||||
const auto rptStep = std::size_t{2};
|
||||
|
||||
const auto ih = MockIH {
|
||||
static_cast<int>(simCase.sched.getWells2(rptStep).size())
|
||||
static_cast<int>(simCase.sched.getWells(rptStep).size())
|
||||
};
|
||||
|
||||
const auto xw = well_rates_2();
|
||||
|
||||
@@ -133,7 +133,7 @@ void verifyWellState(const std::string& rst_filename, const Opm::Schedule& sched
|
||||
BOOST_CHECK_EQUAL(iwel[i*niwelz], std::get<0>(ref_wellHead[step][i]));
|
||||
BOOST_CHECK_EQUAL(iwel[i*niwelz + 1], std::get<1>(ref_wellHead[step][i]));
|
||||
|
||||
Opm::Well2 sched_well2 = schedule.getWell2(wellList[i], step);
|
||||
Opm::Well sched_well2 = schedule.getWell(wellList[i], step);
|
||||
|
||||
BOOST_CHECK_EQUAL(iwel[i*niwelz], sched_well2.getHeadI() +1 );
|
||||
BOOST_CHECK_EQUAL(iwel[i*niwelz + 1], sched_well2.getHeadJ() +1 );
|
||||
@@ -144,13 +144,13 @@ void verifyWellState(const std::string& rst_filename, const Opm::Schedule& sched
|
||||
sched_wtype = 1;
|
||||
} else {
|
||||
switch( sched_well2.getInjectionProperties( ).injectorType ) {
|
||||
case Opm::Well2::InjectorType::WATER:
|
||||
case Opm::Well::InjectorType::WATER:
|
||||
sched_wtype = 3;
|
||||
break;
|
||||
case Opm::Well2::InjectorType::GAS:
|
||||
case Opm::Well::InjectorType::GAS:
|
||||
sched_wtype = 4;
|
||||
break;
|
||||
case Opm::Well2::InjectorType::OIL:
|
||||
case Opm::Well::InjectorType::OIL:
|
||||
sched_wtype = 2;
|
||||
break;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user