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