Loading...
Searching...
No Matches
network.hpp
/*
Copyright 2021 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 RST_NETWORK_HPP
#define RST_NETWORK_HPP
#include <memory>
#include <optional>
#include <string>
#include <vector>
namespace Opm {
class UnitSystem;
} // namespace Opm
namespace Opm { namespace EclIO {
class RestartFileView;
}} // namespace Opm::EclIO
namespace Opm { namespace RestartIO {
class RstNetwork
{
public:
struct Branch
{
int down{-1};
int up{-1};
int vfp{-1};
};
struct Node
{
std::string name{};
std::optional<double> terminal_pressure{};
std::optional<std::string> as_choke{};
double pressure{};
};
explicit RstNetwork(std::shared_ptr<EclIO::RestartFileView> rstView,
const UnitSystem& usys);
bool isActive() const;
const std::vector<Branch>& branches() const
{
return this->branches_;
}
const std::vector<Node>& nodes() const
{
return this->nodes_;
}
private:
std::vector<Branch> branches_{};
std::vector<Node> nodes_{};
};
}} // namespace Opm::RestartIO
#endif // RST_NETWORK_HPP
Opm::EclIO::RestartFileView
Definition RestartFileView.hpp:35
Opm::RestartIO::RstNetwork
Definition network.hpp:39
Opm::UnitSystem
Definition UnitSystem.hpp:34
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Opm::RestartIO::RstNetwork::Branch
Single branch in extended network model.
Definition network.hpp:43
Opm::RestartIO::RstNetwork::Branch::down
int down
Downtree node. Index into 'nodes' array.
Definition network.hpp:45
Opm::RestartIO::RstNetwork::Branch::up
int up
Uptree node. Index into 'nodes' array.
Definition network.hpp:48
Opm::RestartIO::RstNetwork::Branch::vfp
int vfp
One-based VFP table ID.
Definition network.hpp:51
Opm::RestartIO::RstNetwork::Node
Single node in extended network model.
Definition network.hpp:56
Opm::RestartIO::RstNetwork::Node::pressure
double pressure
Node pressure.
Definition network.hpp:69
Opm::RestartIO::RstNetwork::Node::as_choke
std::optional< std::string > as_choke
Group whose rate target the choking mechanism attempts to match.
Definition network.hpp:66
Opm::RestartIO::RstNetwork::Node::terminal_pressure
std::optional< double > terminal_pressure
Fixed pressure for terminal node. Nullopt if not terminal.
Definition network.hpp:61
Opm::RestartIO::RstNetwork::Node::name
std::string name
Name of network node.
Definition network.hpp:58