My Project
Loading...
Searching...
No Matches
MultisegmentWellGeneric.hpp
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 <vector>
26
27namespace Opm
28{
29
30class DeferredLogger;
31class SummaryState;
32template<class Scalar> class WellInterfaceGeneric;
34class WellSegments;
35template<class Scalar> class WellState;
36
37template <typename Scalar>
39{
40public:
41 // get the WellSegments from the well_ecl_
42 const WellSegments& segmentSet() const;
43
44 // segment number is an ID of the segment, it is specified in the deck
45 // get the loation of the segment with a segment number in the segmentSet
46 int segmentNumberToIndex(const int segment_number) const;
47
49 int numberOfSegments() const;
50
51protected:
53
54 // scale the segment rates and pressure based on well rates and bhp
55 void scaleSegmentRatesWithWellRates(const std::vector<std::vector<int>>& segment_inlets,
56 const std::vector<std::vector<int>>& segment_perforations,
57 WellState<Scalar>& well_state) const;
58 void scaleSegmentPressuresWithBhp(WellState<Scalar>& well_state) const;
59
60 // components of the pressure drop to be included
61 WellSegmentCompPressureDrop compPressureDrop() const;
62
64 bool update_relaxation_factor(const std::vector<Scalar>& measure_history, Scalar& relaxation_factor, bool& regularize, DeferredLogger& deferred_logger) const;
65 bool repeatedStagnation(const std::vector<Scalar>& measure_history, bool& regularize, DeferredLogger& deferred_logger) const;
66
67 bool accelerationalPressureLossConsidered() const;
68 bool frictionalPressureLossConsidered() const;
69
70 Scalar getSegmentDp(const int seg,
71 const Scalar density,
72 const std::vector<Scalar>& seg_dp) const;
73
74 const WellInterfaceGeneric<Scalar>& baseif_;
75};
76
77}
78
79#endif // OPM_MULTISEGMENTWELL_GENERIC_HEADER_INCLUDED
Definition DeferredLogger.hpp:57
Definition MultisegmentWellGeneric.hpp:39
int numberOfSegments() const
number of segments for this well
Definition MultisegmentWellGeneric.cpp:123
bool update_relaxation_factor(const std::vector< Scalar > &measure_history, Scalar &relaxation_factor, bool &regularize, DeferredLogger &deferred_logger) const
Detect oscillation or stagnation based on the residual measure history.
Definition MultisegmentWellGeneric.cpp:147
Definition WellInterfaceGeneric.hpp:53
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition WellState.hpp:66
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242