WellInterfaceFluidSystem.hpp
Go to the documentation of this file.
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
29
30#include <limits>
31
32namespace Opm
33{
34namespace RateConverter
35{
36 template <class FluidSystem, class Region> class SurfaceToReservoirVoidage;
37}
38
39class Group;
40template<class Scalar> class GroupState;
41class Schedule;
42struct RatioLimitCheckReport;
43template<class Scalar> class SingleWellState;
44template<class Scalar> class 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 flowPhaseToModelPhaseIdx(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
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
79
81 const SummaryState& summaryState,
82 DeferredLogger& deferred_logger,
83 const std::optional<Well::InjectionControls>& inj_controls = std::nullopt,
84 const std::optional<Well::ProductionControls>& prod_controls = std::nullopt) const;
85
87 const GroupState<double>& group_state,
88 const Schedule& schedule,
89 const SummaryState& summaryState,
90 DeferredLogger& deferred_logger) const;
91
93 const GroupState<double>& group_state,
94 const Schedule& schedule,
95 const SummaryState& summaryState,
96 DeferredLogger& deferred_logger) const;
97
98 std::optional<double>
99 getGroupInjectionTargetRate(const Group& group,
100 const WellState<double>& well_state,
101 const GroupState<double>& group_state,
102 const Schedule& schedule,
103 const SummaryState& summaryState,
104 const InjectorType& injectorType,
105 double efficiencyFactor,
106 DeferredLogger& deferred_logger) const;
107
108 double
110 const WellState<double>& well_state,
111 const GroupState<double>& group_state,
112 const Schedule& schedule,
113 const SummaryState& summaryState,
114 double efficiencyFactor,
115 DeferredLogger& deferred_logger) const;
116
117 // For the conversion between the surface volume rate and reservoir voidage rate
119};
120
121}
122
123#endif // OPM_WELLINTERFACE_FLUID_SYSTEM_HEADER_INCLUDED
@ Liquid
Definition: BlackoilPhases.hpp:42
@ Aqua
Definition: BlackoilPhases.hpp:42
@ Vapour
Definition: BlackoilPhases.hpp:42
Definition: DeferredLogger.hpp:57
Class encapsulating some information about parallel wells.
Definition: ParallelWellInfo.hpp:184
Definition: RateConverter.hpp:70
Definition: WellInterfaceFluidSystem.hpp:47
const RateConverterType & rateConverter() const
Definition: WellInterfaceFluidSystem.hpp:61
void calculateReservoirRates(SingleWellState< double > &ws) const
std::optional< double > getGroupInjectionTargetRate(const Group &group, const WellState< double > &well_state, const GroupState< double > &group_state, const Schedule &schedule, const SummaryState &summaryState, const InjectorType &injectorType, double efficiencyFactor, DeferredLogger &deferred_logger) const
static constexpr int Oil
Definition: WellInterfaceFluidSystem.hpp:58
int flowPhaseToModelPhaseIdx(const int phaseIdx) const
static constexpr int Water
Definition: WellInterfaceFluidSystem.hpp:57
bool checkIndividualConstraints(SingleWellState< double > &ws, const SummaryState &summaryState, DeferredLogger &deferred_logger, const std::optional< Well::InjectionControls > &inj_controls=std::nullopt, const std::optional< Well::ProductionControls > &prod_controls=std::nullopt) const
bool checkGroupConstraints(WellState< double > &well_state, const GroupState< double > &group_state, const Schedule &schedule, const SummaryState &summaryState, DeferredLogger &deferred_logger) const
static constexpr int Gas
Definition: WellInterfaceFluidSystem.hpp:59
const RateConverterType & rateConverter_
Definition: WellInterfaceFluidSystem.hpp:118
bool checkConstraints(WellState< double > &well_state, const GroupState< double > &group_state, const Schedule &schedule, const SummaryState &summaryState, DeferredLogger &deferred_logger) const
WellInterfaceFluidSystem(const Well &well, const ParallelWellInfo &parallel_well_info, const int time_step, const RateConverterType &rate_converter, const int pvtRegionIdx, const int num_components, const int num_phases, const int index_of_well, const std::vector< PerforationData > &perf_data)
static constexpr int INVALIDCOMPLETION
Definition: WellInterfaceFluidSystem.hpp:52
double getGroupProductionTargetRate(const Group &group, const WellState< double > &well_state, const GroupState< double > &group_state, const Schedule &schedule, const SummaryState &summaryState, double efficiencyFactor, DeferredLogger &deferred_logger) const
Definition: WellInterfaceGeneric.hpp:50
int pvtRegionIdx() const
Definition: WellInterfaceGeneric.hpp:126
Definition: BlackoilPhases.hpp:27