MultisegmentWellGeneric.hpp
Go to the documentation of this file.
1/*
2 Copyright 2017 SINTEF Digital, Mathematics and Cybernetics.
3 Copyright 2017 Statoil ASA.
4
5 This file is part of the Open Porous Media project (OPM).
6
7 OPM is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
11
12 OPM is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with OPM. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21
22#ifndef OPM_MULTISEGMENTWELL_GENERIC_HEADER_INCLUDED
23#define OPM_MULTISEGMENTWELL_GENERIC_HEADER_INCLUDED
24
25#include <functional>
26#include <optional>
27#include <vector>
28#include <array>
29
30namespace Opm
31{
32
33class DeferredLogger;
34class SummaryState;
35class WellInterfaceGeneric;
36enum class WellSegmentCompPressureDrop;
37class WellSegments;
38template<class Scalar> class WellState;
39
40template <typename Scalar>
42{
43public:
44 // get the WellSegments from the well_ecl_
45 const WellSegments& segmentSet() const;
46
47 // segment number is an ID of the segment, it is specified in the deck
48 // get the loation of the segment with a segment number in the segmentSet
49 int segmentNumberToIndex(const int segment_number) const;
50
52 int numberOfSegments() const;
53
54protected:
56
57 // scale the segment rates and pressure based on well rates and bhp
58 void scaleSegmentRatesWithWellRates(const std::vector<std::vector<int>>& segment_inlets,
59 const std::vector<std::vector<int>>& segment_perforations,
60 WellState<Scalar>& well_state) const;
62
63 // components of the pressure drop to be included
64 WellSegmentCompPressureDrop compPressureDrop() const;
65
67 void detectOscillations(const std::vector<double>& measure_history,
68 bool& oscillate,
69 bool& stagnate) const;
70
73
74 double getSegmentDp(const int seg,
75 const double density,
76 const std::vector<double>& seg_dp) const;
77
79};
80
81}
82
83#endif // OPM_MULTISEGMENTWELL_GENERIC_HEADER_INCLUDED
Definition: MultisegmentWellGeneric.hpp:42
void scaleSegmentPressuresWithBhp(WellState< Scalar > &well_state) const
MultisegmentWellGeneric(WellInterfaceGeneric &baseif)
int numberOfSegments() const
number of segments for this well
double getSegmentDp(const int seg, const double density, const std::vector< double > &seg_dp) const
int segmentNumberToIndex(const int segment_number) const
const WellInterfaceGeneric & baseif_
Definition: MultisegmentWellGeneric.hpp:78
const WellSegments & segmentSet() const
void scaleSegmentRatesWithWellRates(const std::vector< std::vector< int > > &segment_inlets, const std::vector< std::vector< int > > &segment_perforations, WellState< Scalar > &well_state) const
void detectOscillations(const std::vector< double > &measure_history, bool &oscillate, bool &stagnate) const
Detect oscillation or stagnation based on the residual measure history.
bool accelerationalPressureLossConsidered() const
bool frictionalPressureLossConsidered() const
WellSegmentCompPressureDrop compPressureDrop() const
Definition: WellInterfaceGeneric.hpp:50
Definition: WellState.hpp:62
Definition: BlackoilPhases.hpp:27