/* Copyright (c) 2018 Statoil ASA This file is part of the Open Porous Media project (OPM). OPM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. OPM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OPM. If not, see . */ #ifndef OPM_AGGREGATE_GROUP_DATA_HPP #define OPM_AGGREGATE_GROUP_DATA_HPP #include #include #include #include #include #include #include namespace Opm { class Schedule; class SummaryState; //class Group; class UnitSystem; } // Opm namespace Opm { namespace RestartIO { namespace Helpers { class AggregateGroupData { public: explicit AggregateGroupData(const std::vector& inteHead); void captureDeclaredGroupData(const Opm::Schedule& sched, const Opm::UnitSystem& units, const std::size_t simStep, const Opm::SummaryState& sumState, const std::vector& inteHead); const std::vector& getIGroup() const { return this->iGroup_.data(); } const std::vector& getSGroup() const { return this->sGroup_.data(); } const std::vector& getXGroup() const { return this->xGroup_.data(); } const std::vector>& getZGroup() const { return this->zGroup_.data(); } const std::vector restart_group_keys = {"GOPP", "GWPP", "GOPR", "GWPR", "GGPR", "GVPR", "GWIR", "GGIR", "GWCT", "GGOR", "GOPT", "GWPT", "GGPT", "GVPT", "GWIT", "GGIT", "GVIT", "GOPTH", "GWPTH", "GGPTH", "GWITH", "GGITH"}; const std::vector restart_field_keys = {"FOPP", "FWPP", "FOPR", "FWPR", "FGPR", "FVPR", "FWIR", "FGIR", "FWCT", "FGOR", "FOPT", "FWPT", "FGPT", "FVPT", "FWIT", "FGIT", "FVIT", "FOPTH", "FWPTH", "FGPTH", "FWITH", "FGITH"}; const std::map groupKeyToIndex = { {"GOPR", 0}, {"GWPR", 1}, {"GGPR", 2}, {"GVPR", 3}, {"GWIR", 5}, {"GGIR", 6}, {"GWCT", 8}, {"GGOR", 9}, {"GOPT", 10}, {"GWPT", 11}, {"GGPT", 12}, {"GVPT", 13}, {"GWIT", 15}, {"GGIT", 16}, {"GVIT", 17}, {"GOPP", 22}, {"GWPP", 23}, {"GOPTH", 135}, {"GWPTH", 139}, {"GWITH", 140}, {"GGPTH", 143}, {"GGITH", 144}, }; using inj_cmode_enum = Opm::Group::InjectionCMode; const std::map cmodeToNum = { {inj_cmode_enum::NONE, 0}, {inj_cmode_enum::RATE, 1}, {inj_cmode_enum::RESV, 2}, {inj_cmode_enum::REIN, 3}, {inj_cmode_enum::VREP, 4}, {inj_cmode_enum::FLD, 0}, {inj_cmode_enum::SALE, 0}, }; const std::map fieldKeyToIndex = { {"FOPR", 0}, {"FWPR", 1}, {"FGPR", 2}, {"FVPR", 3}, {"FWIR", 5}, {"FGIR", 6}, {"FWCT", 8}, {"FGOR", 9}, {"FOPT", 10}, {"FWPT", 11}, {"FGPT", 12}, {"FVPT", 13}, {"FWIT", 15}, {"FGIT", 16}, {"FVIT", 17}, {"FOPP", 22}, {"FWPP", 23}, {"FOPTH", 135}, {"FWPTH", 139}, {"FWITH", 140}, {"FGPTH", 143}, {"FGITH", 144}, }; private: /// Aggregate 'IWEL' array (Integer) for all wells. WindowedArray iGroup_; /// Aggregate 'SWEL' array (Real) for all wells. WindowedArray sGroup_; /// Aggregate 'XWEL' array (Double Precision) for all wells. WindowedArray xGroup_; /// Aggregate 'ZWEL' array (Character) for all wells. WindowedArray> zGroup_; /// Maximum number of wells in a group. int nWGMax_; /// Maximum number of groups int nGMaxz_; }; }}} // Opm::RestartIO::Helpers #endif // OPM_AGGREGATE_WELL_DATA_HPP