Loading...
Searching...
No Matches
GSatProd.hpp
/*
Copyright 2024 Equinor 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 <http://www.gnu.org/licenses/>.
*/
#ifndef GSATPROD_H
#define GSATPROD_H
#include <opm/input/eclipse/Deck/UDAValue.hpp>
#include <opm/input/eclipse/Units/UnitSystem.hpp>
#include <array>
#include <cstddef>
#include <map>
#include <string>
namespace Opm {
class SummaryState;
class GSatProd
{
public:
struct GSatProdGroup
{
std::array<UDAValue, 5> rate{};
double udq_undefined;
bool operator==(const GSatProdGroup& data) const {
return rate == data.rate &&
udq_undefined == data.udq_undefined;
}
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(rate);
serializer(udq_undefined);
}
};
struct GSatProdGroupProp {
enum Rate { Oil, Gas, Water, Resv, GLift, };
std::array<double, 5> rate{};
};
static GSatProd serializationTestObject();
void assign(const std::string& name,
const UDAValue& oil_rate,
const UDAValue& gas_rate,
const UDAValue& water_rate,
const UDAValue& resv_rate,
const UDAValue& glift_rate,
double udq_undefined);
bool has(const std::string& name) const;
const GSatProdGroup& get(const std::string& name) const;
const GSatProdGroupProp get(const std::string& name,
const SummaryState& st) const;
bool empty() const { return this->size() == 0; }
std::size_t size() const;
bool operator==(const GSatProd& data) const;
template<class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(groups_);
}
private:
std::map<std::string, GSatProdGroup> groups_;
};
} // namespace Opm
#endif // GSATPROD_H
Opm::GSatProd
Group level satellite production.
Definition GSatProd.hpp:37
Opm::GSatProd::assign
void assign(const std::string &name, const UDAValue &oil_rate, const UDAValue &gas_rate, const UDAValue &water_rate, const UDAValue &resv_rate, const UDAValue &glift_rate, double udq_undefined)
Define satellite production rates for named group.
Definition GSatProd.cpp:70
Opm::GSatProd::serializeOp
void serializeOp(Serializer &serializer)
Convert between byte array and object representation.
Definition GSatProd.hpp:180
Opm::GSatProd::empty
bool empty() const
Whether or not any groups have associate satellite production rates.
Definition GSatProd.hpp:159
Opm::GSatProd::operator==
bool operator==(const GSatProd &data) const
Equality predicate.
Definition GSatProd.cpp:95
Opm::GSatProd::serializationTestObject
static GSatProd serializationTestObject()
Create a serialisation test object.
Definition GSatProd.cpp:29
Opm::GSatProd::has
bool has(const std::string &name) const
Whether or not satellite production rates have been defined for a named group.
Definition GSatProd.cpp:38
Opm::GSatProd::get
const GSatProdGroup & get(const std::string &name) const
Retrieve satellite production rates for named group.
Definition GSatProd.cpp:43
Opm::GSatProd::size
std::size_t size() const
Number of groups for which satellite production rates have been defined.
Definition GSatProd.cpp:90
Opm::Serializer
Class for (de-)serializing.
Definition Serializer.hpp:94
Opm::SummaryState
Definition SummaryState.hpp:72
Opm::UDAValue
Definition UDAValue.hpp:31
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Opm::GSatProd::GSatProdGroupProp
Definition GSatProd.hpp:75
Opm::GSatProd::GSatProdGroupProp::rate
std::array< double, 5 > rate
Satellite production rates.
Definition GSatProd.hpp:82
Opm::GSatProd::GSatProdGroupProp::Rate
Rate
Satellite production rate items.
Definition GSatProd.hpp:77
Opm::GSatProd::GSatProdGroup
Satellite production rates for a single group.
Definition GSatProd.hpp:41
Opm::GSatProd::GSatProdGroup::udq_undefined
double udq_undefined
Default udq value.
Definition GSatProd.hpp:48
Opm::GSatProd::GSatProdGroup::operator==
bool operator==(const GSatProdGroup &data) const
Equality predicate.
Definition GSatProd.hpp:57
Opm::GSatProd::GSatProdGroup::serializeOp
void serializeOp(Serializer &serializer)
Convert between byte array and object representation.
Definition GSatProd.hpp:68
Opm::GSatProd::GSatProdGroup::rate
std::array< UDAValue, 5 > rate
Satellite production rates.
Definition GSatProd.hpp:45