opm-common
Equil.hpp
1 #ifndef OPM_EQUIL_HPP
2 #define OPM_EQUIL_HPP
3 
4 #include <cstddef>
5 #include <vector>
6 
7 namespace Opm {
8  class DeckKeyword;
9  class DeckRecord;
10  class KeywordLocation;
11  class Phases;
12 
13  class EquilRecord {
14  public:
15  EquilRecord() = default;
16  EquilRecord(double datum_depth_arg, double datum_depth_pc_arg,
17  double woc_depth, double woc_pc,
18  double goc_depth, double goc_pc,
19  bool live_oil_init,
20  bool wet_gas_init,
21  int target_accuracy,
22  bool humid_gas_init);
23  EquilRecord(const DeckRecord& record, const Phases& phases, int region, const KeywordLocation& location, bool compositional);
24 
25  static EquilRecord serializationTestObject();
26  double datumDepth() const;
27  double datumDepthPressure() const;
28  double waterOilContactDepth() const;
29  double waterOilContactCapillaryPressure() const;
30  double gasOilContactDepth() const;
31  double gasOilContactCapillaryPressure() const;
32 
33  bool liveOilInitConstantRs() const;
34  bool wetGasInitConstantRv() const;
35  int initializationTargetAccuracy() const;
36  int compositionalInitType() const;
37  bool setToSaturationPressure() const;
38  bool humidGasInitConstantRvw() const;
39 
40  bool operator==(const EquilRecord& data) const;
41 
42  template<class Serializer>
43  void serializeOp(Serializer& serializer)
44  {
45  serializer(datum_depth);
46  serializer(datum_depth_ps);
47  serializer(water_oil_contact_depth);
48  serializer(water_oil_contact_capillary_pressure);
49  serializer(gas_oil_contact_depth);
50  serializer(gas_oil_contact_capillary_pressure);
51  serializer(live_oil_init_proc);
52  serializer(wet_gas_init_proc);
53  serializer(init_target_accuracy);
54  serializer(comp_init_type);
55  serializer(set_to_saturation_pressure);
56  serializer(humid_gas_init_proc);
57  }
58 
59  private:
60  double datum_depth = 0.0;
61  double datum_depth_ps = 0.0;
62  double water_oil_contact_depth = 0.0;
63  double water_oil_contact_capillary_pressure = 0.0;
64  double gas_oil_contact_depth = 0.0;
65  double gas_oil_contact_capillary_pressure = 0.0;
66 
67  bool live_oil_init_proc = false;
68  bool wet_gas_init_proc = false;
69  int init_target_accuracy = 0;
71  int comp_init_type = 0;
75  bool set_to_saturation_pressure = true;
76  bool humid_gas_init_proc = false;
77  };
78 
80  public:
81  StressEquilRecord() = default;
82  StressEquilRecord(const DeckRecord& record, const Phases& phases, int region, const KeywordLocation& location, bool compositional);
83 
84  static StressEquilRecord serializationTestObject();
85 
86  bool operator==(const StressEquilRecord& data) const;
87 
88  double datumDepth() const;
89  double datumPosX() const;
90  double datumPosY() const;
91  double stressXX() const;
92  double stressXX_grad() const;
93  double stressYY() const;
94  double stressYY_grad() const;
95  double stressZZ() const;
96  double stressZZ_grad() const;
97 
98  double stressXY() const;
99  double stressXY_grad() const;
100  double stressXZ() const;
101  double stressXZ_grad() const;
102  double stressYZ() const;
103  double stressYZ_grad() const;
104 
105  template<class Serializer>
106  void serializeOp(Serializer& serializer)
107  {
108  serializer(datum_depth);
109  serializer(datum_posx);
110  serializer(datum_posy);
111  serializer(stress_xx);
112  serializer(stress_xx_grad);
113  serializer(stress_yy);
114  serializer(stress_yy_grad);
115  serializer(stress_zz);
116  serializer(stress_zz_grad);
117 
118  serializer(stress_xy);
119  serializer(stress_xy_grad);
120  serializer(stress_xz);
121  serializer(stress_xz_grad);
122  serializer(stress_yz);
123  serializer(stress_yz_grad);
124  }
125 
126  private:
127  double datum_depth = 0.0;
128  double datum_posx = 0.0;
129  double datum_posy = 0.0;
130  double stress_xx = 0.0;
131  double stress_xx_grad = 0.0;
132  double stress_yy = 0.0;
133  double stress_yy_grad = 0.0;
134  double stress_zz = 0.0;
135  double stress_zz_grad = 0.0;
136 
137  double stress_xy = 0.0;
138  double stress_xy_grad = 0.0;
139  double stress_xz = 0.0;
140  double stress_xz_grad = 0.0;
141  double stress_yz = 0.0;
142  double stress_yz_grad = 0.0;
143  };
144 
145  template<class RecordType>
147  public:
148  using const_iterator = typename std::vector<RecordType>::const_iterator;
149 
150  EquilContainer() = default;
151  EquilContainer( const DeckKeyword&, const Phases&, bool );
152 
153  static EquilContainer serializationTestObject();
154 
155  const RecordType& getRecord(std::size_t id) const;
156 
157  std::size_t size() const;
158  bool empty() const;
159 
160  const_iterator begin() const;
161  const_iterator end() const;
162 
163  bool operator==(const EquilContainer& data) const;
164 
165  template<class Serializer>
166  void serializeOp(Serializer& serializer)
167  {
168  serializer(m_records);
169  }
170 
171  private:
172  std::vector<RecordType> m_records;
173  };
174 
177 }
178 
179 #endif //OPM_EQUIL_HPP
Definition: Equil.hpp:13
Definition: KeywordLocation.hpp:27
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
Definition: Equil.hpp:79
Definition: Equil.hpp:146
Definition: DeckRecord.hpp:33
Class for (de-)serializing.
Definition: Serializer.hpp:95
Definition: DeckKeyword.hpp:38
Definition: Runspec.hpp:45