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