My Project
Loading...
Searching...
No Matches
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:
69 const int time_step,
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,
83 const std::optional<Well::InjectionControls>& inj_controls = std::nullopt,
84 const std::optional<Well::ProductionControls>& prod_controls = std::nullopt) const;
85
86 bool checkGroupConstraints(WellState& well_state,
87 const GroupState& group_state,
88 const Schedule& schedule,
89 const SummaryState& summaryState,
91
92 bool checkConstraints(WellState& well_state,
93 const GroupState& group_state,
94 const Schedule& schedule,
95 const SummaryState& summaryState,
97
98 std::optional<double>
99 getGroupInjectionTargetRate(const Group& group,
100 const WellState& well_state,
101 const GroupState& group_state,
102 const Schedule& schedule,
103 const SummaryState& summaryState,
105 double efficiencyFactor,
107
108 double
109 getGroupProductionTargetRate(const Group& group,
110 const WellState& well_state,
111 const GroupState& group_state,
112 const Schedule& schedule,
113 const SummaryState& summaryState,
114 double efficiencyFactor,
116
117 // For the conversion between the surface volume rate and reservoir voidage rate
118 const RateConverterType& rateConverter_;
119};
120
121}
122
123#endif // OPM_WELLINTERFACE_FLUID_SYSTEM_HEADER_INCLUDED
Definition AquiferInterface.hpp:35
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