diff --git a/opm/core/InjectionSpecification.cpp b/opm/core/InjectionSpecification.cpp index 2d6cf769..22d9ead0 100644 --- a/opm/core/InjectionSpecification.cpp +++ b/opm/core/InjectionSpecification.cpp @@ -7,9 +7,6 @@ reinjection_fraction_target_(0.0), BHP_target_(0.0) { } -InjectionSpecification::InjectionSpecification(const InjectionSpecification& orig) { -} - InjectionSpecification::~InjectionSpecification() { } diff --git a/opm/core/InjectionSpecification.hpp b/opm/core/InjectionSpecification.hpp index 728df76a..768495bd 100644 --- a/opm/core/InjectionSpecification.hpp +++ b/opm/core/InjectionSpecification.hpp @@ -14,7 +14,6 @@ public: }; InjectionSpecification(); - InjectionSpecification(const InjectionSpecification& orig); virtual ~InjectionSpecification(); Component component(); diff --git a/opm/core/eclipse/EclipseGridParser.cpp b/opm/core/eclipse/EclipseGridParser.cpp index 22b7e319..b6ef5846 100644 --- a/opm/core/eclipse/EclipseGridParser.cpp +++ b/opm/core/eclipse/EclipseGridParser.cpp @@ -98,7 +98,7 @@ namespace EclipseKeywords string("EQUIL"), string("PVCDO"), string("TSTEP"), string("PLYVISC"), string("PLYROCK"), string("PLYADS"), string("PLYMAX"), string("TLMIXPAR"), string("WPOLYMER"), - string("GRUPTREE"), string("GCONINJE"), + string("GRUPTREE"), string("GCONINJE"), string("GCONPROD"), // The following fields only have a dummy implementation // that allows us to ignore them. string("SWFN"), diff --git a/opm/core/eclipse/EclipseGridParser.hpp b/opm/core/eclipse/EclipseGridParser.hpp index b38adb4c..b466a4be 100644 --- a/opm/core/eclipse/EclipseGridParser.hpp +++ b/opm/core/eclipse/EclipseGridParser.hpp @@ -151,6 +151,7 @@ public: SPECIAL_FIELD(WPOLYMER); SPECIAL_FIELD(GRUPTREE); SPECIAL_FIELD(GCONINJE); + SPECIAL_FIELD(GCONPROD); // The following fields only have a dummy implementation // that allows us to ignore them. diff --git a/opm/core/eclipse/SpecialEclipseFields.hpp b/opm/core/eclipse/SpecialEclipseFields.hpp index 57291649..64a8a918 100644 --- a/opm/core/eclipse/SpecialEclipseFields.hpp +++ b/opm/core/eclipse/SpecialEclipseFields.hpp @@ -1026,10 +1026,8 @@ struct GCONINJE : public SpecialBase virtual void read(std::istream& is) { while(is) { - std::cout<< "here" << std::endl; std::string groupname = readString(is); if (groupname[0] == '/') { - std::cout << "And we're out" << std::endl; is >> ignoreLine; break; } @@ -1199,6 +1197,118 @@ struct WCONINJE : public SpecialBase } }; + + +/// Class holding a data line of keyword WCONPROD +struct GconprodLine +{ + std::string group_; // Well name or well name root + std::string control_mode_; // Control mode + double oil_max_rate_; // Oil rate target or upper limit + double water_max_rate_; // Water rate target or upper limit + double gas_max_rate_; // Gas rate target or upper limit + double liquid_max_rate_; // Liquid rate target or upper limit + std::string procedure_; // Procedure on exceeding a maximum rate limit + // Default values + GconprodLine() : + oil_max_rate_(1.0E20), water_max_rate_(1.0E20), + gas_max_rate_(1.0E20), liquid_max_rate_(1.0E20) + { + } +}; + +/// Class for keyword WCONPROD +struct GCONPROD : public SpecialBase +{ + std::vector gconprod; + + GCONPROD() + { + } + + virtual ~GCONPROD() + {} + + virtual std::string name() const {return std::string("GCONPROD");} + + virtual void read(std::istream& is) + { + while(is) { + std::string groupname = readString(is); + if (groupname[0] == '/') { + is >> ignoreLine; + break; + } + while (groupname.find("--") == 0) { + // This line is a comment + is >> ignoreLine; + groupname = readString(is); + } + GconprodLine gconprod_line; + gconprod_line.group_ = groupname; + gconprod_line.control_mode_ = readString(is); + std::vector double_data(4, 1.0E20); + const int num_to_read = 4; + int num_read = readDefaultedVectorData(is, double_data, num_to_read); + gconprod_line.oil_max_rate_ = double_data[0]; + gconprod_line.water_max_rate_ = double_data[1]; + gconprod_line.gas_max_rate_ = double_data[2]; + gconprod_line.liquid_max_rate_ = double_data[3]; + + + std::string procedure = readString(is); + if (procedure[0] == '/') { + is >> ignoreLine; + break; + } + while (procedure.find("--") == 0) { + // This line is a comment + is >> ignoreLine; + procedure = readString(is); + } + + gconprod_line.procedure_ = procedure; + + gconprod.push_back(gconprod_line); + // HACK! Ignore any further items + if (num_read == num_to_read) { + ignoreSlashLine(is); + } + + } + } + + virtual void write(std::ostream& os) const + { + os << name() << std::endl; + for (int i=0; i<(int) gconprod.size(); ++i) { + os << gconprod[i].group_ << " " + << gconprod[i].control_mode_ << " " + << gconprod[i].oil_max_rate_ << " " + << gconprod[i].water_max_rate_ << " " + << gconprod[i].gas_max_rate_ << " " + << gconprod[i].liquid_max_rate_ << " " + << gconprod[i].procedure_ + << std::endl; + } + os << std::endl; + } + + virtual void convertToSI(const EclipseUnits& units) + { + double lrat = units.liqvol_s / units.time; + double grat = units.gasvol_s / units.time; + for (int i=0; i<(int) gconprod.size(); ++i) { + gconprod[i].oil_max_rate_ *= lrat; + gconprod[i].water_max_rate_ *= lrat; + gconprod[i].gas_max_rate_ *= grat; + gconprod[i].liquid_max_rate_ *= lrat; + } + } +}; + + + /// Class holding a data line of keyword WCONPROD struct WconprodLine {