opm-simulators
WellProdIndexCalculator.hpp
1 /*
2  Copyright 2020 Equinor ASA.
3 
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 #ifndef OPM_WELLPRODINDEXCALCULATOR_HEADER_INCLUDED
21 #define OPM_WELLPRODINDEXCALCULATOR_HEADER_INCLUDED
22 
23 #include <cstddef>
24 #include <vector>
25 
26 namespace Opm {
27  class Well;
28 } // namespace Opm
29 
30 namespace Opm {
31 
35 template<class Scalar>
37 {
38 public:
43  explicit WellProdIndexCalculator(const Well& well);
44 
53  void reInit(const Well& well);
54 
66  Scalar connectionProdIndStandard(const std::size_t connIdx,
67  const Scalar connMobility) const;
68 
72  std::size_t numConnections() const
73  {
74  return this->standardConnFactors_.size();
75  }
76 
77 private:
83  std::vector<Scalar> standardConnFactors_{};
84 };
85 
98 template<class Scalar>
99 std::vector<Scalar>
100 connectionProdIndStandard(const WellProdIndexCalculator<Scalar>& wellPICalc,
101  const std::vector<Scalar>& connMobility);
102 
113 template<class Scalar>
114 Scalar wellProdIndStandard(const WellProdIndexCalculator<Scalar>& wellPICalc,
115  const std::vector<Scalar>& connMobility);
116 
117 } // namespace Opm
118 
119 #endif // OPM_WELLPRODINDEXCALCULATOR_HEADER_INCLUDED
std::vector< Scalar > connectionProdIndStandard(const WellProdIndexCalculator< Scalar > &wellPICalc, const std::vector< Scalar > &connMobility)
Compute connection-level productivity index values for all connections in a well. ...
Definition: WellProdIndexCalculator.cpp:127
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
std::size_t numConnections() const
Number of connections in this well.
Definition: WellProdIndexCalculator.hpp:72
Scalar wellProdIndStandard(const WellProdIndexCalculator< Scalar > &wellPICalc, const std::vector< Scalar > &connMobility)
Compute well-level productivity index value.
Definition: WellProdIndexCalculator.cpp:143
Collect per-connection static information to enable calculating connection-level or well-level produc...
Definition: WellProdIndexCalculator.hpp:36
void reInit(const Well &well)
Reinitialization operation.
Definition: WellProdIndexCalculator.cpp:110
WellProdIndexCalculator(const Well &well)
Constructor.
Definition: WellProdIndexCalculator.cpp:104
Scalar connectionProdIndStandard(const std::size_t connIdx, const Scalar connMobility) const
Compute connection-level steady-state productivity index value using dynamic phase mobility...
Definition: WellProdIndexCalculator.cpp:117