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>
68 enableSatScaling_ =
false;
69 enablePcScaling_ =
false;
70 enableLeverettScaling_ =
false;
71 enableKrwScaling_ =
false;
72 enableKrnScaling_ =
false;
73 enableThreePointKrSatScaling_ =
false;
80 { enableSatScaling_ = yesno; }
86 {
return enableSatScaling_; }
93 { enableThreePointKrSatScaling_ = yesno; }
100 {
return enableThreePointKrSatScaling_; }
106 { enableKrwScaling_ = yesno; }
112 {
return enableKrwScaling_; }
119 { this->enableThreePointKrwScaling_ = enable; }
126 {
return this->enableThreePointKrwScaling_; }
133 { this->enableThreePointKrnScaling_ = enable; }
140 {
return this->enableThreePointKrnScaling_; }
146 { enableKrnScaling_ = yesno; }
152 {
return enableKrnScaling_; }
158 { enablePcScaling_ = yesno; }
164 {
return enablePcScaling_; }
174 { enableLeverettScaling_ = yesno; }
184 {
return enableLeverettScaling_; }
192 void initFromState(
const EclipseState& eclState,
194 const std::string& prefix =
"",
195 const std::string& suffix =
"")
197 const auto& endscale = eclState.runspec().endpointScaling();
202 enableSatScaling_ =
false;
203 enableThreePointKrSatScaling_ =
false;
204 enablePcScaling_ =
false;
205 enableLeverettScaling_ =
false;
206 enableKrwScaling_ =
false;
207 enableKrnScaling_ =
false;
212 enableSatScaling_ =
true;
213 enableThreePointKrSatScaling_ = endscale.threepoint();
215 if (eclState.getTableManager().useJFunc()) {
216 const auto flag = eclState.getTableManager().getJFunc().flag();
218 enableLeverettScaling_ = (flag == JFunc::Flag::BOTH)
219 || ((twoPhaseSystemType == EclOilWaterSystem) &&
220 (flag == JFunc::Flag::WATER))
221 || ((twoPhaseSystemType == EclGasOilSystem) &&
222 (flag == JFunc::Flag::GAS));
225 const auto& fp = eclState.fieldProps();
226 auto hasKR = [&fp, &prefix, &suffix](
const std::string& scaling)
228 return fp.has_double(prefix +
"KR" + scaling + suffix);
230 auto hasPC = [&fp, &prefix](
const std::string& scaling)
232 return fp.has_double(prefix +
"PC" + scaling);
236 if (twoPhaseSystemType == EclOilWaterSystem) {
242 this->enablePcScaling_ = hasPC(
"W") || fp.has_double(
"SWATINIT");
244 else if (twoPhaseSystemType == EclGasOilSystem) {
250 this->enablePcScaling_ = hasPC(
"G");
253 assert(twoPhaseSystemType == EclGasWaterSystem);
257 if (enablePcScaling_ && enableLeverettScaling_) {
258 throw std::runtime_error {
259 "Capillary pressure scaling and the Leverett scaling function "
260 "are mutually exclusive. The deck contains the PCW/PCG property "
261 "and the JFUNC keyword applies to the water phase."
269 bool enableSatScaling_;
276 bool enableThreePointKrSatScaling_;
280 bool enablePcScaling_;
281 bool enableLeverettScaling_;
282 bool enableKrwScaling_;
283 bool enableKrnScaling_;
286 bool enableThreePointKrwScaling_{
false};
289 bool enableThreePointKrnScaling_{
false};
EclTwoPhaseSystemType
Specified which fluids are involved in a given twophase material law for endpoint scaling.
Definition: EclEpsConfig.hpp:49
Provides the OPM_UNUSED macro.
Specifies the configuration used by the endpoint scaling code.
Definition: EclEpsConfig.hpp:63
bool enableThreePointKrwScaling() const
Whether or not three-point relative permeability value scaling is enabled for the wetting phase (KRWR...
Definition: EclEpsConfig.hpp:125
bool enableKrwScaling() const
Returns whether relative permeability scaling is enabled for the wetting phase.
Definition: EclEpsConfig.hpp:111
void setEnableKrnScaling(bool yesno)
Specify whether relative permeability scaling is enabled for the non-wetting phase.
Definition: EclEpsConfig.hpp:145
void setEnablePcScaling(bool yesno)
Specify whether capillary pressure scaling is enabled.
Definition: EclEpsConfig.hpp:157
bool enableKrnScaling() const
Returns whether relative permeability scaling is enabled for the non-wetting phase.
Definition: EclEpsConfig.hpp:151
void setEnableKrwScaling(bool yesno)
Specify whether relative permeability scaling is enabled for the wetting phase.
Definition: EclEpsConfig.hpp:105
bool enableLeverettScaling() const
Returns whether the Leverett capillary pressure scaling is enabled.
Definition: EclEpsConfig.hpp:183
void setEnableSatScaling(bool yesno)
Specify whether saturation scaling is enabled.
Definition: EclEpsConfig.hpp:79
void setEnableLeverettScaling(bool yesno)
Specify whether the Leverett capillary pressure scaling is enabled.
Definition: EclEpsConfig.hpp:173
void setEnableThreePointKrwScaling(const bool enable)
Specify whether three-point relative permeability value scaling is enabled for the wetting phase (KRW...
Definition: EclEpsConfig.hpp:118
bool enablePcScaling() const
Returns whether capillary pressure scaling is enabled.
Definition: EclEpsConfig.hpp:163
void setEnableThreePointKrSatScaling(bool yesno)
Specify whether three point saturation scaling is enabled for the relative permeabilities.
Definition: EclEpsConfig.hpp:92
void setEnableThreePointKrnScaling(const bool enable)
Specify whether three-point relative permeability value scaling is enabled for the wetting phase (e....
Definition: EclEpsConfig.hpp:132
bool enableThreePointKrnScaling() const
Whether or not three-point relative permeability value scaling is enabled for the non-wetting phase (...
Definition: EclEpsConfig.hpp:139
bool enableThreePointKrSatScaling() const
Returns whether three point saturation scaling is enabled for the relative permeabilities.
Definition: EclEpsConfig.hpp:99
bool enableSatScaling() const
Returns whether saturation scaling is enabled.
Definition: EclEpsConfig.hpp:85