27 #ifndef OPM_ECL_EPS_CONFIG_HPP 28 #define OPM_ECL_EPS_CONFIG_HPP 31 #include <opm/parser/eclipse/Deck/Deck.hpp> 32 #include <opm/parser/eclipse/Deck/DeckItem.hpp> 33 #include <opm/parser/eclipse/Deck/DeckKeyword.hpp> 34 #include <opm/parser/eclipse/Deck/DeckRecord.hpp> 35 #include <opm/parser/eclipse/EclipseState/EclipseState.hpp> 38 #include <opm/common/ErrorMacros.hpp> 39 #include <opm/common/Exceptions.hpp> 40 #include <opm/common/Unused.hpp> 69 enableSatScaling_ =
false;
70 enablePcScaling_ =
false;
71 enableLeverettScaling_ =
false;
72 enableKrwScaling_ =
false;
73 enableKrnScaling_ =
false;
74 enableThreePointKrSatScaling_ =
false;
81 { enableSatScaling_ = yesno; }
87 {
return enableSatScaling_; }
94 { enableThreePointKrSatScaling_ = yesno; }
101 {
return enableThreePointKrSatScaling_; }
107 { enableKrwScaling_ = yesno; }
113 {
return enableKrwScaling_; }
119 { enableKrnScaling_ = yesno; }
125 {
return enableKrnScaling_; }
131 { enablePcScaling_ = yesno; }
137 {
return enablePcScaling_; }
147 { enableLeverettScaling_ = yesno; }
157 {
return enableLeverettScaling_; }
165 void initFromDeck(
const Opm::Deck& deck OPM_UNUSED,
166 const Opm::EclipseState& eclState,
169 const auto& endscale = eclState.runspec().endpointScaling();
174 enableSatScaling_ =
false;
175 enableThreePointKrSatScaling_ =
false;
176 enablePcScaling_ =
false;
177 enableLeverettScaling_ =
false;
178 enableKrwScaling_ =
false;
179 enableKrnScaling_ =
false;
184 enableSatScaling_ =
true;
186 enableThreePointKrSatScaling_ = endscale.threepoint();
188 auto& props = eclState.get3DProperties();
190 if (twoPhaseSystemType == EclOilWaterSystem) {
192 props.hasDeckDoubleGridProperty(
"PCW")
193 || props.hasDeckDoubleGridProperty(
"SWATINIT");
196 if (eclState.getTableManager().useJFunc()) {
197 const auto& jfunc = eclState.getTableManager().getJFunc();
198 auto flag = jfunc.flag();
199 if (flag == Opm::JFunc::Flag::BOTH || flag == Opm::JFunc::Flag::WATER)
200 enableLeverettScaling_ =
true;
203 if (enablePcScaling_ && enableLeverettScaling_)
204 OPM_THROW(std::runtime_error,
205 "Capillary pressure scaling and the Leverett scaling function are " 206 "mutually exclusive: The deck contains the PCW property and the " 207 "JFUNC keyword applies to the water phase.");
210 assert(twoPhaseSystemType == EclGasOilSystem);
211 enablePcScaling_ = props.hasDeckDoubleGridProperty(
"PCG");
214 if (eclState.getTableManager().useJFunc()) {
215 const auto& jfunc = eclState.getTableManager().getJFunc();
216 auto flag = jfunc.flag();
217 if (flag == Opm::JFunc::Flag::BOTH || flag == Opm::JFunc::Flag::GAS)
218 enableLeverettScaling_ =
true;
221 if (enablePcScaling_ && enableLeverettScaling_)
222 OPM_THROW(std::runtime_error,
223 "Capillary pressure scaling and the Leverett scaling function are " 224 "mutually exclusive: The deck contains the PCG property and the " 225 "JFUNC keyword applies to the gas phase.");
229 if (twoPhaseSystemType == EclOilWaterSystem)
230 enableKrwScaling_ = props.hasDeckDoubleGridProperty(
"KRW");
232 assert(twoPhaseSystemType == EclGasOilSystem);
233 enableKrwScaling_ = props.hasDeckDoubleGridProperty(
"KRO");
237 if (twoPhaseSystemType == EclOilWaterSystem)
238 enableKrnScaling_ = props.hasDeckDoubleGridProperty(
"KRO");
240 assert(twoPhaseSystemType == EclGasOilSystem);
241 enableKrnScaling_ = props.hasDeckDoubleGridProperty(
"KRG");
248 bool enableSatScaling_;
255 bool enableThreePointKrSatScaling_;
259 bool enablePcScaling_;
260 bool enableLeverettScaling_;
261 bool enableKrwScaling_;
262 bool enableKrnScaling_;
bool enablePcScaling() const
Returns whether capillary pressure scaling is enabled.
Definition: EclEpsConfig.hpp:136
Definition: Air_Mesitylene.hpp:33
Specifies the configuration used by the endpoint scaling code.
Definition: EclEpsConfig.hpp:63
void setEnableKrnScaling(bool yesno)
Specify whether relative permeability scaling is enabled for the non-wetting phase.
Definition: EclEpsConfig.hpp:118
bool enableKrwScaling() const
Returns whether relative permeability scaling is enabled for the wetting phase.
Definition: EclEpsConfig.hpp:112
void setEnableKrwScaling(bool yesno)
Specify whether relative permeability scaling is enabled for the wetting phase.
Definition: EclEpsConfig.hpp:106
bool enableLeverettScaling() const
Returns whether the Leverett capillary pressure scaling is enabled.
Definition: EclEpsConfig.hpp:156
void setEnableSatScaling(bool yesno)
Specify whether saturation scaling is enabled.
Definition: EclEpsConfig.hpp:80
void setEnableThreePointKrSatScaling(bool yesno)
Specify whether three point saturation scaling is enabled for the relative permeabilities.
Definition: EclEpsConfig.hpp:93
bool enableThreePointKrSatScaling() const
Returns whether three point saturation scaling is enabled for the relative permeabilities.
Definition: EclEpsConfig.hpp:100
EclTwoPhaseSystemType
Specified which fluids are involved in a given twophase material law for endpoint scaling...
Definition: EclEpsConfig.hpp:51
void setEnableLeverettScaling(bool yesno)
Specify whether the Leverett capillary pressure scaling is enabled.
Definition: EclEpsConfig.hpp:146
bool enableKrnScaling() const
Returns whether relative permeability scaling is enabled for the non-wetting phase.
Definition: EclEpsConfig.hpp:124
void setEnablePcScaling(bool yesno)
Specify whether capillary pressure scaling is enabled.
Definition: EclEpsConfig.hpp:130
bool enableSatScaling() const
Returns whether saturation scaling is enabled.
Definition: EclEpsConfig.hpp:86