27 #ifndef OPM_ECL_EPS_CONFIG_HPP
28 #define OPM_ECL_EPS_CONFIG_HPP
31 #include <opm/input/eclipse/EclipseState/EclipseState.hpp>
62 enableSatScaling_ =
false;
63 enablePcScaling_ =
false;
64 enableLeverettScaling_ =
false;
65 enableKrwScaling_ =
false;
66 enableKrnScaling_ =
false;
67 enableThreePointKrSatScaling_ =
false;
74 { enableSatScaling_ = yesno; }
80 {
return enableSatScaling_; }
87 { enableThreePointKrSatScaling_ = yesno; }
94 {
return enableThreePointKrSatScaling_; }
100 { enableKrwScaling_ = yesno; }
106 {
return enableKrwScaling_; }
113 { this->enableThreePointKrwScaling_ = enable; }
120 {
return this->enableThreePointKrwScaling_; }
127 { this->enableThreePointKrnScaling_ = enable; }
134 {
return this->enableThreePointKrnScaling_; }
140 { enableKrnScaling_ = yesno; }
146 {
return enableKrnScaling_; }
152 { enablePcScaling_ = yesno; }
158 {
return enablePcScaling_; }
168 { enableLeverettScaling_ = yesno; }
178 {
return enableLeverettScaling_; }
186 void initFromState(
const EclipseState& eclState,
188 const std::string& prefix =
"",
189 const std::string& suffix =
"")
191 const auto& endscale = eclState.runspec().endpointScaling();
196 enableSatScaling_ =
false;
197 enableThreePointKrSatScaling_ =
false;
198 enablePcScaling_ =
false;
199 enableLeverettScaling_ =
false;
200 enableKrwScaling_ =
false;
201 enableKrnScaling_ =
false;
206 enableSatScaling_ =
true;
207 enableThreePointKrSatScaling_ = endscale.threepoint();
209 if (eclState.getTableManager().useJFunc()) {
210 const auto flag = eclState.getTableManager().getJFunc().flag();
212 enableLeverettScaling_ = (flag == JFunc::Flag::BOTH)
213 || ((twoPhaseSystemType == EclOilWaterSystem) &&
214 (flag == JFunc::Flag::WATER))
215 || ((twoPhaseSystemType == EclGasOilSystem) &&
216 (flag == JFunc::Flag::GAS));
219 const auto& fp = eclState.fieldProps();
220 auto hasKR = [&fp, &prefix, &suffix](
const std::string& scaling)
222 return fp.has_double(prefix +
"KR" + scaling + suffix);
224 auto hasPC = [&fp, &prefix](
const std::string& scaling)
226 return fp.has_double(prefix +
"PC" + scaling);
230 if (twoPhaseSystemType == EclOilWaterSystem) {
236 this->enablePcScaling_ = hasPC(
"W") || fp.has_double(
"SWATINIT");
238 else if (twoPhaseSystemType == EclGasOilSystem) {
244 this->enablePcScaling_ = hasPC(
"G");
247 assert(twoPhaseSystemType == EclGasWaterSystem);
251 if (enablePcScaling_ && enableLeverettScaling_) {
252 throw std::runtime_error {
253 "Capillary pressure scaling and the Leverett scaling function "
254 "are mutually exclusive. The deck contains the PCW/PCG property "
255 "and the JFUNC keyword applies to the water phase."
263 bool enableSatScaling_;
270 bool enableThreePointKrSatScaling_;
274 bool enablePcScaling_;
275 bool enableLeverettScaling_;
276 bool enableKrwScaling_;
277 bool enableKrnScaling_;
280 bool enableThreePointKrwScaling_{
false};
283 bool enableThreePointKrnScaling_{
false};
EclTwoPhaseSystemType
Specified which fluids are involved in a given twophase material law for endpoint scaling.
Definition: EclEpsConfig.hpp:43
Specifies the configuration used by the endpoint scaling code.
Definition: EclEpsConfig.hpp:57
bool enableThreePointKrwScaling() const
Whether or not three-point relative permeability value scaling is enabled for the wetting phase (KRWR...
Definition: EclEpsConfig.hpp:119
bool enableKrwScaling() const
Returns whether relative permeability scaling is enabled for the wetting phase.
Definition: EclEpsConfig.hpp:105
void setEnableKrnScaling(bool yesno)
Specify whether relative permeability scaling is enabled for the non-wetting phase.
Definition: EclEpsConfig.hpp:139
void setEnablePcScaling(bool yesno)
Specify whether capillary pressure scaling is enabled.
Definition: EclEpsConfig.hpp:151
bool enableKrnScaling() const
Returns whether relative permeability scaling is enabled for the non-wetting phase.
Definition: EclEpsConfig.hpp:145
void setEnableKrwScaling(bool yesno)
Specify whether relative permeability scaling is enabled for the wetting phase.
Definition: EclEpsConfig.hpp:99
bool enableLeverettScaling() const
Returns whether the Leverett capillary pressure scaling is enabled.
Definition: EclEpsConfig.hpp:177
void setEnableSatScaling(bool yesno)
Specify whether saturation scaling is enabled.
Definition: EclEpsConfig.hpp:73
void setEnableLeverettScaling(bool yesno)
Specify whether the Leverett capillary pressure scaling is enabled.
Definition: EclEpsConfig.hpp:167
void setEnableThreePointKrwScaling(const bool enable)
Specify whether three-point relative permeability value scaling is enabled for the wetting phase (KRW...
Definition: EclEpsConfig.hpp:112
bool enablePcScaling() const
Returns whether capillary pressure scaling is enabled.
Definition: EclEpsConfig.hpp:157
void setEnableThreePointKrSatScaling(bool yesno)
Specify whether three point saturation scaling is enabled for the relative permeabilities.
Definition: EclEpsConfig.hpp:86
void setEnableThreePointKrnScaling(const bool enable)
Specify whether three-point relative permeability value scaling is enabled for the wetting phase (e....
Definition: EclEpsConfig.hpp:126
bool enableThreePointKrnScaling() const
Whether or not three-point relative permeability value scaling is enabled for the non-wetting phase (...
Definition: EclEpsConfig.hpp:133
bool enableThreePointKrSatScaling() const
Returns whether three point saturation scaling is enabled for the relative permeabilities.
Definition: EclEpsConfig.hpp:93
bool enableSatScaling() const
Returns whether saturation scaling is enabled.
Definition: EclEpsConfig.hpp:79