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
29#include <opm/simulators/utils/BlackoilPhases.hpp>
30
31#include <limits>
32#include <optional>
33#include <vector>
34
35namespace Opm
36{
37namespace RateConverter
38{
39 template <class FluidSystem, class Region> class SurfaceToReservoirVoidage;
40}
41
42class Group;
43template<class Scalar> class GroupState;
44class Schedule;
45struct RatioLimitCheckReport;
46template<class Scalar> class SingleWellState;
47template<class Scalar> class WellState;
48
49template<class FluidSystem>
50class WellInterfaceFluidSystem : public WellInterfaceGeneric<typename FluidSystem::Scalar>
51{
52protected:
53 using RateConverterType = RateConverter::
54 SurfaceToReservoirVoidage<FluidSystem, std::vector<int>>;
55 // to indicate a invalid completion
56 static constexpr int INVALIDCOMPLETION = std::numeric_limits<int>::max();
57
58public:
59 using Scalar = typename FluidSystem::Scalar;
60 using ModelParameters = typename WellInterfaceGeneric<Scalar>::ModelParameters;
61
62 int flowPhaseToModelPhaseIdx(const int phaseIdx) const;
63
64 static constexpr int Water = BlackoilPhases::Aqua;
65 static constexpr int Oil = BlackoilPhases::Liquid;
66 static constexpr int Gas = BlackoilPhases::Vapour;
67
68 const RateConverterType& rateConverter() const
69 {
70 return rateConverter_;
71 }
72
73protected:
76 const int time_step,
77 const ModelParameters& param,
79 const int pvtRegionIdx,
80 const int num_components,
81 const int num_phases,
82 const int index_of_well,
83 const std::vector<PerforationData<Scalar>>& perf_data);
84
85 // updating the voidage rates in well_state when requested
86 void calculateReservoirRates(const bool co2store, SingleWellState<Scalar>& ws) const;
87
88 bool checkIndividualConstraints(SingleWellState<Scalar>& ws,
89 const SummaryState& summaryState,
91 const std::optional<Well::InjectionControls>& inj_controls = std::nullopt,
92 const std::optional<Well::ProductionControls>& prod_controls = std::nullopt) const;
93
94 bool checkGroupConstraints(WellState<Scalar>& well_state,
95 const GroupState<Scalar>& group_state,
96 const Schedule& schedule,
97 const SummaryState& summaryState,
99
100 bool checkConstraints(WellState<Scalar>& well_state,
101 const GroupState<Scalar>& group_state,
102 const Schedule& schedule,
103 const SummaryState& summaryState,
105
106 std::optional<Scalar>
107 getGroupInjectionTargetRate(const Group& group,
108 const WellState<Scalar>& well_state,
109 const GroupState<Scalar>& group_state,
110 const Schedule& schedule,
111 const SummaryState& summaryState,
113 Scalar efficiencyFactor,
115
116 Scalar
117 getGroupProductionTargetRate(const Group& group,
118 const WellState<Scalar>& well_state,
119 const GroupState<Scalar>& group_state,
120 const Schedule& schedule,
121 const SummaryState& summaryState,
122 Scalar efficiencyFactor,
124
125 bool zeroGroupRateTarget(const SummaryState& summary_state,
126 const Schedule& schedule,
127 const WellState<Scalar>& well_state,
128 const GroupState<Scalar>& group_state,
130
131 // For the conversion between the surface volume rate and reservoir voidage rate
132 const RateConverterType& rateConverter_;
133};
134
135}
136
137#endif // OPM_WELLINTERFACE_FLUID_SYSTEM_HEADER_INCLUDED
Definition DeferredLogger.hpp:57
Definition GroupState.hpp:43
Class encapsulating some information about parallel wells.
Definition ParallelWellInfo.hpp:195
Convert component rates at surface conditions to phase (voidage) rates at reservoir conditions.
Definition RateConverter.hpp:71
Definition SingleWellState.hpp:42
Definition WellInterfaceFluidSystem.hpp:51
Definition WellInterfaceGeneric.hpp:53
The state of a set of wells, tailored for use by the fully implicit blackoil simulator.
Definition WellState.hpp:66
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition blackoilboundaryratevector.hh:37
constexpr auto getPropValue()
get the value data member of a property
Definition propertysystem.hh:242
Solver parameters for the BlackoilModel.
Definition BlackoilModelParameters.hpp:174
Static data associated with a well perforation.
Definition PerforationData.hpp:30