opm-common
DoubHEAD.hpp
1 /*
2  Copyright 2018 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_DOUBHEAD_HEADER_INCLUDED
21 #define OPM_DOUBHEAD_HEADER_INCLUDED
22 
23 #include <chrono>
24 #include <cstddef>
25 #include <vector>
26 
27 namespace Opm {
28  struct Tuning;
29  class OilVaporizationProperties;
30  class Schedule;
31  class UDQParams;
32  class UnitSystem;
33 }
34 
35 namespace Opm { namespace RestartIO {
36 
37  class DoubHEAD
38  {
39  public:
40  struct TimeStamp {
41  std::chrono::time_point<std::chrono::system_clock> start;
42  std::chrono::duration<double, std::chrono::seconds::period> elapsed;
43  };
44 
45  struct guideRate {
46  double A;
47  double B;
48  double C;
49  double D;
50  double E;
51  double F;
52  double delay;
53  double damping_fact;
54  };
55 
56  struct liftOptPar {
57  double min_int;
58  double incr;
59  double min_ec_grad;
60  };
61 
63  explicit NetBalanceParams(const UnitSystem& usys);
64 
65  double balancingInterval;
66  double convTolNodPres;
67  double convTolTHPCalc;
68  double targBranchBalError;
69  double maxBranchBalError;
70  double minTimeStepSize;
71  };
72 
73  DoubHEAD();
74 
75  ~DoubHEAD() = default;
76  DoubHEAD(const DoubHEAD& rhs) = default;
77  DoubHEAD(DoubHEAD&& rhs) = default;
78 
79  DoubHEAD& operator=(const DoubHEAD& rhs) = default;
80  DoubHEAD& operator=(DoubHEAD&& rhs) = default;
81 
82  DoubHEAD& tuningParameters(const Tuning& tuning,
83  const double cnvT);
84 
85  DoubHEAD& timeStamp(const TimeStamp& ts);
86  DoubHEAD& nextStep(const double nextTimeStep);
87 
88  DoubHEAD& phaseMixing(const OilVaporizationProperties& oilvap,
89  const UnitSystem& usys);
90 
91  DoubHEAD& udq_param(const UDQParams& udqPar);
92  DoubHEAD& guide_rate_param(const guideRate& guide_rp);
93  DoubHEAD& lift_opt_param(const liftOptPar& lo_par);
94  DoubHEAD& netBalParams(const NetBalanceParams& net_bal_par);
95 
96  const std::vector<double>& data() const
97  {
98  return this->data_;
99  }
100 
101  private:
102  std::vector<double> data_;
103  };
104 
105 }} // Opm::RestartIO
106 
107 #endif // OPM_DOUBHEAD_HEADER_INCLUDED
Definition: DoubHEAD.hpp:40
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: DoubHEAD.hpp:45
Definition: OilVaporizationProperties.hpp:34
Definition: DoubHEAD.hpp:56
Definition: UDQParams.hpp:30
Definition: UnitSystem.hpp:34
Definition: DoubHEAD.hpp:37
Definition: Tuning.hpp:48