My Project
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 Schedule;
30  class UDQParams;
31  class UnitSystem;
32 }
33 
34 namespace Opm { namespace RestartIO {
35 
36  class DoubHEAD
37  {
38  public:
39  struct TimeStamp {
40  std::chrono::time_point<std::chrono::system_clock> start;
41  std::chrono::duration<double, std::chrono::seconds::period> elapsed;
42  };
43 
44  struct guideRate {
45  double A;
46  double B;
47  double C;
48  double D;
49  double E;
50  double F;
51  double delay;
52  double damping_fact;
53  };
54 
55  struct liftOptPar {
56  double min_int;
57  double incr;
58  double min_ec_grad;
59  };
60 
62  explicit NetBalanceParams(const UnitSystem& usys);
63 
64  double balancingInterval;
65  double convTolNodPres;
66  double convTolTHPCalc;
67  double targBranchBalError;
68  double maxBranchBalError;
69  double minTimeStepSize;
70  };
71 
72  DoubHEAD();
73 
74  ~DoubHEAD() = default;
75  DoubHEAD(const DoubHEAD& rhs) = default;
76  DoubHEAD(DoubHEAD&& rhs) = default;
77 
78  DoubHEAD& operator=(const DoubHEAD& rhs) = default;
79  DoubHEAD& operator=(DoubHEAD&& rhs) = default;
80 
81  DoubHEAD& tuningParameters(const Tuning& tuning,
82  const double cnvT);
83 
84  DoubHEAD& timeStamp(const TimeStamp& ts);
85  DoubHEAD& nextStep(const double nextTimeStep);
86 
87  DoubHEAD& drsdt(const Schedule& sched,
88  const std::size_t lookup_step,
89  const double cnvT);
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:37
Definition: Schedule.hpp:138
Definition: UDQParams.hpp:31
Definition: UnitSystem.hpp:33
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29
Definition: DoubHEAD.hpp:39
Definition: DoubHEAD.hpp:44
Definition: DoubHEAD.hpp:55
Definition: Tuning.hpp:46