My Project
WellInterfaceFluidSystem.hpp
1/*
2 Copyright 2017 SINTEF Digital, Mathematics and Cybernetics.
3 Copyright 2017 Statoil ASA.
4 Copyright 2017 IRIS
5 Copyright 2019 Norce
6
7 This file is part of the Open Porous Media project (OPM).
8
9 OPM is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
13
14 OPM is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
18
19 You should have received a copy of the GNU General Public License
20 along with OPM. If not, see <http://www.gnu.org/licenses/>.
21*/
22
23
24#ifndef OPM_WELLINTERFACE_FLUID_SYSTEM_HEADER_INCLUDED
25#define OPM_WELLINTERFACE_FLUID_SYSTEM_HEADER_INCLUDED
26
27#include <opm/simulators/wells/WellInterfaceGeneric.hpp>
28#include <opm/core/props/BlackoilPhases.hpp>
29
30#include <limits>
31
32namespace Opm
33{
34namespace RateConverter
35{
36 template <class FluidSystem, class Region> class SurfaceToReservoirVoidage;
37}
38
39class Group;
40class GroupState;
41class Schedule;
42struct RatioLimitCheckReport;
43class SingleWellState;
44class WellState;
45
46template<class FluidSystem>
48protected:
49 using RateConverterType = RateConverter::
50 SurfaceToReservoirVoidage<FluidSystem, std::vector<int>>;
51 // to indicate a invalid completion
52 static constexpr int INVALIDCOMPLETION = std::numeric_limits<int>::max();
53
54public:
55 int flowPhaseToEbosPhaseIdx(const int phaseIdx) const;
56
57 static constexpr int Water = BlackoilPhases::Aqua;
58 static constexpr int Oil = BlackoilPhases::Liquid;
59 static constexpr int Gas = BlackoilPhases::Vapour;
60
61 const RateConverterType& rateConverter() const
62 {
63 return rateConverter_;
64 }
65
66protected:
67 WellInterfaceFluidSystem(const Well& well,
68 const ParallelWellInfo& parallel_well_info,
69 const int time_step,
70 const RateConverterType& rate_converter,
71 const int pvtRegionIdx,
72 const int num_components,
73 const int num_phases,
74 const int index_of_well,
75 const std::vector<PerforationData>& perf_data);
76
77 // updating the voidage rates in well_state when requested
78 void calculateReservoirRates(SingleWellState& ws) const;
79
80 bool checkIndividualConstraints(SingleWellState& ws,
81 const SummaryState& summaryState,
82 DeferredLogger& deferred_logger) const;
83
84 bool checkGroupConstraints(WellState& well_state,
85 const GroupState& group_state,
86 const Schedule& schedule,
87 const SummaryState& summaryState,
88 DeferredLogger& deferred_logger) const;
89
90 bool checkConstraints(WellState& well_state,
91 const GroupState& group_state,
92 const Schedule& schedule,
93 const SummaryState& summaryState,
94 DeferredLogger& deferred_logger) const;
95
96 std::optional<double>
97 getGroupInjectionTargetRate(const Group& group,
98 const WellState& well_state,
99 const GroupState& group_state,
100 const Schedule& schedule,
101 const SummaryState& summaryState,
102 const InjectorType& injectorType,
103 double efficiencyFactor,
104 DeferredLogger& deferred_logger) const;
105
106 double
107 getGroupProductionTargetRate(const Group& group,
108 const WellState& well_state,
109 const GroupState& group_state,
110 const Schedule& schedule,
111 const SummaryState& summaryState,
112 double efficiencyFactor,
113 DeferredLogger& deferred_logger) const;
114
115 // For the conversion between the surface volume rate and reservoir voidage rate
116 const RateConverterType& rateConverter_;
117};
118
119}
120
121#endif // OPM_WELLINTERFACE_FLUID_SYSTEM_HEADER_INCLUDED
Definition: DeferredLogger.hpp:57
Definition: GroupState.hpp:34
Class encapsulating some information about parallel wells.
Definition: ParallelWellInfo.hpp:184
Convert component rates at surface conditions to phase (voidage) rates at reservoir conditions.
Definition: RateConverter.hpp:70
Definition: SingleWellState.hpp:40
Definition: WellInterfaceFluidSystem.hpp:47
Definition: WellInterfaceGeneric.hpp:51
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition: WellState.hpp:60
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: BlackoilPhases.hpp:27