Merge pull request #379 from akva2/noecl_flush
More serialization preparation
This commit is contained in:
commit
8d5d8ad26c
@ -52,7 +52,23 @@ class ConstantCompressibilityOilPvt
|
||||
typedef std::vector<std::pair<Scalar, Scalar> > SamplingPoints;
|
||||
|
||||
public:
|
||||
ConstantCompressibilityOilPvt() = default;
|
||||
ConstantCompressibilityOilPvt(const std::vector<Scalar>& oilReferenceDensity,
|
||||
const std::vector<Scalar>& oilReferencePressure,
|
||||
const std::vector<Scalar>& oilReferenceFormationVolumeFactor,
|
||||
const std::vector<Scalar>& oilCompressibility,
|
||||
const std::vector<Scalar>& oilViscosity,
|
||||
const std::vector<Scalar>& oilViscosibility)
|
||||
: oilReferenceDensity_(oilReferenceDensity)
|
||||
, oilReferencePressure_(oilReferencePressure)
|
||||
, oilReferenceFormationVolumeFactor_(oilReferenceFormationVolumeFactor)
|
||||
, oilCompressibility_(oilCompressibility)
|
||||
, oilViscosity_(oilViscosity)
|
||||
, oilViscosibility_(oilViscosibility)
|
||||
{ }
|
||||
|
||||
#if HAVE_ECL_INPUT
|
||||
|
||||
/*!
|
||||
* \brief Sets the pressure-dependent oil viscosity and density
|
||||
* using the Eclipse PVCDO keyword.
|
||||
@ -265,6 +281,34 @@ public:
|
||||
const Evaluation& /*Rs*/) const
|
||||
{ return 0.0; /* this is dead oil, so there isn't any meaningful saturation pressure! */ }
|
||||
|
||||
const std::vector<Scalar>& oilReferenceDensity() const
|
||||
{ return oilReferenceDensity_; }
|
||||
|
||||
const std::vector<Scalar>& oilReferencePressure() const
|
||||
{ return oilReferencePressure_; }
|
||||
|
||||
const std::vector<Scalar>& oilReferenceFormationVolumeFactor() const
|
||||
{ return oilReferenceFormationVolumeFactor_; }
|
||||
|
||||
const std::vector<Scalar>& oilCompressibility() const
|
||||
{ return oilCompressibility_; }
|
||||
|
||||
const std::vector<Scalar>& oilViscosity() const
|
||||
{ return oilViscosity_; }
|
||||
|
||||
const std::vector<Scalar>& oilViscosibility() const
|
||||
{ return oilViscosibility_; }
|
||||
|
||||
bool operator==(const ConstantCompressibilityOilPvt<Scalar>& data) const
|
||||
{
|
||||
return this->oilReferenceDensity() == data.oilReferenceDensity() &&
|
||||
this->oilReferencePressure() == data.oilReferencePressure() &&
|
||||
this->oilReferenceFormationVolumeFactor() == data.oilReferenceFormationVolumeFactor() &&
|
||||
this->oilCompressibility() == data.oilCompressibility() &&
|
||||
this->oilViscosity() == data.oilViscosity() &&
|
||||
this->oilViscosibility() == data.oilViscosibility();
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<Scalar> oilReferenceDensity_;
|
||||
std::vector<Scalar> oilReferencePressure_;
|
||||
|
@ -51,6 +51,20 @@ class ConstantCompressibilityWaterPvt
|
||||
typedef std::vector<std::pair<Scalar, Scalar> > SamplingPoints;
|
||||
|
||||
public:
|
||||
ConstantCompressibilityWaterPvt() = default;
|
||||
ConstantCompressibilityWaterPvt(const std::vector<Scalar>& waterReferenceDensity,
|
||||
const std::vector<Scalar>& waterReferencePressure,
|
||||
const std::vector<Scalar>& waterReferenceFormationVolumeFactor,
|
||||
const std::vector<Scalar>& waterCompressibility,
|
||||
const std::vector<Scalar>& waterViscosity,
|
||||
const std::vector<Scalar>& waterViscosibility)
|
||||
: waterReferenceDensity_(waterReferenceDensity)
|
||||
, waterReferencePressure_(waterReferencePressure)
|
||||
, waterReferenceFormationVolumeFactor_(waterReferenceFormationVolumeFactor)
|
||||
, waterCompressibility_(waterCompressibility)
|
||||
, waterViscosity_(waterViscosity)
|
||||
, waterViscosibility_(waterViscosibility)
|
||||
{ }
|
||||
#if HAVE_ECL_INPUT
|
||||
/*!
|
||||
* \brief Sets the pressure-dependent water viscosity and density
|
||||
@ -206,6 +220,34 @@ public:
|
||||
return (1.0 + X*(1.0 + X/2.0))/BwRef;
|
||||
}
|
||||
|
||||
const std::vector<Scalar>& waterReferenceDensity() const
|
||||
{ return waterReferenceDensity_; }
|
||||
|
||||
const std::vector<Scalar>& waterReferencePressure() const
|
||||
{ return waterReferencePressure_; }
|
||||
|
||||
const std::vector<Scalar>& waterReferenceFormationVolumeFactor() const
|
||||
{ return waterReferenceFormationVolumeFactor_; }
|
||||
|
||||
const std::vector<Scalar>& waterCompressibility() const
|
||||
{ return waterCompressibility_; }
|
||||
|
||||
const std::vector<Scalar>& waterViscosity() const
|
||||
{ return waterViscosity_; }
|
||||
|
||||
const std::vector<Scalar>& waterViscosibility() const
|
||||
{ return waterViscosibility_; }
|
||||
|
||||
bool operator==(const ConstantCompressibilityWaterPvt<Scalar>& data) const
|
||||
{
|
||||
return this->waterReferenceDensity() == data.waterReferenceDensity() &&
|
||||
this->waterReferencePressure() == data.waterReferencePressure() &&
|
||||
this->waterReferenceFormationVolumeFactor() == data.waterReferenceFormationVolumeFactor() &&
|
||||
this->waterCompressibility() == data.waterCompressibility() &&
|
||||
this->waterViscosity() == data.waterViscosity() &&
|
||||
this->waterViscosibility() == data.waterViscosibility();
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<Scalar> waterReferenceDensity_;
|
||||
std::vector<Scalar> waterReferencePressure_;
|
||||
|
@ -45,10 +45,22 @@ namespace Opm {
|
||||
template <class Scalar>
|
||||
class DeadOilPvt
|
||||
{
|
||||
typedef Opm::Tabulated1DFunction<Scalar> TabulatedOneDFunction;
|
||||
typedef std::vector<std::pair<Scalar, Scalar> > SamplingPoints;
|
||||
|
||||
public:
|
||||
typedef Opm::Tabulated1DFunction<Scalar> TabulatedOneDFunction;
|
||||
|
||||
DeadOilPvt() = default;
|
||||
DeadOilPvt(const std::vector<Scalar>& oilReferenceDensity,
|
||||
const std::vector<TabulatedOneDFunction>& inverseOilB,
|
||||
const std::vector<TabulatedOneDFunction>& oilMu,
|
||||
const std::vector<TabulatedOneDFunction>& inverseOilBMu)
|
||||
: oilReferenceDensity_(oilReferenceDensity)
|
||||
, inverseOilB_(inverseOilB)
|
||||
, oilMu_(oilMu)
|
||||
, inverseOilBMu_(inverseOilBMu)
|
||||
{ }
|
||||
|
||||
#if HAVE_ECL_INPUT
|
||||
/*!
|
||||
* \brief Initialize the oil parameters via the data specified by the PVDO ECL keyword.
|
||||
@ -266,6 +278,26 @@ public:
|
||||
const Evaluation& /*pressure*/) const
|
||||
{ return 0.0; /* this is dead oil! */ }
|
||||
|
||||
const std::vector<Scalar>& oilReferenceDensity() const
|
||||
{ return oilReferenceDensity_; }
|
||||
|
||||
const std::vector<TabulatedOneDFunction>& inverseOilB() const
|
||||
{ return inverseOilB_; }
|
||||
|
||||
const std::vector<TabulatedOneDFunction>& oilMu() const
|
||||
{ return oilMu_; }
|
||||
|
||||
const std::vector<TabulatedOneDFunction>& inverseOilBMu() const
|
||||
{ return inverseOilBMu_; }
|
||||
|
||||
bool operator==(const DeadOilPvt<Scalar>& data) const
|
||||
{
|
||||
return this->oilReferenceDensity() == data.oilReferenceDensity() &&
|
||||
this->inverseOilB() == data.inverseOilB() &&
|
||||
this->oilMu() == data.oilMu() &&
|
||||
this->inverseOilBMu() == data.inverseOilBMu();
|
||||
}
|
||||
|
||||
private:
|
||||
std::vector<Scalar> oilReferenceDensity_;
|
||||
std::vector<TabulatedOneDFunction> inverseOilB_;
|
||||
|
@ -52,16 +52,41 @@ namespace Opm {
|
||||
template <class Scalar>
|
||||
class LiveOilPvt
|
||||
{
|
||||
typedef Opm::UniformXTabulated2DFunction<Scalar> TabulatedTwoDFunction;
|
||||
typedef Opm::Tabulated1DFunction<Scalar> TabulatedOneDFunction;
|
||||
typedef std::vector<std::pair<Scalar, Scalar> > SamplingPoints;
|
||||
|
||||
public:
|
||||
typedef Opm::UniformXTabulated2DFunction<Scalar> TabulatedTwoDFunction;
|
||||
typedef Opm::Tabulated1DFunction<Scalar> TabulatedOneDFunction;
|
||||
|
||||
LiveOilPvt()
|
||||
{
|
||||
vapPar2_ = 0.0;
|
||||
}
|
||||
|
||||
LiveOilPvt(const std::vector<Scalar>& gasReferenceDensity,
|
||||
const std::vector<Scalar>& oilReferenceDensity,
|
||||
const std::vector<TabulatedTwoDFunction>& inverseOilBTable,
|
||||
const std::vector<TabulatedTwoDFunction>& oilMuTable,
|
||||
const std::vector<TabulatedTwoDFunction>& inverseOilBMuTable,
|
||||
const std::vector<TabulatedOneDFunction>& saturatedOilMuTable,
|
||||
const std::vector<TabulatedOneDFunction>& inverseSaturatedOilBTable,
|
||||
const std::vector<TabulatedOneDFunction>& inverseSaturatedOilBMuTable,
|
||||
const std::vector<TabulatedOneDFunction>& saturatedGasDissolutionFactorTable,
|
||||
const std::vector<TabulatedOneDFunction>& saturationPressure,
|
||||
Scalar vapPar2)
|
||||
: gasReferenceDensity_(gasReferenceDensity)
|
||||
, oilReferenceDensity_(oilReferenceDensity)
|
||||
, inverseOilBTable_(inverseOilBTable)
|
||||
, oilMuTable_(oilMuTable)
|
||||
, inverseOilBMuTable_(inverseOilBMuTable)
|
||||
, saturatedOilMuTable_(saturatedOilMuTable)
|
||||
, inverseSaturatedOilBTable_(inverseSaturatedOilBTable)
|
||||
, inverseSaturatedOilBMuTable_(inverseSaturatedOilBMuTable)
|
||||
, saturatedGasDissolutionFactorTable_(saturatedGasDissolutionFactorTable)
|
||||
, saturationPressure_(saturationPressure)
|
||||
, vapPar2_(vapPar2)
|
||||
{ }
|
||||
|
||||
#if HAVE_ECL_INPUT
|
||||
/*!
|
||||
* \brief Initialize the oil parameters via the data specified by the PVTO ECL keyword.
|
||||
@ -578,6 +603,53 @@ public:
|
||||
throw NumericalIssue(errlog.str());
|
||||
}
|
||||
|
||||
const std::vector<Scalar>& gasReferenceDensity() const
|
||||
{ return gasReferenceDensity_; }
|
||||
|
||||
const std::vector<Scalar>& oilReferenceDensity() const
|
||||
{ return oilReferenceDensity_; }
|
||||
|
||||
const std::vector<TabulatedTwoDFunction>& inverseOilBTable() const
|
||||
{ return inverseOilBTable_; }
|
||||
|
||||
const std::vector<TabulatedTwoDFunction>& oilMuTable() const
|
||||
{ return oilMuTable_; }
|
||||
|
||||
const std::vector<TabulatedTwoDFunction>& inverseOilBMuTable() const
|
||||
{ return inverseOilBMuTable_; }
|
||||
|
||||
const std::vector<TabulatedOneDFunction>& saturatedOilMuTable() const
|
||||
{ return saturatedOilMuTable_; }
|
||||
|
||||
const std::vector<TabulatedOneDFunction>& inverseSaturatedOilBTable() const
|
||||
{ return inverseSaturatedOilBTable_; }
|
||||
|
||||
const std::vector<TabulatedOneDFunction>& inverseSaturatedOilBMuTable() const
|
||||
{ return inverseSaturatedOilBMuTable_; }
|
||||
|
||||
const std::vector<TabulatedOneDFunction>& saturatedGasDissolutionFactorTable() const
|
||||
{ return saturatedGasDissolutionFactorTable_; }
|
||||
|
||||
const std::vector<TabulatedOneDFunction>& saturationPressure() const
|
||||
{ return saturationPressure_; }
|
||||
|
||||
Scalar vapPar2() const
|
||||
{ return vapPar2_; }
|
||||
|
||||
bool operator==(const LiveOilPvt<Scalar>& data) const
|
||||
{
|
||||
return this->gasReferenceDensity() == data.gasReferenceDensity() &&
|
||||
this->oilReferenceDensity() == data.oilReferenceDensity() &&
|
||||
this->inverseOilBTable() == data.inverseOilBTable() &&
|
||||
this->oilMuTable() == data.oilMuTable() &&
|
||||
this->inverseOilBMuTable() == data.inverseOilBMuTable() &&
|
||||
this->saturatedOilMuTable() == data.saturatedOilMuTable() &&
|
||||
this->inverseSaturatedOilBTable() == data.inverseSaturatedOilBTable() &&
|
||||
this->inverseSaturatedOilBMuTable() == data.inverseSaturatedOilBMuTable() &&
|
||||
this->saturatedGasDissolutionFactorTable() == data.saturatedGasDissolutionFactorTable() &&
|
||||
this->vapPar2() == data.vapPar2();
|
||||
}
|
||||
|
||||
private:
|
||||
void updateSaturationPressure_(unsigned regionIdx)
|
||||
{
|
||||
|
@ -88,6 +88,17 @@ public:
|
||||
OilPvtMultiplexer()
|
||||
{
|
||||
approach_ = NoOilPvt;
|
||||
realOilPvt_ = nullptr;
|
||||
}
|
||||
|
||||
OilPvtMultiplexer(OilPvtApproach approach, void* realOilPvt)
|
||||
: approach_(approach)
|
||||
, realOilPvt_(realOilPvt)
|
||||
{ }
|
||||
|
||||
OilPvtMultiplexer(const OilPvtMultiplexer<Scalar,enableThermal>& data)
|
||||
{
|
||||
*this = data;
|
||||
}
|
||||
|
||||
~OilPvtMultiplexer()
|
||||
@ -322,6 +333,54 @@ public:
|
||||
return *static_cast<const Opm::OilPvtThermal<Scalar>* >(realOilPvt_);
|
||||
}
|
||||
|
||||
const void* realOilPvt() const { return realOilPvt_; }
|
||||
|
||||
bool operator==(const OilPvtMultiplexer<Scalar,enableThermal>& data) const
|
||||
{
|
||||
if (this->approach() != data.approach())
|
||||
return false;
|
||||
|
||||
switch (approach_) {
|
||||
case ConstantCompressibilityOilPvt:
|
||||
return *static_cast<const Opm::ConstantCompressibilityOilPvt<Scalar>*>(realOilPvt_) ==
|
||||
*static_cast<const Opm::ConstantCompressibilityOilPvt<Scalar>*>(data.realOilPvt_);
|
||||
case DeadOilPvt:
|
||||
return *static_cast<const Opm::DeadOilPvt<Scalar>*>(realOilPvt_) ==
|
||||
*static_cast<const Opm::DeadOilPvt<Scalar>*>(data.realOilPvt_);
|
||||
case LiveOilPvt:
|
||||
return *static_cast<const Opm::LiveOilPvt<Scalar>*>(realOilPvt_) ==
|
||||
*static_cast<const Opm::LiveOilPvt<Scalar>*>(data.realOilPvt_);
|
||||
case ThermalOilPvt:
|
||||
return *static_cast<const Opm::OilPvtThermal<Scalar>*>(realOilPvt_) ==
|
||||
*static_cast<const Opm::OilPvtThermal<Scalar>*>(data.realOilPvt_);
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
OilPvtMultiplexer<Scalar,enableThermal>& operator=(const OilPvtMultiplexer<Scalar,enableThermal>& data)
|
||||
{
|
||||
approach_ = data.approach_;
|
||||
switch (approach_) {
|
||||
case ConstantCompressibilityOilPvt:
|
||||
realOilPvt_ = new Opm::ConstantCompressibilityOilPvt<Scalar>(*static_cast<const Opm::ConstantCompressibilityOilPvt<Scalar>*>(data.realOilPvt_));
|
||||
break;
|
||||
case DeadOilPvt:
|
||||
realOilPvt_ = new Opm::DeadOilPvt<Scalar>(*static_cast<const Opm::DeadOilPvt<Scalar>*>(data.realOilPvt_));
|
||||
break;
|
||||
case LiveOilPvt:
|
||||
realOilPvt_ = new Opm::LiveOilPvt<Scalar>(*static_cast<const Opm::LiveOilPvt<Scalar>*>(data.realOilPvt_));
|
||||
break;
|
||||
case ThermalOilPvt:
|
||||
realOilPvt_ = new Opm::OilPvtThermal<Scalar>(*static_cast<const Opm::OilPvtThermal<Scalar>*>(data.realOilPvt_));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
OilPvtApproach approach_;
|
||||
void* realOilPvt_;
|
||||
|
@ -54,17 +54,47 @@ class OilPvtMultiplexer;
|
||||
template <class Scalar>
|
||||
class OilPvtThermal
|
||||
{
|
||||
public:
|
||||
typedef Opm::Tabulated1DFunction<Scalar> TabulatedOneDFunction;
|
||||
typedef OilPvtMultiplexer<Scalar, /*enableThermal=*/false> IsothermalPvt;
|
||||
|
||||
public:
|
||||
OilPvtThermal()
|
||||
{
|
||||
enableThermalDensity_ = false;
|
||||
enableThermalViscosity_ = false;
|
||||
enableInternalEnergy_ = false;
|
||||
isothermalPvt_ = nullptr;
|
||||
}
|
||||
|
||||
OilPvtThermal(IsothermalPvt* isothermalPvt,
|
||||
const std::vector<TabulatedOneDFunction>& oilvisctCurves,
|
||||
const std::vector<Scalar>& viscrefPress,
|
||||
const std::vector<Scalar>& viscrefRs,
|
||||
const std::vector<Scalar>& viscRef,
|
||||
const std::vector<Scalar>& oildentRefTemp,
|
||||
const std::vector<Scalar>& oildentCT1,
|
||||
const std::vector<Scalar>& oildentCT2,
|
||||
const std::vector<TabulatedOneDFunction>& internalEnergyCurves,
|
||||
bool enableThermalDensity,
|
||||
bool enableThermalViscosity,
|
||||
bool enableInternalEnergy)
|
||||
: isothermalPvt_(isothermalPvt)
|
||||
, oilvisctCurves_(oilvisctCurves)
|
||||
, viscrefPress_(viscrefPress)
|
||||
, viscrefRs_(viscrefRs)
|
||||
, viscRef_(viscRef)
|
||||
, oildentRefTemp_(oildentRefTemp)
|
||||
, oildentCT1_(oildentCT1)
|
||||
, oildentCT2_(oildentCT2)
|
||||
, internalEnergyCurves_(internalEnergyCurves)
|
||||
, enableThermalDensity_(enableThermalDensity)
|
||||
, enableThermalViscosity_(enableThermalViscosity)
|
||||
, enableInternalEnergy_(enableInternalEnergy)
|
||||
{ }
|
||||
|
||||
OilPvtThermal(const OilPvtThermal& data)
|
||||
{ *this = data; }
|
||||
|
||||
~OilPvtThermal()
|
||||
{ delete isothermalPvt_; }
|
||||
|
||||
@ -351,6 +381,79 @@ public:
|
||||
const Evaluation& pressure) const
|
||||
{ return isothermalPvt_->saturationPressure(regionIdx, temperature, pressure); }
|
||||
|
||||
const IsothermalPvt* isoThermalPvt() const
|
||||
{ return isothermalPvt_; }
|
||||
|
||||
const std::vector<TabulatedOneDFunction>& oilvisctCurves() const
|
||||
{ return oilvisctCurves_; }
|
||||
|
||||
const std::vector<Scalar>& viscrefPress() const
|
||||
{ return viscrefPress_; }
|
||||
|
||||
const std::vector<Scalar>& viscrefRs() const
|
||||
{ return viscrefRs_; }
|
||||
|
||||
const std::vector<Scalar>& viscRef() const
|
||||
{ return viscRef_; }
|
||||
|
||||
const std::vector<Scalar>& oildentRefTemp() const
|
||||
{ return oildentRefTemp_; }
|
||||
|
||||
const std::vector<Scalar>& oildentCT1() const
|
||||
{ return oildentCT1_; }
|
||||
|
||||
const std::vector<Scalar>& oildentCT2() const
|
||||
{ return oildentCT2_; }
|
||||
|
||||
const std::vector<TabulatedOneDFunction> internalEnergyCurves() const
|
||||
{ return internalEnergyCurves_; }
|
||||
|
||||
bool enableInternalEnergy() const
|
||||
{ return enableInternalEnergy_; }
|
||||
|
||||
bool operator==(const OilPvtThermal<Scalar>& data) const
|
||||
{
|
||||
if (isothermalPvt_ && !data.isothermalPvt_)
|
||||
return false;
|
||||
if (!isothermalPvt_ && data.isothermalPvt_)
|
||||
return false;
|
||||
|
||||
return (!this->isoThermalPvt() ||
|
||||
(*this->isoThermalPvt() == *data.isoThermalPvt())) &&
|
||||
this->oilvisctCurves() == data.oilvisctCurves() &&
|
||||
this->viscrefPress() == data.viscrefPress() &&
|
||||
this->viscrefRs() == data.viscrefRs() &&
|
||||
this->viscRef() == data.viscRef() &&
|
||||
this->oildentRefTemp() == data.oildentRefTemp() &&
|
||||
this->oildentCT1() == data.oildentCT1() &&
|
||||
this->oildentCT2() == data.oildentCT2() &&
|
||||
this->internalEnergyCurves() == data.internalEnergyCurves() &&
|
||||
this->enableThermalDensity() == data.enableThermalDensity() &&
|
||||
this->enableThermalViscosity() == data.enableThermalViscosity() &&
|
||||
this->enableInternalEnergy() == data.enableInternalEnergy();
|
||||
}
|
||||
|
||||
OilPvtThermal<Scalar>& operator=(const OilPvtThermal<Scalar>& data)
|
||||
{
|
||||
if (data.isothermalPvt_)
|
||||
isothermalPvt_ = new IsothermalPvt(*data.isothermalPvt_);
|
||||
else
|
||||
isothermalPvt_ = nullptr;
|
||||
oilvisctCurves_ = data.oilvisctCurves_;
|
||||
viscrefPress_ = data.viscrefPress_;
|
||||
viscrefRs_ = data.viscrefRs_;
|
||||
viscRef_ = data.viscRef_;
|
||||
oildentRefTemp_ = data.oildentRefTemp_;
|
||||
oildentCT1_ = data.oildentCT1_;
|
||||
oildentCT2_ = data.oildentCT2_;
|
||||
internalEnergyCurves_ = data.internalEnergyCurves_;
|
||||
enableThermalDensity_ = data.enableThermalDensity_;
|
||||
enableThermalViscosity_ = data.enableThermalViscosity_;
|
||||
enableInternalEnergy_ = data.enableInternalEnergy_;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
IsothermalPvt* isothermalPvt_;
|
||||
|
||||
|
@ -66,6 +66,17 @@ public:
|
||||
WaterPvtMultiplexer()
|
||||
{
|
||||
approach_ = NoWaterPvt;
|
||||
realWaterPvt_ = nullptr;
|
||||
}
|
||||
|
||||
WaterPvtMultiplexer(WaterPvtApproach approach, void* realWaterPvt)
|
||||
: approach_(approach)
|
||||
, realWaterPvt_(realWaterPvt)
|
||||
{ }
|
||||
|
||||
WaterPvtMultiplexer(const WaterPvtMultiplexer<Scalar,enableThermal>& data)
|
||||
{
|
||||
*this = data;
|
||||
}
|
||||
|
||||
~WaterPvtMultiplexer()
|
||||
@ -196,6 +207,42 @@ public:
|
||||
return *static_cast<Opm::WaterPvtThermal<Scalar>* >(realWaterPvt_);
|
||||
}
|
||||
|
||||
const void* realWaterPvt() const { return realWaterPvt_; }
|
||||
|
||||
bool operator==(const WaterPvtMultiplexer<Scalar,enableThermal>& data) const
|
||||
{
|
||||
if (this->approach() != data.approach())
|
||||
return false;
|
||||
|
||||
switch (approach_) {
|
||||
case ConstantCompressibilityWaterPvt:
|
||||
return *static_cast<const Opm::ConstantCompressibilityWaterPvt<Scalar>*>(realWaterPvt_) ==
|
||||
*static_cast<const Opm::ConstantCompressibilityWaterPvt<Scalar>*>(data.realWaterPvt_);
|
||||
case ThermalWaterPvt:
|
||||
return *static_cast<const Opm::WaterPvtThermal<Scalar>*>(realWaterPvt_) ==
|
||||
*static_cast<const Opm::WaterPvtThermal<Scalar>*>(data.realWaterPvt_);
|
||||
default:
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
WaterPvtMultiplexer<Scalar,enableThermal>& operator=(const WaterPvtMultiplexer<Scalar,enableThermal>& data)
|
||||
{
|
||||
approach_ = data.approach_;
|
||||
switch (approach_) {
|
||||
case ConstantCompressibilityWaterPvt:
|
||||
realWaterPvt_ = new Opm::ConstantCompressibilityWaterPvt<Scalar>(*static_cast<const Opm::ConstantCompressibilityWaterPvt<Scalar>*>(data.realWaterPvt_));
|
||||
break;
|
||||
case ThermalWaterPvt:
|
||||
realWaterPvt_ = new Opm::WaterPvtThermal<Scalar>(*static_cast<const Opm::WaterPvtThermal<Scalar>*>(data.realWaterPvt_));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
WaterPvtApproach approach_;
|
||||
void* realWaterPvt_;
|
||||
|
@ -54,17 +54,53 @@ class WaterPvtMultiplexer;
|
||||
template <class Scalar>
|
||||
class WaterPvtThermal
|
||||
{
|
||||
public:
|
||||
typedef Opm::Tabulated1DFunction<Scalar> TabulatedOneDFunction;
|
||||
typedef WaterPvtMultiplexer<Scalar, /*enableThermal=*/false> IsothermalPvt;
|
||||
|
||||
public:
|
||||
WaterPvtThermal()
|
||||
{
|
||||
enableThermalDensity_ = false;
|
||||
enableThermalViscosity_ = false;
|
||||
enableInternalEnergy_ = false;
|
||||
isothermalPvt_ = nullptr;
|
||||
}
|
||||
|
||||
WaterPvtThermal(IsothermalPvt* isothermalPvt,
|
||||
const std::vector<Scalar>& viscrefPress,
|
||||
const std::vector<Scalar>& watdentRefTemp,
|
||||
const std::vector<Scalar>& watdentCT1,
|
||||
const std::vector<Scalar>& watdentCT2,
|
||||
const std::vector<Scalar>& pvtwRefPress,
|
||||
const std::vector<Scalar>& pvtwRefB,
|
||||
const std::vector<Scalar>& pvtwCompressibility,
|
||||
const std::vector<Scalar>& pvtwViscosity,
|
||||
const std::vector<Scalar>& pvtwViscosibility,
|
||||
const std::vector<TabulatedOneDFunction>& watvisctCurves,
|
||||
const std::vector<TabulatedOneDFunction>& internalEnergyCurves,
|
||||
bool enableThermalDensity,
|
||||
bool enableThermalViscosity,
|
||||
bool enableInternalEnergy)
|
||||
: isothermalPvt_(isothermalPvt)
|
||||
, viscrefPress_(viscrefPress)
|
||||
, watdentRefTemp_(watdentRefTemp)
|
||||
, watdentCT1_(watdentCT1)
|
||||
, watdentCT2_(watdentCT2)
|
||||
, pvtwRefPress_(pvtwRefPress)
|
||||
, pvtwRefB_(pvtwRefB)
|
||||
, pvtwCompressibility_(pvtwCompressibility)
|
||||
, pvtwViscosity_(pvtwViscosity)
|
||||
, pvtwViscosibility_(pvtwViscosibility)
|
||||
, watvisctCurves_(watvisctCurves)
|
||||
, internalEnergyCurves_(internalEnergyCurves)
|
||||
, enableThermalDensity_(enableThermalDensity)
|
||||
, enableThermalViscosity_(enableThermalViscosity)
|
||||
, enableInternalEnergy_(enableInternalEnergy)
|
||||
{ }
|
||||
|
||||
WaterPvtThermal(const WaterPvtThermal& data)
|
||||
{ *this = data; }
|
||||
|
||||
~WaterPvtThermal()
|
||||
{ delete isothermalPvt_; }
|
||||
|
||||
@ -271,6 +307,94 @@ public:
|
||||
return 1.0/(((1 - X)*(1 + cT1*Y + cT2*Y*Y))*BwRef);
|
||||
}
|
||||
|
||||
const IsothermalPvt* isoThermalPvt() const
|
||||
{ return isothermalPvt_; }
|
||||
|
||||
const std::vector<Scalar>& viscrefPress() const
|
||||
{ return viscrefPress_; }
|
||||
|
||||
const std::vector<Scalar>& watdentRefTemp() const
|
||||
{ return watdentRefTemp_; }
|
||||
|
||||
const std::vector<Scalar>& watdentCT1() const
|
||||
{ return watdentCT1_; }
|
||||
|
||||
const std::vector<Scalar>& watdentCT2() const
|
||||
{ return watdentCT2_; }
|
||||
|
||||
const std::vector<Scalar>& pvtwRefPress() const
|
||||
{ return pvtwRefPress_; }
|
||||
|
||||
const std::vector<Scalar>& pvtwRefB() const
|
||||
{ return pvtwRefB_; }
|
||||
|
||||
const std::vector<Scalar>& pvtwCompressibility() const
|
||||
{ return pvtwCompressibility_; }
|
||||
|
||||
const std::vector<Scalar>& pvtwViscosity() const
|
||||
{ return pvtwViscosity_; }
|
||||
|
||||
const std::vector<Scalar>& pvtwViscosibility() const
|
||||
{ return pvtwViscosibility_; }
|
||||
|
||||
const std::vector<TabulatedOneDFunction>& watvisctCurves() const
|
||||
{ return watvisctCurves_; }
|
||||
|
||||
const std::vector<TabulatedOneDFunction> internalEnergyCurves() const
|
||||
{ return internalEnergyCurves_; }
|
||||
|
||||
bool enableInternalEnergy() const
|
||||
{ return enableInternalEnergy_; }
|
||||
|
||||
bool operator==(const WaterPvtThermal<Scalar>& data) const
|
||||
{
|
||||
if (isothermalPvt_ && !data.isothermalPvt_)
|
||||
return false;
|
||||
if (!isothermalPvt_ && data.isothermalPvt_)
|
||||
return false;
|
||||
|
||||
return (!this->isoThermalPvt() ||
|
||||
(*this->isoThermalPvt() == *data.isoThermalPvt())) &&
|
||||
this->viscrefPress() == data.viscrefPress() &&
|
||||
this->watdentRefTemp() == data.watdentRefTemp() &&
|
||||
this->watdentCT1() == data.watdentCT1() &&
|
||||
this->watdentCT2() == data.watdentCT2() &&
|
||||
this->pvtwRefPress() == data.pvtwRefPress() &&
|
||||
this->pvtwRefB() == data.pvtwRefB() &&
|
||||
this->pvtwCompressibility() == data.pvtwCompressibility() &&
|
||||
this->pvtwViscosity() == data.pvtwViscosity() &&
|
||||
this->pvtwViscosibility() == data.pvtwViscosibility() &&
|
||||
this->watvisctCurves() == data.watvisctCurves() &&
|
||||
this->internalEnergyCurves() == data.internalEnergyCurves() &&
|
||||
this->enableThermalDensity() == data.enableThermalDensity() &&
|
||||
this->enableThermalViscosity() == data.enableThermalViscosity() &&
|
||||
this->enableInternalEnergy() == data.enableInternalEnergy();
|
||||
}
|
||||
|
||||
WaterPvtThermal<Scalar>& operator=(const WaterPvtThermal<Scalar>& data)
|
||||
{
|
||||
if (data.isothermalPvt_)
|
||||
isothermalPvt_ = new IsothermalPvt(*data.isothermalPvt_);
|
||||
else
|
||||
isothermalPvt_ = nullptr;
|
||||
viscrefPress_ = data.viscrefPress_;
|
||||
watdentRefTemp_ = data.watdentRefTemp_;
|
||||
watdentCT1_ = data.watdentCT1_;
|
||||
watdentCT2_ = data.watdentCT2_;
|
||||
pvtwRefPress_ = data.pvtwRefPress_;
|
||||
pvtwRefB_ = data.pvtwRefB_;
|
||||
pvtwCompressibility_ = data.pvtwCompressibility_;
|
||||
pvtwViscosity_ = data.pvtwViscosity_;
|
||||
pvtwViscosibility_ = data.pvtwViscosibility_;
|
||||
watvisctCurves_ = data.watvisctCurves_;
|
||||
internalEnergyCurves_ = data.internalEnergyCurves_;
|
||||
enableThermalDensity_ = data.enableThermalDensity_;
|
||||
enableThermalViscosity_ = data.enableThermalViscosity_;
|
||||
enableInternalEnergy_ = data.enableInternalEnergy_;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
IsothermalPvt* isothermalPvt_;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user