FractionCalculator.hpp
Go to the documentation of this file.
1/*
2 Copyright 2019 Norce.
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
21#ifndef OPM_FRACTION_CALCULATOR_HEADER_INCLUDED
22#define OPM_FRACTION_CALCULATOR_HEADER_INCLUDED
23
24#include <opm/input/eclipse/Schedule/Group/GuideRate.hpp>
25
26#include <string>
27
28namespace Opm {
29template<class Scalar> class GroupState;
30class Schedule;
31template<typename Scalar, typename IndexTraits> class WellGroupHelper;
32template<typename Scalar, typename IndexTraits> class WellState;
33}
34
35namespace Opm::WGHelpers {
36
37template<typename Scalar, typename IndexTraits>
39{
40public:
42
43 FractionCalculator(const Schedule& schedule,
44 const WellGroupHelperType& wgHelper,
45 const SummaryState& summary_state,
46 const int report_step,
47 const GuideRate* guide_rate,
48 const GuideRateModel::Target target,
49 const bool is_producer,
50 const Phase injection_phase);
51 Scalar fraction(const std::string& name,
52 const std::string& control_group_name,
53 const bool always_include_this);
54 Scalar localFraction(const std::string& name,
55 const std::string& always_included_child);
56
57private:
58 std::string parent(const std::string& name);
59
60 // returns the sum of the guiderates of the given group
61 // and the number of sub-groups/wells that contributed to the sum
62 std::pair<Scalar,int> guideRateSum(const Group& group,
63 const std::string& always_included_child,
64 const bool always_use_potentials);
65 Scalar guideRate(const std::string& name,
66 const std::string& always_included_child,
67 const bool always_use_potentials);
68 int groupControlledWells(const std::string& group_name,
69 const std::string& always_included_child);
70 GuideRate::RateVector getGroupRateVector(const std::string& group_name);
71 const WellGroupHelperType& wgHelper() const { return wgHelper_; }
72
73 const Schedule& schedule_;
74 const WellGroupHelperType& wgHelper_;
75 const SummaryState& summary_state_;
76 int report_step_;
77 const GuideRate* guide_rate_;
78 GuideRateModel::Target target_;
79 bool is_producer_;
80 Phase injection_phase_;
81};
82
83} // namespace Opm::WGHelpers
84
85#endif // OPM_FRACTION_CALCULATOR_HEADER_INCLUDED
Definition: FractionCalculator.hpp:39
Scalar localFraction(const std::string &name, const std::string &always_included_child)
FractionCalculator(const Schedule &schedule, const WellGroupHelperType &wgHelper, const SummaryState &summary_state, const int report_step, const GuideRate *guide_rate, const GuideRateModel::Target target, const bool is_producer, const Phase injection_phase)
WellGroupHelper< Scalar, IndexTraits > WellGroupHelperType
Definition: FractionCalculator.hpp:41
Scalar fraction(const std::string &name, const std::string &control_group_name, const bool always_include_this)
Definition: WellGroupHelper.hpp:51
Definition: FractionCalculator.hpp:35
Definition: blackoilbioeffectsmodules.hh:43