Capture Three-Point Vertical Scaling Properties

These scale relative permeability function values at the residual
saturation of the displacing phase.
This commit is contained in:
Bård Skaflestad 2020-12-20 12:11:46 +01:00
parent bb191a5381
commit d1ccb8fcee
3 changed files with 130 additions and 8 deletions

View File

@ -110,6 +110,20 @@ public:
bool enableKrwScaling() const
{ return enableKrwScaling_; }
/*!
* \brief Specify whether three-point relative permeability value
* scaling is enabled for the wetting phase (KRWR + KRW).
*/
void setEnableThreePointKrwScaling(const bool enable)
{ this->enableThreePointKrwScaling_ = enable; }
/*!
* \brief Whether or not three-point relative permeability value scaling
* is enabled for the wetting phase (KRWR + KRW).
*/
bool enableThreePointKrwScaling() const
{ return this->enableThreePointKrwScaling_; }
/*!
* \brief Specify whether relative permeability scaling is enabled for the non-wetting phase.
*/
@ -161,7 +175,9 @@ public:
* This requires that the opm-parser module is available.
*/
void initFromState(const Opm::EclipseState& eclState,
Opm::EclTwoPhaseSystemType twoPhaseSystemType)
Opm::EclTwoPhaseSystemType twoPhaseSystemType,
const std::string& prefix = "",
const std::string& suffix = "")
{
const auto& endscale = eclState.runspec().endpointScaling();
// find out if endpoint scaling is used in the first place
@ -192,16 +208,28 @@ public:
}
const auto& fp = eclState.fieldProps();
auto hasKR = [&fp, &prefix, &suffix](const std::string& scaling)
{
return fp.has_double(prefix + "KR" + scaling + suffix);
};
auto hasPC = [&fp, &prefix](const std::string& scaling)
{
return fp.has_double(prefix + "PC" + scaling);
};
// check if we are supposed to scale the Y axis of the capillary pressure
if (twoPhaseSystemType == EclOilWaterSystem) {
enableKrnScaling_ = fp.has_double("KRO");
enableKrwScaling_ = fp.has_double("KRW");
enablePcScaling_ = fp.has_double("PCW") || fp.has_double("SWATINIT");
} else {
this->setEnableThreePointKrwScaling(hasKR("WR"));
this->enableKrnScaling_ = hasKR("O");
this->enableKrwScaling_ = hasKR("W") || this->enableThreePointKrwScaling();
this->enablePcScaling_ = hasPC("W") || fp.has_double("SWATINIT");
}
else {
assert(twoPhaseSystemType == EclGasOilSystem);
enableKrnScaling_ = fp.has_double("KRG");
enableKrwScaling_ = fp.has_double("KRO");
enablePcScaling_ = fp.has_double("PCG");
this->enableKrnScaling_ = hasKR("G");
this->enableKrwScaling_ = hasKR("O");
this->enablePcScaling_ = hasPC("G");
}
if (enablePcScaling_ && enableLeverettScaling_) {
@ -231,6 +259,9 @@ private:
bool enableLeverettScaling_;
bool enableKrwScaling_;
bool enableKrnScaling_;
// Employ three-point vertical scaling (e.g., KRWR and KRW).
bool enableThreePointKrwScaling_{false};
};
} // namespace Opm

View File

@ -99,8 +99,12 @@ public:
this->compressed_pcw = try_get( fp, kwPrefix+"PCW");
this->compressed_pcg = try_get( fp, kwPrefix+"PCG");
this->compressed_krw = try_get( fp, kwPrefix+"KRW");
this->compressed_krwr = try_get( fp, kwPrefix+"KRWR");
this->compressed_kro = try_get( fp, kwPrefix+"KRO");
this->compressed_krorg = try_get( fp, kwPrefix+"KRORG");
this->compressed_krorw = try_get( fp, kwPrefix+"KRORW");
this->compressed_krg = try_get( fp, kwPrefix+"KRG");
this->compressed_krgr = try_get( fp, kwPrefix+"KRGR");
// _may_ be needed to calculate the Leverett capillary pressure scaling factor
if (fp.has_double("PORO"))
@ -185,14 +189,29 @@ public:
return this->satfunc(this->compressed_krw, active_index);
}
const double * krwr(std::size_t active_index) const {
return this->satfunc(this->compressed_krwr, active_index);
}
const double * krg(std::size_t active_index) const {
return this->satfunc(this->compressed_krg, active_index);
}
const double * krgr(std::size_t active_index) const {
return this->satfunc(this->compressed_krgr, active_index);
}
const double * kro(std::size_t active_index) const {
return this->satfunc(this->compressed_kro, active_index);
}
const double * krorg(std::size_t active_index) const {
return this->satfunc(this->compressed_krorg, active_index);
}
const double * krorw(std::size_t active_index) const {
return this->satfunc(this->compressed_krorw, active_index);
}
private:
const double *
@ -215,8 +234,12 @@ private:
std::vector<double> compressed_pcw;
std::vector<double> compressed_pcg;
std::vector<double> compressed_krw;
std::vector<double> compressed_krwr;
std::vector<double> compressed_kro;
std::vector<double> compressed_krorg;
std::vector<double> compressed_krorw;
std::vector<double> compressed_krg;
std::vector<double> compressed_krgr;
std::vector<double> compressed_permx;
std::vector<double> compressed_permy;

View File

@ -83,6 +83,12 @@ struct EclEpsScalingPointsInfo
Scalar pcowLeverettFactor;
Scalar pcgoLeverettFactor;
// Scaled relative permeabilities at residual displacing saturation
Scalar Krwr; // water
Scalar Krgr; // gas
Scalar Krorw; // oil in water-oil system
Scalar Krorg; // oil in gas-oil system
// maximum relative permabilities
Scalar maxKrw; // maximum relative permability of water
Scalar maxKrow; // maximum relative permability of oil in the oil-water system
@ -103,6 +109,10 @@ struct EclEpsScalingPointsInfo
maxPcgo == data.maxPcgo &&
pcowLeverettFactor == data.pcowLeverettFactor &&
pcgoLeverettFactor == data.pcgoLeverettFactor &&
Krwr == data.Krwr &&
Krgr == data.Krgr &&
Krorw == data.Krorw &&
Krorg == data.Krorg &&
maxKrw == data.maxKrw &&
maxKrow == data.maxKrow &&
maxKrog == data.maxKrog &&
@ -123,6 +133,10 @@ struct EclEpsScalingPointsInfo
<< " maxPcgo: " << maxPcgo << '\n'
<< " pcowLeverettFactor: " << pcowLeverettFactor << '\n'
<< " pcgoLeverettFactor: " << pcgoLeverettFactor << '\n'
<< " Krwr: " << Krwr << '\n'
<< " Krgr: " << Krgr << '\n'
<< " Krorw: " << Krorw << '\n'
<< " Krorg: " << Krorg << '\n'
<< " maxKrw: " << maxKrw << '\n'
<< " maxKrg: " << maxKrg << '\n'
<< " maxKrow: " << maxKrow << '\n'
@ -163,6 +177,11 @@ struct EclEpsScalingPointsInfo
this->pcowLeverettFactor = 1.0;
this->pcgoLeverettFactor = 1.0;
this->Krwr = rfunc.krw.r [satRegionIdx];
this->Krgr = rfunc.krg.r [satRegionIdx];
this->Krorw = rfunc.kro.rw[satRegionIdx];
this->Krorg = rfunc.kro.rg[satRegionIdx];
this->maxKrw = rfunc.krw.max[satRegionIdx];
this->maxKrow = rfunc.kro.max[satRegionIdx];
this->maxKrog = rfunc.kro.max[satRegionIdx];
@ -196,6 +215,12 @@ struct EclEpsScalingPointsInfo
update(Sgu, epsProperties.sgu(activeIndex));
update(maxPcow, epsProperties.pcw(activeIndex));
update(maxPcgo, epsProperties.pcg(activeIndex));
update(this->Krwr, epsProperties.krwr(activeIndex));
update(this->Krgr, epsProperties.krgr(activeIndex));
update(this->Krorw, epsProperties.krorw(activeIndex));
update(this->Krorg, epsProperties.krorg(activeIndex));
update(maxKrw, epsProperties.krw(activeIndex));
update(maxKrg, epsProperties.krg(activeIndex));
update(maxKrow, epsProperties.kro(activeIndex));
@ -316,6 +341,10 @@ public:
maxPcnwOrLeverettFactor_ = epsInfo.pcowLeverettFactor;
else
maxPcnwOrLeverettFactor_ = epsInfo.maxPcow;
Krwr_ = epsInfo.Krwr;
Krnr_ = epsInfo.Krorw;
maxKrw_ = epsInfo.maxKrw;
maxKrn_ = epsInfo.maxKrow;
}
@ -344,6 +373,9 @@ public:
else
maxPcnwOrLeverettFactor_ = epsInfo.maxPcgo;
Krwr_ = epsInfo.Krorg;
Krnr_ = epsInfo.Krgr;
maxKrw_ = epsInfo.maxKrog;
maxKrn_ = epsInfo.maxKrg;
}
@ -409,6 +441,20 @@ public:
Scalar leverettFactor() const
{ return maxPcnwOrLeverettFactor_; }
/*!
* \brief Set wetting-phase relative permeability at residual saturation
* of non-wetting phase.
*/
void setKrwr(Scalar value)
{ this->Krwr_ = value; }
/*!
* \brief Returns wetting-phase relative permeability at residual
* saturation of non-wetting phase.
*/
Scalar krwr() const
{ return this->Krwr_; }
/*!
* \brief Sets the maximum wetting phase relative permeability
*/
@ -421,6 +467,20 @@ public:
Scalar maxKrw() const
{ return maxKrw_; }
/*!
* \brief Set non-wetting phase relative permeability at residual
* saturation of wetting phase.
*/
void setKrnr(Scalar value)
{ this->Krnr_ = value; }
/*!
* \brief Returns non-wetting phase relative permeability at residual
* saturation of wetting phase.
*/
Scalar krnr() const
{ return this->Krnr_; }
/*!
* \brief Sets the maximum wetting phase relative permeability
*/
@ -447,9 +507,17 @@ private:
// Maximum wetting phase relative permability value.
Scalar maxKrw_;
// Scaled wetting phase relative permeability value at residual
// saturation of non-wetting phase.
Scalar Krwr_;
// Maximum non-wetting phase relative permability value
Scalar maxKrn_;
// Scaled non-wetting phase relative permeability value at residual
// saturation of wetting phase.
Scalar Krnr_;
// The the points used for saturation ("x-axis") scaling of capillary pressure
std::array<Scalar, 3> saturationPcPoints_;