SegmentState.hpp
Go to the documentation of this file.
1/*
2 Copyright Equinor ASA 2021, 2022.
3
4 This file is part of the Open Porous Media project (OPM).
5
6 OPM is free software: you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation, either version 3 of the License, or
9 (at your option) any later version.
10
11 OPM is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with OPM. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#ifndef OPM_SEGMENTSTATE_HEADER_INCLUDED
21#define OPM_SEGMENTSTATE_HEADER_INCLUDED
22
23#include <cstddef>
24#include <vector>
25
26namespace Opm {
27class WellSegments;
28} // namespace Opm
29
30namespace Opm {
31
32template<class Scalar>
34{
35public:
36 SegmentState() = default;
37 SegmentState(int num_phases, const WellSegments& segments);
38
40
41 Scalar pressure_drop(std::size_t index) const;
42 bool empty() const;
43 void scale_pressure(Scalar bhp);
44
45 const std::vector<int>& segment_number() const;
46 std::size_t size() const;
47
48 template<class Serializer>
49 void serializeOp(Serializer& serializer)
50 {
51 serializer(rates);
52 serializer(dissolved_gas_rate);
53 serializer(vaporized_oil_rate);
54 serializer(phase_resv_rates);
55 serializer(phase_velocity);
56 serializer(phase_holdup);
57 serializer(phase_viscosity);
58 serializer(phase_density);
59 serializer(pressure);
60 serializer(pressure_drop_friction);
61 serializer(pressure_drop_hydrostatic);
62 serializer(pressure_drop_accel);
63 serializer(m_segment_number);
64 }
65
66 bool operator==(const SegmentState&) const;
67
68 std::vector<Scalar> rates;
69 std::vector<Scalar> dissolved_gas_rate;
70 std::vector<Scalar> vaporized_oil_rate;
71
73 std::vector<Scalar> phase_resv_rates;
74
76 std::vector<Scalar> phase_velocity;
77
79 std::vector<Scalar> phase_holdup;
80
82 std::vector<Scalar> phase_viscosity;
83
100 std::vector<Scalar> phase_density;
101
102 std::vector<Scalar> pressure;
103 std::vector<Scalar> pressure_drop_friction;
104 std::vector<Scalar> pressure_drop_hydrostatic;
105 std::vector<Scalar> pressure_drop_accel;
106
107private:
108 std::vector<int> m_segment_number;
109};
110
111} // namepace Opm
112
113#endif // OPM_SEGMENTSTATE_HEADER_INCLUDED
Definition: SegmentState.hpp:34
std::vector< Scalar > pressure
Definition: SegmentState.hpp:102
std::vector< Scalar > pressure_drop_accel
Definition: SegmentState.hpp:105
void scale_pressure(Scalar bhp)
bool operator==(const SegmentState &) const
std::vector< Scalar > rates
Definition: SegmentState.hpp:68
std::vector< Scalar > phase_holdup
Segment condition holdup fractions through segment (per phase)
Definition: SegmentState.hpp:79
void serializeOp(Serializer &serializer)
Definition: SegmentState.hpp:49
std::vector< Scalar > phase_viscosity
Segment condition phase viscosities.
Definition: SegmentState.hpp:82
std::vector< Scalar > phase_density
Definition: SegmentState.hpp:100
std::vector< Scalar > pressure_drop_friction
Definition: SegmentState.hpp:103
Scalar pressure_drop(std::size_t index) const
std::vector< Scalar > phase_velocity
Segment condition flow velocity through segment (per phase)
Definition: SegmentState.hpp:76
SegmentState(int num_phases, const WellSegments &segments)
const std::vector< int > & segment_number() const
SegmentState()=default
std::vector< Scalar > phase_resv_rates
Segment condition volume flow rates through segment (per phase)
Definition: SegmentState.hpp:73
std::size_t size() const
std::vector< Scalar > vaporized_oil_rate
Definition: SegmentState.hpp:70
bool empty() const
std::vector< Scalar > pressure_drop_hydrostatic
Definition: SegmentState.hpp:104
std::vector< Scalar > dissolved_gas_rate
Definition: SegmentState.hpp:69
static SegmentState serializationTestObject()
VFPEvaluation bhp(const VFPProdTable &table, const double aqua, const double liquid, const double vapour, const double thp, const double alq, const double explicit_wfr, const double explicit_gfr, const bool use_vfpexplicit)
Definition: BlackoilPhases.hpp:27