25 #ifndef OPM_ECL_HYSTERESIS_CONFIG_HPP
26 #define OPM_ECL_HYSTERESIS_CONFIG_HPP
29 #include <opm/parser/eclipse/Deck/Deck.hpp>
32 #include <opm/common/ErrorMacros.hpp>
33 #include <opm/common/Exceptions.hpp>
50 enableHysteresis_ =
false;
51 pcHysteresisModel_ = 0;
52 krHysteresisModel_ = 0;
59 { enableHysteresis_ = yesno; }
65 {
return enableHysteresis_; }
74 { pcHysteresisModel_ = value; }
83 {
return pcHysteresisModel_; }
92 { krHysteresisModel_ = value; }
101 {
return krHysteresisModel_; }
109 void initFromDeck(Opm::DeckConstPtr deck)
111 enableHysteresis_ =
false;
113 if (!deck->hasKeyword(
"SATOPTS"))
116 Opm::DeckItemConstPtr satoptsItem = deck->getKeyword(
"SATOPTS")->getRecord(0)->getItem(0);
117 for (
unsigned i = 0; i < satoptsItem->size(); ++i) {
118 std::string satoptsValue = satoptsItem->getString(0);
119 std::transform(satoptsValue.begin(),
121 satoptsValue.begin(),
124 if (satoptsValue ==
"HYSTER")
125 enableHysteresis_ =
true;
129 if (deck->hasKeyword(
"HYST"))
130 enableHysteresis_ =
true;
132 if (!enableHysteresis_)
135 if (!deck->hasKeyword(
"EHYSTR"))
136 OPM_THROW(std::runtime_error,
137 "Enabling hysteresis via the HYST parameter for SATOPTS requires the "
138 "presence of the EHYSTR keyword");
140 Opm::DeckKeywordConstPtr ehystrKeyword = deck->getKeyword(
"EHYSTR");
141 if (deck->hasKeyword(
"NOHYKR"))
142 krHysteresisModel_ = -1;
144 krHysteresisModel_ = ehystrKeyword->getRecord(0)->getItem(
"relative_perm_hyst")->getInt(0);
145 if (krHysteresisModel_ != 0)
146 OPM_THROW(std::runtime_error,
147 "Only the Carlson kr hystersis model (indicated by a 0 on the second item"
148 " of the 'EHYSTR' keyword) is supported");
151 if (deck->hasKeyword(
"NOHYPC"))
152 pcHysteresisModel_ = -1;
156 pcHysteresisModel_ = 0;
163 bool enableHysteresis_;
166 int pcHysteresisModel_;
167 int krHysteresisModel_;
void setKrHysteresisModel(int value)
Set the type of the hysteresis model which is used for relative permeability.
Definition: EclHysteresisConfig.hpp:91
int krHysteresisModel() const
Return the type of the hysteresis model which is used for relative permeability.
Definition: EclHysteresisConfig.hpp:100
Definition: Air_Mesitylene.hpp:31
EclHysteresisConfig()
Definition: EclHysteresisConfig.hpp:48
bool enableHysteresis() const
Returns whether hysteresis is enabled.
Definition: EclHysteresisConfig.hpp:64
int pcHysteresisModel() const
Return the type of the hysteresis model which is used for capillary pressure.
Definition: EclHysteresisConfig.hpp:82
Specifies the configuration used by the ECL kr/pC hysteresis code.
Definition: EclHysteresisConfig.hpp:45
void setPcHysteresisModel(int value)
Set the type of the hysteresis model which is used for capillary pressure.
Definition: EclHysteresisConfig.hpp:73
void setEnableHysteresis(bool yesno)
Specify whether hysteresis is enabled or not.
Definition: EclHysteresisConfig.hpp:58