Loading...
Searching...
No Matches
GroupSatelliteInjection.hpp
/*
Copyright 2025 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 OPM_GROUP_SATELLITE_INJECTION_HPP_INCLUDED
#define OPM_GROUP_SATELLITE_INJECTION_HPP_INCLUDED
#include <opm/input/eclipse/EclipseState/Phase.hpp>
#include <map>
#include <optional>
#include <vector>
namespace Opm {
class GroupSatelliteInjection
{
public:
class Rate
{
public:
Rate& surface(const double q);
Rate& reservoir(const double q);
Rate& calorific(const double c);
const std::optional<double>& surface() const
{
return this->surface_;
}
const std::optional<double>& reservoir() const
{
return this->resv_;
}
const std::optional<double>& calorific() const
{
return this->calorific_;
}
static Rate serializationTestObject();
bool operator==(const Rate& that) const
{
return (this->surface_ == that.surface_)
&& (this->resv_ == that.resv_)
&& (this->calorific_ == that.calorific_)
;
}
template <class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(this->surface_);
serializer(this->resv_);
serializer(this->calorific_);
}
private:
std::optional<double> surface_{};
std::optional<double> resv_{};
std::optional<double> calorific_{};
};
using RateIx = std::vector<Rate>::size_type;
static GroupSatelliteInjection serializationTestObject();
GroupSatelliteInjection() = default;
explicit GroupSatelliteInjection(const std::string& group);
Rate& rate(const Phase phase);
const std::string& name() const { return this->group_; }
std::optional<RateIx> rateIndex(const Phase phase) const;
const Rate& operator[](const RateIx i) const
{
return this->rates_[i];
}
bool operator==(const GroupSatelliteInjection& that) const;
template <class Serializer>
void serializeOp(Serializer& serializer)
{
serializer(this->group_);
serializer(this->i_);
serializer(this->rates_);
}
private:
std::string group_{};
std::map<Phase, RateIx> i_{};
std::vector<Rate> rates_{};
};
} // namespace Opm
#endif // OPM_GROUP_SATELLITE_INJECTION_HPP_INCLUDED
Opm::GroupSatelliteInjection::Rate
Satellite injection rates for a single phase.
Definition GroupSatelliteInjection.hpp:37
Opm::GroupSatelliteInjection::Rate::reservoir
const std::optional< double > & reservoir() const
Reservoir injection rate for this phase.
Definition GroupSatelliteInjection.hpp:71
Opm::GroupSatelliteInjection::Rate::serializeOp
void serializeOp(Serializer &serializer)
Convert between byte array and object representation.
Definition GroupSatelliteInjection.hpp:108
Opm::GroupSatelliteInjection::Rate::calorific
const std::optional< double > & calorific() const
Mean calorific value of injected gas.
Definition GroupSatelliteInjection.hpp:79
Opm::GroupSatelliteInjection::Rate::operator==
bool operator==(const Rate &that) const
Equality predicate.
Definition GroupSatelliteInjection.hpp:94
Opm::GroupSatelliteInjection::Rate::surface
const std::optional< double > & surface() const
Surface injection rate for this phase.
Definition GroupSatelliteInjection.hpp:63
Opm::GroupSatelliteInjection::Rate::serializationTestObject
static Rate serializationTestObject()
Create a serialisation test object.
Definition GroupSatelliteInjection.cpp:31
Opm::GroupSatelliteInjection
Group level satellite production.
Definition GroupSatelliteInjection.hpp:33
Opm::GroupSatelliteInjection::rate
Rate & rate(const Phase phase)
Read/write access to injection rate object for particular phase.
Definition GroupSatelliteInjection.cpp:75
Opm::GroupSatelliteInjection::operator==
bool operator==(const GroupSatelliteInjection &that) const
Equality predicate.
Definition GroupSatelliteInjection.cpp:99
Opm::GroupSatelliteInjection::name
const std::string & name() const
Group name.
Definition GroupSatelliteInjection.hpp:169
Opm::GroupSatelliteInjection::GroupSatelliteInjection
GroupSatelliteInjection()=default
Default constructor.
Opm::GroupSatelliteInjection::serializationTestObject
static GroupSatelliteInjection serializationTestObject()
Create a serialisation test object.
Definition GroupSatelliteInjection.cpp:64
Opm::GroupSatelliteInjection::RateIx
std::vector< Rate >::size_type RateIx
Index type for looking up phase rate objects.
Definition GroupSatelliteInjection.hpp:136
Opm::GroupSatelliteInjection::serializeOp
void serializeOp(Serializer &serializer)
Convert between byte array and object representation.
Definition GroupSatelliteInjection.hpp:206
Opm::GroupSatelliteInjection::operator[]
const Rate & operator[](const RateIx i) const
Read only satellite injection rates.
Definition GroupSatelliteInjection.hpp:186
Opm::GroupSatelliteInjection::rateIndex
std::optional< RateIx > rateIndex(const Phase phase) const
Compute lookup index for particular phase.
Definition GroupSatelliteInjection.cpp:88
Opm::Serializer
Class for (de-)serializing.
Definition Serializer.hpp:94
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30