opm-simulators
BlackoilWellModelWBP.hpp
1 /*
2  Copyright 2016 SINTEF ICT, Applied Mathematics.
3  Copyright 2016 - 2017 Statoil ASA.
4  Copyright 2017 Dr. Blatt - HPC-Simulation-Software & Services
5  Copyright 2016 - 2018 IRIS AS
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 #ifndef OPM_BLACKOILWELLMODEL_WBP_HEADER_INCLUDED
24 #define OPM_BLACKOILWELLMODEL_WBP_HEADER_INCLUDED
25 
26 #include <opm/output/data/Wells.hpp>
27 
28 #include <opm/simulators/wells/ParallelWBPCalculation.hpp>
29 #include <opm/simulators/wells/WellInterfaceGeneric.hpp>
30 
31 #include <cstddef>
32 #include <optional>
33 #include <vector>
34 
35 namespace Opm {
36 
37 template<typename Scalar, typename IndexTraits> class BlackoilWellModelGeneric;
38 
40 template<typename Scalar, typename IndexTraits>
42 {
43 public:
45 
46  void initializeSources(typename ParallelWBPCalculation<Scalar>::GlobalToLocal index,
48 
49  void registerOpenWellsForWBPCalculation();
50 
52  makeWellSourceEvaluatorFactory(const std::vector<Well>::size_type wellIdx) const;
53 
54  void initializeWBPCalculationService();
55 
56  data::WellBlockAveragePressures
57  computeWellBlockAveragePressures(const Scalar gravity) const;
58 
59 private:
61  mutable ParallelWBPCalculation<Scalar> wbpCalculationService_;
62 
63  struct WBPCalcID
64  {
65  std::optional<typename std::vector<WellInterfaceGeneric<Scalar, IndexTraits>*>::size_type> openWellIdx_{};
66  std::size_t wbpCalcIdx_{};
67  };
68 
69  std::vector<WBPCalcID> wbpCalcMap_{};
70 };
71 
72 
73 } // namespace Opm
74 
75 #endif
Class for handling the blackoil well model.
Definition: ActionHandler.hpp:39
Parallel facility for managing the on-rank collection and global distribution of WBPn source values a...
Definition: ParallelWBPCalculation.hpp:50
typename ParallelPAvgDynamicSourceData< Scalar >::GlobalToLocal GlobalToLocal
Callback for inferring the source locations which are active on the current MPI rank.
Definition: ParallelWBPCalculation.hpp:55
std::function< Evaluator()> EvaluatorFactory
Callback for constructing a source term evaluation function on the current MPI rank.
Definition: ParallelWBPCalculation.hpp:63
This file contains a set of helper functions used by VFPProd / VFPInj.
Definition: blackoilbioeffectsmodules.hh:45
typename ParallelPAvgDynamicSourceData< Scalar >::Evaluator Evaluator
Callback for evaluating WBPn source terms on the current MPI rank.
Definition: ParallelWBPCalculation.hpp:58
Class for handling the blackoil well model.
Definition: BlackoilWellModelWBP.hpp:41