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>
47class WellInterfaceFluidSystem : public WellInterfaceGeneric<typename FluidSystem::Scalar>
48{
49protected:
50 using RateConverterType = RateConverter::
51 SurfaceToReservoirVoidage<FluidSystem, std::vector<int>>;
52 // to indicate a invalid completion
53 static constexpr int INVALIDCOMPLETION = std::numeric_limits<int>::max();
54
55public:
56 using Scalar = typename FluidSystem::Scalar;
57
58 int flowPhaseToModelPhaseIdx(const int phaseIdx) const;
59
60 static constexpr int Water = BlackoilPhases::Aqua;
61 static constexpr int Oil = BlackoilPhases::Liquid;
62 static constexpr int Gas = BlackoilPhases::Vapour;
63
65 {
66 return rateConverter_;
67 }
68
69protected:
70 WellInterfaceFluidSystem(const Well& well,
71 const ParallelWellInfo& parallel_well_info,
72 const int time_step,
73 const RateConverterType& rate_converter,
74 const int pvtRegionIdx,
75 const int num_components,
76 const int num_phases,
77 const int index_of_well,
78 const std::vector<PerforationData>& perf_data);
79
80 // updating the voidage rates in well_state when requested
82
84 const SummaryState& summaryState,
85 DeferredLogger& deferred_logger,
86 const std::optional<Well::InjectionControls>& inj_controls = std::nullopt,
87 const std::optional<Well::ProductionControls>& prod_controls = std::nullopt) const;
88
90 const GroupState<Scalar>& group_state,
91 const Schedule& schedule,
92 const SummaryState& summaryState,
93 DeferredLogger& deferred_logger) const;
94
96 const GroupState<Scalar>& group_state,
97 const Schedule& schedule,
98 const SummaryState& summaryState,
99 DeferredLogger& deferred_logger) const;
100
101 std::optional<Scalar>
102 getGroupInjectionTargetRate(const Group& group,
103 const WellState<Scalar>& well_state,
104 const GroupState<Scalar>& group_state,
105 const Schedule& schedule,
106 const SummaryState& summaryState,
107 const InjectorType& injectorType,
108 Scalar efficiencyFactor,
109 DeferredLogger& deferred_logger) const;
110
111 Scalar
113 const WellState<Scalar>& well_state,
114 const GroupState<Scalar>& group_state,
115 const Schedule& schedule,
116 const SummaryState& summaryState,
117 Scalar efficiencyFactor,
118 DeferredLogger& deferred_logger) const;
119
120 // For the conversion between the surface volume rate and reservoir voidage rate
122};
123
124}
125
126#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
Definition: GroupState.hpp:35
Class encapsulating some information about parallel wells.
Definition: ParallelWellInfo.hpp:184
Definition: RateConverter.hpp:70
Definition: SingleWellState.hpp:41
Definition: WellInterfaceFluidSystem.hpp:48
bool checkConstraints(WellState< Scalar > &well_state, const GroupState< Scalar > &group_state, const Schedule &schedule, const SummaryState &summaryState, DeferredLogger &deferred_logger) const
std::optional< Scalar > getGroupInjectionTargetRate(const Group &group, const WellState< Scalar > &well_state, const GroupState< Scalar > &group_state, const Schedule &schedule, const SummaryState &summaryState, const InjectorType &injectorType, Scalar efficiencyFactor, DeferredLogger &deferred_logger) const
const RateConverterType & rateConverter() const
Definition: WellInterfaceFluidSystem.hpp:64
bool checkGroupConstraints(WellState< Scalar > &well_state, const GroupState< Scalar > &group_state, const Schedule &schedule, const SummaryState &summaryState, DeferredLogger &deferred_logger) const
bool checkIndividualConstraints(SingleWellState< Scalar > &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
static constexpr int Oil
Definition: WellInterfaceFluidSystem.hpp:61
int flowPhaseToModelPhaseIdx(const int phaseIdx) const
Scalar getGroupProductionTargetRate(const Group &group, const WellState< Scalar > &well_state, const GroupState< Scalar > &group_state, const Schedule &schedule, const SummaryState &summaryState, Scalar efficiencyFactor, DeferredLogger &deferred_logger) const
static constexpr int Water
Definition: WellInterfaceFluidSystem.hpp:60
typename FluidSystem::Scalar Scalar
Definition: WellInterfaceFluidSystem.hpp:56
static constexpr int Gas
Definition: WellInterfaceFluidSystem.hpp:62
const RateConverterType & rateConverter_
Definition: WellInterfaceFluidSystem.hpp:121
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)
void calculateReservoirRates(SingleWellState< Scalar > &ws) const
static constexpr int INVALIDCOMPLETION
Definition: WellInterfaceFluidSystem.hpp:53
Definition: WellInterfaceGeneric.hpp:51
int pvtRegionIdx() const
Definition: WellInterfaceGeneric.hpp:118
Definition: WellState.hpp:62
Definition: BlackoilPhases.hpp:27