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 <vector>
26
27namespace Opm
28{
29
30class DeferredLogger;
31class SummaryState;
32template<typename Scalar, typename IndexTraits> class WellInterfaceGeneric;
33enum class WellSegmentCompPressureDrop;
34class WellSegments;
35template<typename Scalar, typename IndexTraits> class WellState;
36
37template<typename Scalar, typename IndexTraits>
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, IndexTraits>& 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
69
70 Scalar getSegmentDp(const int seg,
71 const Scalar density,
72 const std::vector<Scalar>& seg_dp) const;
73
75};
76
77}
78
79#endif // OPM_MULTISEGMENTWELL_GENERIC_HEADER_INCLUDED
Definition: DeferredLogger.hpp:57
Definition: MultisegmentWellGeneric.hpp:39
const WellSegments & segmentSet() const
void scaleSegmentRatesWithWellRates(const std::vector< std::vector< int > > &segment_inlets, const std::vector< std::vector< int > > &segment_perforations, WellState< Scalar, IndexTraits > &well_state) const
MultisegmentWellGeneric(WellInterfaceGeneric< Scalar, IndexTraits > &baseif)
bool repeatedStagnation(const std::vector< Scalar > &measure_history, bool &regularize, DeferredLogger &deferred_logger) const
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.
bool accelerationalPressureLossConsidered() const
int numberOfSegments() const
number of segments for this well
Scalar getSegmentDp(const int seg, const Scalar density, const std::vector< Scalar > &seg_dp) const
WellSegmentCompPressureDrop compPressureDrop() const
bool frictionalPressureLossConsidered() const
const WellInterfaceGeneric< Scalar, IndexTraits > & baseif_
Definition: MultisegmentWellGeneric.hpp:74
int segmentNumberToIndex(const int segment_number) const
void scaleSegmentPressuresWithBhp(WellState< Scalar, IndexTraits > &well_state) const
Definition: WellInterfaceGeneric.hpp:53
Definition: WellState.hpp:66
Definition: blackoilboundaryratevector.hh:39