diff --git a/opm/core/InjectionSpecification.cpp b/opm/core/InjectionSpecification.cpp index 22d9ead08..0400738db 100644 --- a/opm/core/InjectionSpecification.cpp +++ b/opm/core/InjectionSpecification.cpp @@ -1,59 +1,13 @@ #include -namespace Opm { +namespace Opm +{ -InjectionSpecification::InjectionSpecification() -: component_(WATER), control_mode_(NONE), surface_injection_target_(0.0), -reinjection_fraction_target_(0.0), BHP_target_(0.0) { + InjectionSpecification::InjectionSpecification() + : component_(WATER), control_mode_(NONE), surface_injection_target_(0.0), + reinjection_fraction_target_(0.0), BHP_target_(0.0) + { -} + } -InjectionSpecification::~InjectionSpecification() { -} - -InjectionSpecification::Component InjectionSpecification::component() { - return component_; -} - -void InjectionSpecification::set_component(InjectionSpecification::Component comp) { - component_ = comp; -} - -InjectionSpecification::ControlMode InjectionSpecification::control_mode() { - return control_mode_; -} - -void InjectionSpecification::set_control_mode(InjectionSpecification::ControlMode mode) { - control_mode_ = mode; -} - -/// \returns 0 if no limit, else the target/limit of the surface Injector -/// rate. -double InjectionSpecification::surface_injection_target() { - return surface_injection_target_; -} - -void InjectionSpecification::set_surface_injection_target(double target) { - surface_injection_target_ = target; -} - -/// \returns 0 if no limit, else the target/limit of the reInjector fraction - -double InjectionSpecification::reinjection_fraction_target() { - return reinjection_fraction_target_; -} - -void InjectionSpecification::set_reinjection_fraction_target(double target) { - reinjection_fraction_target_ = target; -} - -/// \returns 0 if no limit, else the target/limit of the BHP - -double InjectionSpecification::BHP_target() { - return BHP_target_; -} - -void InjectionSpecification::set_BHP_target(double target) { - BHP_target_ = target; -} } // namespace Opm \ No newline at end of file diff --git a/opm/core/InjectionSpecification.hpp b/opm/core/InjectionSpecification.hpp index 768495bd6..1ad6a3dee 100644 --- a/opm/core/InjectionSpecification.hpp +++ b/opm/core/InjectionSpecification.hpp @@ -1,46 +1,26 @@ #ifndef OPM_INJECTORSPECIFICATION_HPP #define OPM_INJECTORSPECIFICATION_HPP -namespace Opm { +#include +namespace Opm +{ -class InjectionSpecification { -public: - enum Component { - GAS, OIL, WATER + struct InjectionSpecification + { + + enum ControlMode + { + NONE, RATE, REIN, RESV, VREP, WGRA, FLD + }; + + InjectionSpecification(); + + surface_component component_; + ControlMode control_mode_; + double surface_injection_target_; + double reinjection_fraction_target_; + double BHP_target_; }; - - enum ControlMode { - NONE, RATE, REIN, RESV, VREP, WGRA, FLD - }; - - InjectionSpecification(); - virtual ~InjectionSpecification(); - - Component component(); - void set_component(Component comp); - - ControlMode control_mode(); - void set_control_mode(ControlMode mode); - - /// \returns 0 if no limit, else the target/limit of the surface injection - /// rate. - double surface_injection_target(); - void set_surface_injection_target(double target); - - /// \returns 0 if no limit, else the target/limit of the reinjection fraction - double reinjection_fraction_target(); - void set_reinjection_fraction_target(double target); - - /// \returns 0 if no limit, else the target/limit of the BHP - double BHP_target(); - void set_BHP_target(double target); -private: - Component component_; - ControlMode control_mode_; - double surface_injection_target_; - double reinjection_fraction_target_; - double BHP_target_; -}; } #endif /* OPM_INJECTORSPECIFICATION_HPP */ diff --git a/opm/core/ProductionSpecification.cpp b/opm/core/ProductionSpecification.cpp index 0d0b7109a..21f2d842a 100644 --- a/opm/core/ProductionSpecification.cpp +++ b/opm/core/ProductionSpecification.cpp @@ -1,73 +1,17 @@ #include -namespace Opm { -ProductionSpecification::ProductionSpecification() : - component_(OIL), - control_mode_(NONE_CM), - procedure_(NONE_P), - oil_production_target_(-1.0), - water_production_target_(-1.0), - liquid_production_target_(-1.0), - BHP_target_(-1.0) +namespace Opm { -} -ProductionSpecification::~ProductionSpecification() { -} + ProductionSpecification::ProductionSpecification() + : component_(OIL), + control_mode_(NONE_CM), + procedure_(NONE_P), + oil_production_target_(-1.0), + water_production_target_(-1.0), + liquid_production_target_(-1.0), + BHP_target_(-1.0) + { + } -void ProductionSpecification::set_BHP_target(double BHP_target_) { - this->BHP_target_ = BHP_target_; -} - -double ProductionSpecification::get_BHP_target() const { - return BHP_target_; -} - -void ProductionSpecification::set_liquid_production_target(double liquid_production_target_) { - this->liquid_production_target_ = liquid_production_target_; -} - -double ProductionSpecification::get_liquid_production_target() const { - return liquid_production_target_; -} - -void ProductionSpecification::set_water_production_target(double water_production_target_) { - this->water_production_target_ = water_production_target_; -} - -double ProductionSpecification::get_water_production_target() const { - return water_production_target_; -} - -void ProductionSpecification::set_oil_production_target(double oil_production_target_) { - this->oil_production_target_ = oil_production_target_; -} - -double ProductionSpecification::get_oil_production_target() const { - return oil_production_target_; -} - -void ProductionSpecification::set_procedure(ProductionSpecification::Procedure procedure_) { - this->procedure_ = procedure_; -} - -ProductionSpecification::Procedure ProductionSpecification::get_procedure() const { - return procedure_; -} - -void ProductionSpecification::set_control_mode(ProductionSpecification::ControlMode control_mode_) { - this->control_mode_ = control_mode_; -} - -ProductionSpecification::ControlMode ProductionSpecification::get_control_mode() const { - return control_mode_; -} - -void ProductionSpecification::set_component(ProductionSpecification::Component component_) { - this->component_ = component_; -} - -ProductionSpecification::Component ProductionSpecification::get_component() const { - return component_; -} } diff --git a/opm/core/ProductionSpecification.hpp b/opm/core/ProductionSpecification.hpp index 3c76e4f10..aa30e9f0d 100644 --- a/opm/core/ProductionSpecification.hpp +++ b/opm/core/ProductionSpecification.hpp @@ -1,51 +1,37 @@ #ifndef OPM_PRODUCTIONSPECIFICATION_HPP #define OPM_PRODUCTIONSPECIFICATION_HPP -namespace Opm { -class ProductionSpecification { -public: - enum Component { - GAS, OIL, WATER - }; - - enum ControlMode { - NONE_CM, ORAT, WRAT, REIN, RESV, VREP, WGRA, FLD - }; - - enum Procedure { - WELL, RATE, NONE_P - }; - - ProductionSpecification(); - virtual ~ProductionSpecification(); - - - void set_BHP_target(double BHP_target_); - double get_BHP_target() const; - void set_liquid_production_target(double liquid_production_target_); - double get_liquid_production_target() const; - void set_water_production_target(double water_production_target_); - double get_water_production_target() const; - void set_oil_production_target(double oil_production_target_); - double get_oil_production_target() const; - void set_procedure(Procedure procedure_); - Procedure get_procedure() const; - void set_control_mode(ControlMode control_mode_); - ControlMode get_control_mode() const; - void set_component(Component component_); - Component get_component() const; -private: - Component component_; - ControlMode control_mode_; - Procedure procedure_; +#include - double oil_production_target_; - double water_production_target_; - double liquid_production_target_; - double BHP_target_; - - -}; +namespace Opm +{ + + struct ProductionSpecification + { + + enum ControlMode + { + NONE_CM, ORAT, WRAT, REIN, RESV, VREP, WGRA, FLD + }; + + enum Procedure + { + NONE_P, RATE, WELL + }; + + ProductionSpecification(); + + surface_component component_; + ControlMode control_mode_; + Procedure procedure_; + + double oil_production_target_; + double water_production_target_; + double liquid_production_target_; + double BHP_target_; + + + }; } #endif /* OPM_PRODUCTIONSPECIFICATION_HPP */ diff --git a/opm/core/WellsGroup.cpp b/opm/core/WellsGroup.cpp index 3993d02ca..75a6cb950 100644 --- a/opm/core/WellsGroup.cpp +++ b/opm/core/WellsGroup.cpp @@ -7,13 +7,13 @@ #include "WellsGroup.hpp" namespace Opm { -AbstractWellsGroup::AbstractWellsGroup() { +WellsGroupInterface::AbstractWellsGroup() { } -AbstractWellsGroup::~AbstractWellsGroup() { +WellsGroupInterface::~WellsGroupInterface() { } -const std::string& AbstractWellsGroup::get_name() { +const std::string& WellsGroupInterface::name() { return name_; } } diff --git a/opm/core/WellsGroup.hpp b/opm/core/WellsGroup.hpp index 2d77cad9b..1b0ef9041 100644 --- a/opm/core/WellsGroup.hpp +++ b/opm/core/WellsGroup.hpp @@ -1,29 +1,33 @@ #ifndef OPM_WELLSGROUP_HPP #define OPM_WELLSGROUP_HPP + #include #include +#include +namespace Opm +{ -namespace Opm { -class AbstractWellsGroup { -public: - AbstractWellsGroup(const std::string& name); - virtual ~AbstractWellsGroup(); - - const std::string& get_name(); - const ProductionSpecification& get_production_specification() const; - const InjectionSpecification& get_injection_specification() const; - -private: - std::string name_; - ProductionSpecification production_specification_; - InjectionSpecification injection_specification_; + class WellsGroupInterface + { + public: + WellsGroupInterface(const std::string& name); + virtual ~WellsGroupInterface(); -}; + const std::string& name(); + const ProductionSpecification& prodSpec() const; + const InjectionSpecification& injSpec() const; -class WellsGroup : public AbstractWellsGroup { - -}; + private: + std::string name_; + ProductionSpecification production_specification_; + InjectionSpecification injection_specification_; + + }; + + class WellsGroup : public WellsGroupInterface + { + }; } #endif /* OPM_WELLSGROUP_HPP */