19 #ifndef OPM_RUNSPEC_HPP
20 #define OPM_RUNSPEC_HPP
26 #include <opm/common/OpmLog/KeywordLocation.hpp>
27 #include <opm/parser/eclipse/EclipseState/Tables/Tabdims.hpp>
28 #include <opm/parser/eclipse/EclipseState/Tables/Regdims.hpp>
29 #include <opm/parser/eclipse/EclipseState/EndpointScaling.hpp>
30 #include <opm/parser/eclipse/EclipseState/Schedule/UDQ/UDQParams.hpp>
31 #include <opm/parser/eclipse/EclipseState/Schedule/Action/Actdims.hpp>
52 constexpr
int NUM_PHASES_IN_ENUM =
static_cast<int>(Phase::ZFRACTION) + 1;
54 Phase get_phase(
const std::string& );
55 std::ostream& operator<<( std::ostream&,
const Phase& );
59 Phases() noexcept =
default;
60 Phases(
bool oil,
bool gas,
bool wat,
bool solvent =
false,
bool polymer =
false,
bool energy =
false,
61 bool polymw =
false,
bool foam =
false,
bool brine =
false,
bool zfraction =
false ) noexcept;
63 static Phases serializeObject();
65 bool active( Phase )
const noexcept;
66 size_t size()
const noexcept;
68 bool operator==(
const Phases& data)
const;
70 template<
class Serializer>
73 if (serializer.isSerializing())
74 serializer(bits.to_ulong());
76 unsigned long Bits = 0;
78 bits = std::bitset<NUM_PHASES_IN_ENUM>(Bits);
83 std::bitset< NUM_PHASES_IN_ENUM > bits;
94 int maxConnPerWell()
const
99 int maxWellsPerGroup()
const
104 int maxGroupsInField()
const
109 int maxWellsInField()
const
114 int maxWellListsPrWell()
const
116 return this->nWlistPrWellMax;
119 int maxDynamicWellLists()
const
121 return this->nDynWlistMax;
124 const std::optional<KeywordLocation>& location()
const {
125 return this->m_location;
129 return full_dims.maxConnPerWell() == rst_dims.maxConnPerWell() &&
130 full_dims.maxWellsPerGroup() == rst_dims.maxWellsPerGroup() &&
131 full_dims.maxGroupsInField() == rst_dims.maxGroupsInField() &&
132 full_dims.maxWellsInField() == rst_dims.maxWellsInField() &&
133 full_dims.maxWellListsPrWell() == rst_dims.maxWellListsPrWell() &&
134 full_dims.maxDynamicWellLists() == rst_dims.maxDynamicWellLists();
137 bool operator==(
const Welldims& data)
const {
138 return this->location() == data.location() &&
139 rst_cmp(*
this, data);
143 template<
class Serializer>
150 serializer(nWlistPrWellMax);
151 serializer(nDynWlistMax);
152 serializer(m_location);
160 int nWlistPrWellMax { 1 };
161 int nDynWlistMax { 1 };
162 std::optional<KeywordLocation> m_location;
173 int maxSegmentedWells()
const
175 return this->nSegWellMax;
178 int maxSegmentsPerWell()
const
180 return this->nSegmentMax;
183 int maxLateralBranchesPerWell()
const
185 return this->nLatBranchMax;
190 template<
class Serializer>
193 serializer(nSegWellMax);
194 serializer(nSegmentMax);
195 serializer(nLatBranchMax);
211 int maxNONodes()
const
213 return this->nMaxNoNodes;
216 int maxNoBranches()
const
218 return this->nMaxNoBranches;
221 int maxNoBranchesConToNode()
const
223 return this->nMaxNoBranchesConToNode;
228 template<
class Serializer>
231 serializer(nMaxNoNodes);
232 serializer(nMaxNoBranches);
233 serializer(nMaxNoBranchesConToNode);
239 int nMaxNoBranchesConToNode;
249 int maxAnalyticAquifers()
const
251 return this->maxNumAnalyticAquifers;
254 int maxAnalyticAquiferConnections()
const
256 return this->maxNumAnalyticAquiferConn;
259 template <
class Serializer>
262 serializer(this->maxNumAnalyticAquifers);
263 serializer(this->maxNumAnalyticAquiferConn);
267 int maxNumAnalyticAquifers;
268 int maxNumAnalyticAquiferConn;
309 template<
class Serializer>
312 serializer(activeHyst);
313 serializer(pcHystMod);
314 serializer(krHystMod);
319 bool activeHyst {
false };
328 enum class ThreePhaseOilKrModel {
334 enum class KeywordFamily {
343 const ThreePhaseOilKrModel model,
344 const KeywordFamily family);
348 double minimumRelpermMobilityThreshold()
const
350 return this->tolcrit;
353 ThreePhaseOilKrModel krModel()
const
355 return this->krmodel;
358 KeywordFamily family()
const
360 return this->satfunc_family;
365 template<
class Serializer>
370 serializer(satfunc_family);
375 ThreePhaseOilKrModel krmodel = ThreePhaseOilKrModel::Default;
376 KeywordFamily satfunc_family = KeywordFamily::Undefined;
383 explicit Nupcol(
int min_value);
384 void update(
int value);
387 static Nupcol serializeObject();
388 bool operator==(
const Nupcol& data)
const;
390 template<
class Serializer>
392 serializer(this->nupcol_value);
393 serializer(this->min_nupcol);
407 static Runspec serializeObject();
409 std::time_t start_time()
const noexcept;
410 const UDQParams& udqParams()
const noexcept;
411 const Phases& phases()
const noexcept;
412 const Tabdims& tabdims()
const noexcept;
413 const Regdims& regdims()
const noexcept;
415 const Welldims& wellDimensions()
const noexcept;
417 const NetworkDims& networkDimensions()
const noexcept;
419 int eclPhaseMask( )
const noexcept;
421 const Actdims& actdims()
const noexcept;
423 const Nupcol& nupcol()
const noexcept;
424 bool co2Storage()
const noexcept;
425 bool micp()
const noexcept;
427 bool operator==(
const Runspec& data)
const;
428 static bool rst_cmp(
const Runspec& full_state,
const Runspec& rst_state);
430 template<
class Serializer>
433 serializer(this->m_start_time);
434 active_phases.serializeOp(serializer);
435 m_tabdims.serializeOp(serializer);
436 m_regdims.serializeOp(serializer);
437 endscale.serializeOp(serializer);
438 welldims.serializeOp(serializer);
439 wsegdims.serializeOp(serializer);
440 netwrkdims.serializeOp(serializer);
441 aquiferdims.serializeOp(serializer);
442 udq_params.serializeOp(serializer);
443 hystpar.serializeOp(serializer);
444 m_actdims.serializeOp(serializer);
445 m_sfuncctrl.serializeOp(serializer);
446 m_nupcol.serializeOp(serializer);
447 serializer(m_co2storage);
452 std::time_t m_start_time;
Definition: Actdims.hpp:30
Definition: Runspec.hpp:242
Definition: Runspec.hpp:274
int pcHysteresisModel() const
Return the type of the hysteresis model which is used for capillary pressure.
bool active() const
Specify whether hysteresis is enabled or not.
int krHysteresisModel() const
Return the type of the hysteresis model which is used for relative permeability.
Definition: EndpointScaling.hpp:28
Definition: Runspec.hpp:204
Definition: Runspec.hpp:380
Definition: Runspec.hpp:57
Definition: Regdims.hpp:36
Definition: Runspec.hpp:402
Definition: Runspec.hpp:326
Definition: Serializer.hpp:38
Definition: Tabdims.hpp:36
Definition: UDQParams.hpp:31
Definition: Runspec.hpp:165
Definition: Runspec.hpp:87
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29