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;
30struct PhaseUsage;
31class Schedule;
32template<class Scalar> class WellState;
33}
34
35namespace Opm::WGHelpers {
36
37template<class Scalar>
39{
40public:
41 FractionCalculator(const Schedule& schedule,
42 const WellState<Scalar>& well_state,
43 const GroupState<Scalar>& group_state,
44 const int report_step,
45 const GuideRate* guide_rate,
46 const GuideRateModel::Target target,
47 const PhaseUsage& pu,
48 const bool is_producer,
49 const Phase injection_phase);
50 Scalar fraction(const std::string& name,
51 const std::string& control_group_name,
52 const bool always_include_this);
53 Scalar localFraction(const std::string& name,
54 const std::string& always_included_child);
55
56private:
57 std::string parent(const std::string& name);
58 Scalar guideRateSum(const Group& group,
59 const std::string& always_included_child);
60 Scalar guideRate(const std::string& name,
61 const std::string& always_included_child);
62 int groupControlledWells(const std::string& group_name,
63 const std::string& always_included_child);
64 GuideRate::RateVector getGroupRateVector(const std::string& group_name);
65 const Schedule& schedule_;
66 const WellState<Scalar>& well_state_;
67 const GroupState<Scalar>& group_state_;
68 int report_step_;
69 const GuideRate* guide_rate_;
70 GuideRateModel::Target target_;
71 const PhaseUsage& pu_;
72 bool is_producer_;
73 Phase injection_phase_;
74};
75
76} // namespace Opm::WGHelpers
77
78#endif // OPM_FRACTION_CALCULATOR_HEADER_INCLUDED
Definition: GroupState.hpp:35
Definition: FractionCalculator.hpp:39
Scalar fraction(const std::string &name, const std::string &control_group_name, const bool always_include_this)
Scalar localFraction(const std::string &name, const std::string &always_included_child)
FractionCalculator(const Schedule &schedule, const WellState< Scalar > &well_state, const GroupState< Scalar > &group_state, const int report_step, const GuideRate *guide_rate, const GuideRateModel::Target target, const PhaseUsage &pu, const bool is_producer, const Phase injection_phase)
Definition: WellState.hpp:62
Definition: FractionCalculator.hpp:35
Definition: BlackoilPhases.hpp:27
Definition: BlackoilPhases.hpp:46