GuideRateModel.hpp
Go to the documentation of this file.
1/*
2 Copyright 2019 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 GUIDE_RATE_MODEL_HPP
21#define GUIDE_RATE_MODEL_HPP
22
26
27namespace Opm {
28
30public:
31
32 enum class Target {
33 OIL = 0,
34 LIQ = 1,
35 GAS = 2,
36 WAT = 3,
37 RES = 4,
38 COMB = 5,
39 NONE = 6
40 };
41
43
44 GuideRateModel(double time_interval_arg,
45 Target target_arg,
46 double A_arg,
47 double B_arg,
48 double C_arg,
49 double D_arg,
50 double E_arg,
51 double F_arg,
52 bool allow_increase_arg,
53 double damping_factor_arg,
54 bool use_free_gas_arg);
55 GuideRateModel() = default;
56
58
59 bool updateLINCOM(const UDAValue& alpha, const UDAValue& beta, const UDAValue& gamma);
60 double eval(double oil_pot, double gas_pot, double wat_pot) const;
61 double update_delay() const;
62 bool allow_increase() const;
63 double damping_factor() const;
64 bool operator==(const GuideRateModel& other) const;
65 bool operator!=(const GuideRateModel& other) const;
66 Target target() const;
67 double getA() const;
68 double getB() const;
69 double getC() const;
70 double getD() const;
71 double getE() const;
72 double getF() const;
73
76 static double pot(Target target, double oil_pot, double gas_pot, double wat_pot);
77
78 template<class Serializer>
79 void serializeOp(Serializer& serializer)
80 {
81 serializer(time_interval);
82 serializer(m_target),
83 serializer(A);
84 serializer(B);
85 serializer(C);
86 serializer(D);
87 serializer(E);
88 serializer(F);
89 serializer(allow_increase_);
90 serializer(damping_factor_);
91 serializer(use_free_gas);
92 serializer(default_model);
93 alpha.serializeOp(serializer);
94 beta.serializeOp(serializer);
95 gamma.serializeOp(serializer);
96 }
97
98private:
99 double pot(double oil_pot, double gas_pot, double wat_pot) const;
100 /*
101 Unfortunately the default values will give a GuideRateModel which can not
102 be evaluated, due to a division by zero problem.
103 */
104 double time_interval = 0;
105 Target m_target = Target::NONE;
106 double A = 0;
107 double B = 0;
108 double C = 0;
109 double D = 0;
110 double E = 0;
111 double F = 0;
112 bool allow_increase_ = true;
113 double damping_factor_ = 1.0;
114 bool use_free_gas = false;
115 bool default_model = true;
116 UDAValue alpha;
117 UDAValue beta;
118 UDAValue gamma;
119};
120
121}
122
123#endif
const char *const string
Definition: cJSON.h:170
GuideRateTarget
Definition: parser/eclipse/EclipseState/Schedule/Group/group.hpp:90
Definition: GuideRateModel.hpp:29
GuideRateModel(double time_interval_arg, Target target_arg, double A_arg, double B_arg, double C_arg, double D_arg, double E_arg, double F_arg, bool allow_increase_arg, double damping_factor_arg, bool use_free_gas_arg)
bool updateLINCOM(const UDAValue &alpha, const UDAValue &beta, const UDAValue &gamma)
static Target convert_target(Well::GuideRateTarget well_target)
bool operator!=(const GuideRateModel &other) const
bool allow_increase() const
void serializeOp(Serializer &serializer)
Definition: GuideRateModel.hpp:79
double getB() const
bool operator==(const GuideRateModel &other) const
double damping_factor() const
double getE() const
double eval(double oil_pot, double gas_pot, double wat_pot) const
double update_delay() const
static Target TargetFromString(const std::string &s)
Target
Definition: GuideRateModel.hpp:32
Target target() const
static double pot(Target target, double oil_pot, double gas_pot, double wat_pot)
double getD() const
double getC() const
static Target convert_target(Group::GuideRateTarget group_target)
GuideRateModel()=default
double getA() const
double getF() const
static GuideRateModel serializeObject()
Definition: Serializer.hpp:38
Definition: UDAValue.hpp:32
void serializeOp(Serializer &serializer)
Definition: UDAValue.hpp:72
GuideRateTarget
Definition: custom-opm-common/opm-common/opm/parser/eclipse/EclipseState/Schedule/Well/well.hpp:136
Definition: A.hpp:4