Loading...
Searching...
No Matches
EclEpsScalingPoints.hpp
Go to the documentation of this file.
// -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
// vi: set et ts=4 sw=4 sts=4:
/*
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
Consult the COPYING file in the top-level source directory of this
module for the precise wording of the license and the list of
copyright holders.
*/
#ifndef OPM_ECL_EPS_SCALING_POINTS_HPP
#define OPM_ECL_EPS_SCALING_POINTS_HPP
#include <array>
#include <vector>
namespace Opm {
class EclEpsConfig;
enum class EclTwoPhaseSystemType;
#if HAVE_ECL_INPUT
class EclipseState;
class EclEpsGridProperties;
namespace satfunc {
struct RawTableEndPoints;
struct RawFunctionValues;
}
#endif
template <class Scalar>
struct EclEpsScalingPointsInfo
{
// connate saturations
Scalar Swl; // water
Scalar Sgl; // gas
// critical saturations
Scalar Swcr; // water
Scalar Sgcr; // gas
Scalar Sowcr; // oil for the oil-water system
Scalar Sogcr; // oil for the gas-oil system
// maximum saturations
Scalar Swu; // water
Scalar Sgu; // gas
// maximum capillary pressures
Scalar maxPcow; // maximum capillary pressure of the oil-water system
Scalar maxPcgo; // maximum capillary pressure of the gas-oil system
// the Leverett capillary pressure scaling factors. (those only make sense for the
// scaled points, for the unscaled ones they are 1.0.)
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
Scalar maxKrog; // maximum relative permability of oil in the gas-oil system
Scalar maxKrg; // maximum relative permability of gas
bool operator==(const EclEpsScalingPointsInfo<Scalar>& data) const
{
return (Swl == data.Swl)
&& (Sgl == data.Sgl)
&& (Swcr == data.Swcr)
&& (Sgcr == data.Sgcr)
&& (Sowcr == data.Sowcr)
&& (Sogcr == data.Sogcr)
&& (Swu == data.Swu)
&& (Sgu == data.Sgu)
&& (maxPcow == data.maxPcow)
&& (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)
&& (maxKrg == data.maxKrg)
;
}
void print() const;
#if HAVE_ECL_INPUT
void extractUnscaled(const satfunc::RawTableEndPoints& rtep,
const satfunc::RawFunctionValues& rfunc,
const std::vector<double>::size_type satRegionIdx);
void extractScaled(const EclipseState& eclState,
const EclEpsGridProperties& epsProperties,
unsigned activeIndex);
private:
void calculateLeverettFactors(const EclipseState& eclState,
const EclEpsGridProperties& epsProperties,
unsigned activeIndex);
#endif // HAVE_ECL_INPUT
};
template <class Scalar>
class EclEpsScalingPoints
{
public:
void init(const EclEpsScalingPointsInfo<Scalar>& epsInfo,
const EclEpsConfig& config,
EclTwoPhaseSystemType epsSystemType);
void setSaturationPcPoint(unsigned pointIdx, Scalar value)
{ saturationPcPoints_[pointIdx] = value; }
const std::array<Scalar, 3>& saturationPcPoints() const
{ return saturationPcPoints_; }
void setSaturationKrwPoint(unsigned pointIdx, Scalar value)
{ saturationKrwPoints_[pointIdx] = value; }
const std::array<Scalar, 3>& saturationKrwPoints() const
{ return saturationKrwPoints_; }
void setSaturationKrnPoint(unsigned pointIdx, Scalar value)
{ saturationKrnPoints_[pointIdx] = value; }
const std::array<Scalar, 3>& saturationKrnPoints() const
{ return saturationKrnPoints_; }
void setMaxPcnw(Scalar value)
{ maxPcnwOrLeverettFactor_ = value; }
Scalar maxPcnw() const
{ return maxPcnwOrLeverettFactor_; }
void setLeverettFactor(Scalar value)
{ maxPcnwOrLeverettFactor_ = value; }
Scalar leverettFactor() const
{ return maxPcnwOrLeverettFactor_; }
void setKrwr(Scalar value)
{ this->Krwr_ = value; }
Scalar krwr() const
{ return this->Krwr_; }
void setMaxKrw(Scalar value)
{ maxKrw_ = value; }
Scalar maxKrw() const
{ return maxKrw_; }
void setKrnr(Scalar value)
{ this->Krnr_ = value; }
Scalar krnr() const
{ return this->Krnr_; }
void setMaxKrn(Scalar value)
{ maxKrn_ = value; }
Scalar maxKrn() const
{ return maxKrn_; }
void print() const;
private:
// Points used for vertical scaling of capillary pressure
Scalar maxPcnwOrLeverettFactor_{};
// 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_{};
// The the points used for saturation ("x-axis") scaling of wetting phase relative permeability
std::array<Scalar, 3> saturationKrwPoints_{};
// The the points used for saturation ("x-axis") scaling of non-wetting phase relative permeability
std::array<Scalar, 3> saturationKrnPoints_{};
};
} // namespace Opm
#endif
Opm::EclEpsConfig
Specifies the configuration used by the endpoint scaling code.
Definition EclEpsConfig.hpp:56
Opm::EclEpsGridProperties
Collects all grid properties which are relevant for end point scaling.
Definition EclEpsGridProperties.hpp:47
Opm::EclEpsScalingPoints
Represents the points on the X and Y axis to be scaled if endpoint scaling is used.
Definition EclEpsScalingPoints.hpp:155
Opm::EclEpsScalingPoints::saturationKrwPoints
const std::array< Scalar, 3 > & saturationKrwPoints() const
Returns the points used for wetting phase relperm saturation scaling.
Definition EclEpsScalingPoints.hpp:185
Opm::EclEpsScalingPoints::setMaxKrn
void setMaxKrn(Scalar value)
Sets the maximum wetting phase relative permeability.
Definition EclEpsScalingPoints.hpp:267
Opm::EclEpsScalingPoints::krnr
Scalar krnr() const
Returns non-wetting phase relative permeability at residual saturation of wetting phase.
Definition EclEpsScalingPoints.hpp:261
Opm::EclEpsScalingPoints::maxKrn
Scalar maxKrn() const
Returns the maximum wetting phase relative permeability.
Definition EclEpsScalingPoints.hpp:273
Opm::EclEpsScalingPoints::setKrnr
void setKrnr(Scalar value)
Set non-wetting phase relative permeability at residual saturation of wetting phase.
Definition EclEpsScalingPoints.hpp:254
Opm::EclEpsScalingPoints::setMaxKrw
void setMaxKrw(Scalar value)
Sets the maximum wetting phase relative permeability.
Definition EclEpsScalingPoints.hpp:241
Opm::EclEpsScalingPoints::maxKrw
Scalar maxKrw() const
Returns the maximum wetting phase relative permeability.
Definition EclEpsScalingPoints.hpp:247
Opm::EclEpsScalingPoints::setSaturationKrwPoint
void setSaturationKrwPoint(unsigned pointIdx, Scalar value)
Sets an saturation value for wetting-phase relperm saturation scaling.
Definition EclEpsScalingPoints.hpp:179
Opm::EclEpsScalingPoints::setMaxPcnw
void setMaxPcnw(Scalar value)
Sets the maximum capillary pressure.
Definition EclEpsScalingPoints.hpp:203
Opm::EclEpsScalingPoints::krwr
Scalar krwr() const
Returns wetting-phase relative permeability at residual saturation of non-wetting phase.
Definition EclEpsScalingPoints.hpp:235
Opm::EclEpsScalingPoints::maxPcnw
Scalar maxPcnw() const
Returns the maximum capillary pressure.
Definition EclEpsScalingPoints.hpp:209
Opm::EclEpsScalingPoints::setKrwr
void setKrwr(Scalar value)
Set wetting-phase relative permeability at residual saturation of non-wetting phase.
Definition EclEpsScalingPoints.hpp:228
Opm::EclEpsScalingPoints::setSaturationPcPoint
void setSaturationPcPoint(unsigned pointIdx, Scalar value)
Sets an saturation value for capillary pressure saturation scaling.
Definition EclEpsScalingPoints.hpp:167
Opm::EclEpsScalingPoints::saturationKrnPoints
const std::array< Scalar, 3 > & saturationKrnPoints() const
Returns the points used for non-wetting phase relperm saturation scaling.
Definition EclEpsScalingPoints.hpp:197
Opm::EclEpsScalingPoints::setLeverettFactor
void setLeverettFactor(Scalar value)
Sets the Leverett scaling factor for capillary pressure.
Definition EclEpsScalingPoints.hpp:215
Opm::EclEpsScalingPoints::saturationPcPoints
const std::array< Scalar, 3 > & saturationPcPoints() const
Returns the points used for capillary pressure saturation scaling.
Definition EclEpsScalingPoints.hpp:173
Opm::EclEpsScalingPoints::init
void init(const EclEpsScalingPointsInfo< Scalar > &epsInfo, const EclEpsConfig &config, EclTwoPhaseSystemType epsSystemType)
Assigns the scaling points which actually ought to be used.
Definition EclEpsScalingPoints.cpp:240
Opm::EclEpsScalingPoints::setSaturationKrnPoint
void setSaturationKrnPoint(unsigned pointIdx, Scalar value)
Sets an saturation value for non-wetting phase relperm saturation scaling.
Definition EclEpsScalingPoints.hpp:191
Opm::EclEpsScalingPoints::leverettFactor
Scalar leverettFactor() const
Returns the Leverett scaling factor for capillary pressure.
Definition EclEpsScalingPoints.hpp:221
Opm::EclipseState
Definition EclipseState.hpp:62
Opm
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Opm::EclTwoPhaseSystemType
EclTwoPhaseSystemType
Specified which fluids are involved in a given twophase material law for endpoint scaling.
Definition EclEpsConfig.hpp:42
Opm::EclEpsScalingPointsInfo
This structure represents all values which can be possibly used as scaling points in the endpoint sca...
Definition EclEpsScalingPoints.hpp:57
Opm::satfunc::RawFunctionValues
Collection of unscaled/raw saturation function value range endpoints extracted directly from tables o...
Definition SatfuncPropertyInitializers.hpp:93
Opm::satfunc::RawTableEndPoints
Collection of unscaled/raw saturation range endpoints extracted directly from tables of tabulated sat...
Definition SatfuncPropertyInitializers.hpp:36