Prettification of code

This commit is contained in:
Kjetil Olsen Lye 2012-03-28 15:49:39 +02:00
parent bc1fcb831b
commit 844698baa2
6 changed files with 91 additions and 223 deletions

View File

@ -1,59 +1,13 @@
#include <opm/core/InjectionSpecification.hpp>
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

View File

@ -1,46 +1,26 @@
#ifndef OPM_INJECTORSPECIFICATION_HPP
#define OPM_INJECTORSPECIFICATION_HPP
namespace Opm {
#include <opm/core/newwells.h>
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 */

View File

@ -1,73 +1,17 @@
#include <opm/core/ProductionSpecification.hpp>
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_;
}
}

View File

@ -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 <opm/core/newwells.h>
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 */

View File

@ -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_;
}
}

View File

@ -1,29 +1,33 @@
#ifndef OPM_WELLSGROUP_HPP
#define OPM_WELLSGROUP_HPP
#include <opm/core/InjectionSpecification.hpp>
#include <opm/core/ProductionSpecification.hpp>
#include <string>
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 */