27 #ifndef OPM_ECL_HYSTERESIS_CONFIG_HPP 28 #define OPM_ECL_HYSTERESIS_CONFIG_HPP 31 #include <opm/parser/eclipse/Deck/Deck.hpp> 32 #include <opm/parser/eclipse/Deck/DeckKeyword.hpp> 33 #include <opm/parser/eclipse/Deck/DeckRecord.hpp> 34 #include <opm/parser/eclipse/Deck/DeckItem.hpp> 37 #include <opm/common/ErrorMacros.hpp> 38 #include <opm/common/Exceptions.hpp> 55 enableHysteresis_ =
false;
56 pcHysteresisModel_ = 0;
57 krHysteresisModel_ = 0;
64 { enableHysteresis_ = yesno; }
70 {
return enableHysteresis_; }
79 { pcHysteresisModel_ = value; }
88 {
return pcHysteresisModel_; }
97 { krHysteresisModel_ = value; }
106 {
return krHysteresisModel_; }
114 void initFromDeck(
const Opm::Deck& deck)
116 enableHysteresis_ =
false;
118 if (!deck.hasKeyword(
"SATOPTS"))
121 const auto& satoptsItem = deck.getKeyword(
"SATOPTS").getRecord(0).getItem(0);
122 for (
unsigned i = 0; i < satoptsItem.size(); ++i) {
123 std::string satoptsValue = satoptsItem.get< std::string >(0);
124 std::transform(satoptsValue.begin(),
126 satoptsValue.begin(),
129 if (satoptsValue ==
"HYSTER")
130 enableHysteresis_ =
true;
134 if (deck.hasKeyword(
"HYST"))
135 enableHysteresis_ =
true;
137 if (!enableHysteresis_)
140 if (!deck.hasKeyword(
"EHYSTR"))
141 OPM_THROW(std::runtime_error,
142 "Enabling hysteresis via the HYST parameter for SATOPTS requires the " 143 "presence of the EHYSTR keyword");
145 const auto& ehystrKeyword = deck.getKeyword(
"EHYSTR");
146 if (deck.hasKeyword(
"NOHYKR"))
147 krHysteresisModel_ = -1;
149 krHysteresisModel_ = ehystrKeyword.getRecord(0).getItem(
"relative_perm_hyst").get<
int >(0);
150 if (krHysteresisModel_ != 0)
151 OPM_THROW(std::runtime_error,
152 "Only the Carlson kr hystersis model (indicated by a 0 on the second item" 153 " of the 'EHYSTR' keyword) is supported");
156 if (deck.hasKeyword(
"NOHYPC"))
157 pcHysteresisModel_ = -1;
161 pcHysteresisModel_ = 0;
168 bool enableHysteresis_;
171 int pcHysteresisModel_;
172 int krHysteresisModel_;
void setKrHysteresisModel(int value)
Set the type of the hysteresis model which is used for relative permeability.
Definition: EclHysteresisConfig.hpp:96
Definition: Air_Mesitylene.hpp:33
void setPcHysteresisModel(int value)
Set the type of the hysteresis model which is used for capillary pressure.
Definition: EclHysteresisConfig.hpp:78
Specifies the configuration used by the ECL kr/pC hysteresis code.
Definition: EclHysteresisConfig.hpp:50
bool enableHysteresis() const
Returns whether hysteresis is enabled.
Definition: EclHysteresisConfig.hpp:69
void setEnableHysteresis(bool yesno)
Specify whether hysteresis is enabled or not.
Definition: EclHysteresisConfig.hpp:63
int pcHysteresisModel() const
Return the type of the hysteresis model which is used for capillary pressure.
Definition: EclHysteresisConfig.hpp:87
int krHysteresisModel() const
Return the type of the hysteresis model which is used for relative permeability.
Definition: EclHysteresisConfig.hpp:105