My Project
SICD.hpp
1 /*
2  Copyright 2017 SINTEF Digital, Mathematics and Cybernetics.
3  Copyright 2019 Equinor ASA.
4 
5  This file is part of the Open Porous Media project (OPM).
6 
7  OPM is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  OPM is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with OPM. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef SPIRALICD_HPP_HEADER_INCLUDED
22 #define SPIRALICD_HPP_HEADER_INCLUDED
23 
24 #include <map>
25 #include <optional>
26 #include <utility>
27 #include <vector>
28 #include <string>
29 
30 #include <opm/parser/eclipse/EclipseState/Schedule/MSW/icd.hpp>
31 
32 namespace Opm {
33 
34  class DeckRecord;
35  class DeckKeyword;
36 
37  class SICD {
38  public:
39 
40  SICD();
41  explicit SICD(const DeckRecord& record);
42  SICD(double strength,
43  double length,
44  double densityCalibration,
45  double viscosityCalibration,
46  double criticalValue,
47  double widthTransitionRegion,
48  double maxViscosityRatio,
49  int methodFlowScaling,
50  const std::optional<double>& maxAbsoluteRate,
51  ICDStatus status,
52  double scalingFactor);
53 
54  static SICD serializeObject();
55 
56  // the function will return a map
57  // [
58  // "WELL1" : [<seg1, sicd1>, <seg2, sicd2> ...]
59  // ....
60  static std::map<std::string, std::vector<std::pair<int, SICD> > >
61  fromWSEGSICD(const DeckKeyword& wsegsicd);
62 
63  const std::optional<double>& maxAbsoluteRate() const;
64  ICDStatus status() const;
65  double strength() const;
66  double length() const;
67  double densityCalibration() const;
68  double viscosityCalibration() const;
69  double criticalValue() const;
70  double widthTransitionRegion() const;
71  double maxViscosityRatio() const;
72  int methodFlowScaling() const;
73 
74  void updateScalingFactor(const double segment_length, const double completion_length);
75  double scalingFactor() const;
76  int ecl_status() const;
77  bool operator==(const SICD& data) const;
78 
79  template<class Serializer>
80  void serializeOp(Serializer& serializer)
81  {
82  serializer(m_strength);
83  serializer(m_length);
84  serializer(m_density_calibration);
85  serializer(m_viscosity_calibration);
86  serializer(m_critical_value);
87  serializer(m_width_transition_region);
88  serializer(m_max_viscosity_ratio);
89  serializer(m_method_flow_scaling);
90  serializer(m_max_absolute_rate);
91  serializer(m_status);
92  serializer(m_scaling_factor);
93  }
94 
95  private:
96  double m_strength;
97  double m_length;
98  double m_density_calibration;
99  double m_viscosity_calibration;
100  double m_critical_value;
101  double m_width_transition_region;
102  double m_max_viscosity_ratio;
103  int m_method_flow_scaling;
104  std::optional<double> m_max_absolute_rate;
105  ICDStatus m_status;
106  // scaling factor is the only one can not be gotten from deck directly, needs to be
107  // updated afterwards
108  std::optional<double> m_scaling_factor;
109 };
110 
111 }
112 
113 #endif
Definition: DeckKeyword.hpp:36
Definition: DeckRecord.hpp:32
Definition: SICD.hpp:37
Definition: Serializer.hpp:38
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29