My Project
Loading...
Searching...
No Matches
Tuning.hpp
1/*
2 Copyright 2015 Statoil 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_TUNING_HPP
21#define OPM_TUNING_HPP
22
23#include <optional>
24
25namespace Opm {
26
27 class NextStep {
28 public:
29 NextStep() = default;
30 NextStep(double value, bool every_report);
31 double value() const;
32 bool every_report() const;
33 bool operator==(const NextStep& other) const;
34 static NextStep serializationTestObject();
35
36 template<class Serializer>
37 void serializeOp(Serializer& serializer)
38 {
39 serializer(this->next_tstep);
40 serializer(this->persist);
41 }
42
43 private:
44 double next_tstep;
45 bool persist;
46 };
47
48 struct Tuning {
49 Tuning();
50
51 static Tuning serializationTestObject();
52
53 // Record1
54 std::optional<double> TSINIT;
55 double TSMAXZ;
56 double TSMINZ;
57 double TSMCHP;
58 double TSFMAX;
59 double TSFMIN;
60 double TFDIFF;
61 double TSFCNV;
62 double THRUPT;
63 double TMAXWC = 0.0;
64 bool TMAXWC_has_value = false;
65
66 // Record 2
67 double TRGTTE;
68 double TRGCNV;
69 double TRGMBE;
70 double TRGLCV;
71 double XXXTTE;
72 double XXXCNV;
73 double XXXMBE;
74 double XXXLCV;
75 double XXXWFL;
76 double TRGFIP;
77 double TRGSFT = 0.0;
78 bool TRGSFT_has_value = false;
79 double THIONX;
80 double TRWGHT;
81
82 // Record 3
83 int NEWTMX;
84 int NEWTMN;
85 int LITMAX;
86 int LITMIN;
87 int MXWSIT;
88 int MXWPIT;
89 double DDPLIM;
90 double DDSLIM;
91 double TRGDPR;
92 double XXXDPR;
93 bool XXXDPR_has_value = false;
94
95 /*
96 In addition to the values set in the TUNING keyword this Tuning
97 implementation also contains the result of the WSEGITER keyword, which
98 is special tuning parameters to be applied to the multisegment well
99 model. Observe that the maximum number of well iterations - MXWSIT -
100 is specified by both the TUNING keyword and the WSEGITER keyword, but
101 with different defaults.
102 */
103 int WSEG_MAX_RESTART;
104 double WSEG_REDUCTION_FACTOR;
105 double WSEG_INCREASE_FACTOR;
106
107
108 bool operator==(const Tuning& data) const;
109 bool operator !=(const Tuning& data) const {
110 return !(*this == data);
111 }
112
113 template<class Serializer>
114 void serializeOp(Serializer& serializer)
115 {
116 serializer(TSINIT);
117 serializer(TSMAXZ);
118 serializer(TSMINZ);
119 serializer(TSMCHP);
120 serializer(TSFMAX);
121 serializer(TSFMIN);
122 serializer(TFDIFF);
123 serializer(TSFCNV);
124 serializer(THRUPT);
125 serializer(TMAXWC);
126 serializer(TMAXWC_has_value);
127
128 serializer(TRGTTE);
129 serializer(TRGCNV);
130 serializer(TRGMBE);
131 serializer(TRGLCV);
132 serializer(XXXTTE);
133 serializer(XXXCNV);
134 serializer(XXXMBE);
135 serializer(XXXLCV);
136 serializer(XXXWFL);
137 serializer(TRGFIP);
138 serializer(TRGSFT);
139 serializer(TRGSFT_has_value);
140 serializer(THIONX);
141 serializer(TRWGHT);
142
143 serializer(NEWTMX);
144 serializer(NEWTMN);
145 serializer(LITMAX);
146 serializer(LITMIN);
147 serializer(MXWSIT);
148 serializer(MXWPIT);
149 serializer(DDPLIM);
150 serializer(DDSLIM);
151 serializer(TRGDPR);
152 serializer(XXXDPR);
153 serializer(XXXDPR_has_value);
154
155 serializer(WSEG_MAX_RESTART);
156 serializer(WSEG_REDUCTION_FACTOR);
157 serializer(WSEG_INCREASE_FACTOR);
158 }
159 };
160
161} //namespace Opm
162
163#endif
Definition Tuning.hpp:27
Class for (de-)serializing.
Definition Serializer.hpp:84
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Definition Tuning.hpp:48