black-oil PVT: provide inverse formation volume factors
this makes things go less in circles: before this patch, the interpolation happened on the inverse formation volume factors, the PVT classes inverted the result to get the FVF and then the calling code divided by what fell out of this. Now, the calling code can directly multiply with the result of the interpolation.
This commit is contained in:
parent
c780233ad1
commit
abc0caea7a
@ -380,39 +380,39 @@ public:
|
||||
case oilPhaseIdx: {
|
||||
if (!enableDissolvedGas()) {
|
||||
// immiscible oil
|
||||
const auto& Bo = formationVolumeFactor<FluidState, LhsEval>(fluidState, oilPhaseIdx, regionIdx);
|
||||
return referenceDensity(phaseIdx, regionIdx)/Bo;
|
||||
const auto& bo = inverseFormationVolumeFactor<FluidState, LhsEval>(fluidState, oilPhaseIdx, regionIdx);
|
||||
return referenceDensity(phaseIdx, regionIdx)*bo;
|
||||
}
|
||||
|
||||
// miscible oil
|
||||
const auto& Bo = formationVolumeFactor<FluidState, LhsEval>(fluidState, oilPhaseIdx, regionIdx);
|
||||
const auto& bo = inverseFormationVolumeFactor<FluidState, LhsEval>(fluidState, oilPhaseIdx, regionIdx);
|
||||
const auto& Rs = getRs_<LhsEval, FluidState>(fluidState, regionIdx);
|
||||
|
||||
return
|
||||
referenceDensity(oilPhaseIdx, regionIdx)/Bo
|
||||
+ Rs*referenceDensity(gasPhaseIdx, regionIdx)/Bo;
|
||||
bo*referenceDensity(oilPhaseIdx, regionIdx)
|
||||
+ Rs*bo*referenceDensity(gasPhaseIdx, regionIdx);
|
||||
}
|
||||
|
||||
case gasPhaseIdx: {
|
||||
if (!enableVaporizedOil()) {
|
||||
// immiscible gas
|
||||
const auto& Bg = formationVolumeFactor<FluidState, LhsEval>(fluidState, gasPhaseIdx, regionIdx);
|
||||
return Bg*referenceDensity(phaseIdx, regionIdx);
|
||||
const auto& bg = inverseFormationVolumeFactor<FluidState, LhsEval>(fluidState, gasPhaseIdx, regionIdx);
|
||||
return bg*referenceDensity(phaseIdx, regionIdx);
|
||||
}
|
||||
|
||||
// miscible gas
|
||||
const auto& Bg = formationVolumeFactor<FluidState, LhsEval>(fluidState, gasPhaseIdx, regionIdx);
|
||||
const auto& bg = inverseFormationVolumeFactor<FluidState, LhsEval>(fluidState, gasPhaseIdx, regionIdx);
|
||||
const auto& Rv = getRv_<LhsEval, FluidState>(fluidState, regionIdx);
|
||||
|
||||
return
|
||||
referenceDensity(gasPhaseIdx, regionIdx)/Bg
|
||||
+ Rv*referenceDensity(oilPhaseIdx, regionIdx)/Bg;
|
||||
bg*referenceDensity(gasPhaseIdx, regionIdx)
|
||||
+ Rv*bg*referenceDensity(oilPhaseIdx, regionIdx);
|
||||
}
|
||||
|
||||
case waterPhaseIdx:
|
||||
return
|
||||
referenceDensity(waterPhaseIdx, regionIdx)
|
||||
/formationVolumeFactor<FluidState, LhsEval>(fluidState, waterPhaseIdx, regionIdx);
|
||||
*inverseFormationVolumeFactor<FluidState, LhsEval>(fluidState, waterPhaseIdx, regionIdx);
|
||||
}
|
||||
|
||||
OPM_THROW(std::logic_error, "Unhandled phase index " << phaseIdx);
|
||||
@ -437,39 +437,39 @@ public:
|
||||
case oilPhaseIdx: {
|
||||
if (!enableDissolvedGas()) {
|
||||
// immiscible oil
|
||||
const auto& Bo = formationVolumeFactor<FluidState, LhsEval>(fluidState, oilPhaseIdx, regionIdx);
|
||||
return referenceDensity(phaseIdx, regionIdx)/Bo;
|
||||
const auto& bo = inverseFormationVolumeFactor<FluidState, LhsEval>(fluidState, oilPhaseIdx, regionIdx);
|
||||
return referenceDensity(phaseIdx, regionIdx)*bo;
|
||||
}
|
||||
|
||||
// miscible oil
|
||||
const auto& Bo = saturatedFormationVolumeFactor<FluidState, LhsEval>(fluidState, oilPhaseIdx, regionIdx);
|
||||
const auto& bo = saturatedInverseFormationVolumeFactor<FluidState, LhsEval>(fluidState, oilPhaseIdx, regionIdx);
|
||||
const auto& Rs = saturatedDissolutionFactor<FluidState, LhsEval>(fluidState, oilPhaseIdx, regionIdx);
|
||||
|
||||
return
|
||||
referenceDensity(oilPhaseIdx, regionIdx)/Bo
|
||||
+ Rs*referenceDensity(gasPhaseIdx, regionIdx)/Bo;
|
||||
bo*referenceDensity(oilPhaseIdx, regionIdx)
|
||||
+ Rs*bo*referenceDensity(gasPhaseIdx, regionIdx);
|
||||
}
|
||||
|
||||
case gasPhaseIdx: {
|
||||
if (!enableVaporizedOil()) {
|
||||
// immiscible gas
|
||||
const auto& Bg = formationVolumeFactor<FluidState, LhsEval>(fluidState, gasPhaseIdx, regionIdx);
|
||||
return referenceDensity(phaseIdx, regionIdx)/Bg;
|
||||
const auto& bg = inverseFormationVolumeFactor<FluidState, LhsEval>(fluidState, gasPhaseIdx, regionIdx);
|
||||
return referenceDensity(phaseIdx, regionIdx)*bg;
|
||||
}
|
||||
|
||||
// miscible gas
|
||||
const auto& Bg = saturatedFormationVolumeFactor<FluidState, LhsEval>(fluidState, gasPhaseIdx, regionIdx);
|
||||
const auto& bg = saturatedInverseFormationVolumeFactor<FluidState, LhsEval>(fluidState, gasPhaseIdx, regionIdx);
|
||||
const auto& Rv = saturatedDissolutionFactor<FluidState, LhsEval>(fluidState, gasPhaseIdx, regionIdx);
|
||||
|
||||
return
|
||||
referenceDensity(gasPhaseIdx, regionIdx)/Bg
|
||||
+ Rv*referenceDensity(oilPhaseIdx, regionIdx)/Bg;
|
||||
bg*referenceDensity(gasPhaseIdx, regionIdx)
|
||||
+ Rv*bg*referenceDensity(oilPhaseIdx, regionIdx);
|
||||
}
|
||||
|
||||
case waterPhaseIdx:
|
||||
return
|
||||
referenceDensity(waterPhaseIdx, regionIdx)
|
||||
/saturatedFormationVolumeFactor<FluidState, LhsEval>(fluidState, waterPhaseIdx, regionIdx);
|
||||
*saturatedInverseFormationVolumeFactor<FluidState, LhsEval>(fluidState, waterPhaseIdx, regionIdx);
|
||||
}
|
||||
|
||||
OPM_THROW(std::logic_error, "Unhandled phase index " << phaseIdx);
|
||||
@ -484,9 +484,9 @@ public:
|
||||
* the given temperature and pressure.
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
static LhsEval formationVolumeFactor(const FluidState& fluidState,
|
||||
unsigned phaseIdx,
|
||||
unsigned regionIdx)
|
||||
static LhsEval inverseFormationVolumeFactor(const FluidState& fluidState,
|
||||
unsigned phaseIdx,
|
||||
unsigned regionIdx)
|
||||
{
|
||||
assert(0 <= phaseIdx && phaseIdx <= numPhases);
|
||||
assert(0 <= regionIdx && regionIdx <= numRegions());
|
||||
@ -497,12 +497,56 @@ public:
|
||||
const auto& T = FsToolbox::template toLhs<LhsEval>(fluidState.temperature(phaseIdx));
|
||||
|
||||
switch (phaseIdx) {
|
||||
case oilPhaseIdx:
|
||||
return oilPvt_->formationVolumeFactor(regionIdx, T, p, getRs_<LhsEval>(fluidState, regionIdx));
|
||||
case gasPhaseIdx:
|
||||
return gasPvt_->formationVolumeFactor(regionIdx, T, p, getRv_<LhsEval>(fluidState, regionIdx));
|
||||
case oilPhaseIdx: {
|
||||
if (enableDissolvedGas()) {
|
||||
if (fluidState.saturation(gasPhaseIdx) > 0.0) {
|
||||
if (fluidState.saturation(gasPhaseIdx) < 1e-4) {
|
||||
// here comes the relatively expensive case: first calculate and then
|
||||
// interpolate between the saturated and undersaturated quantities to
|
||||
// avoid a discontinuity
|
||||
const auto& Rs = getRs_<LhsEval, FluidState>(fluidState, regionIdx);
|
||||
const auto& alpha = FsToolbox::template toLhs<LhsEval>(fluidState.saturation(gasPhaseIdx))/1e-4;
|
||||
const auto& bSat = oilPvt_->saturatedInverseFormationVolumeFactor(regionIdx, T, p);
|
||||
const auto& bUndersat = oilPvt_->inverseFormationVolumeFactor(regionIdx, T, p, Rs);
|
||||
return alpha*bSat + (1.0 - alpha)*bUndersat;
|
||||
}
|
||||
|
||||
return oilPvt_->saturatedInverseFormationVolumeFactor(regionIdx, T, p);
|
||||
}
|
||||
|
||||
const auto& Rs = getRs_<LhsEval, FluidState>(fluidState, regionIdx);
|
||||
return oilPvt_->inverseFormationVolumeFactor(regionIdx, T, p, Rs);
|
||||
}
|
||||
|
||||
const LhsEval Rs(0.0);
|
||||
return oilPvt_->inverseFormationVolumeFactor(regionIdx, T, p, Rs);
|
||||
}
|
||||
case gasPhaseIdx: {
|
||||
if (enableVaporizedOil()) {
|
||||
if (fluidState.saturation(oilPhaseIdx) > 0.0) {
|
||||
if (fluidState.saturation(oilPhaseIdx) < 1e-4) {
|
||||
// here comes the relatively expensive case: first calculate and then
|
||||
// interpolate between the saturated and undersaturated quantities to
|
||||
// avoid a discontinuity
|
||||
const auto& Rv = getRv_<LhsEval, FluidState>(fluidState, regionIdx);
|
||||
const auto& alpha = FsToolbox::template toLhs<LhsEval>(fluidState.saturation(oilPhaseIdx))/1e-4;
|
||||
const auto& bSat = gasPvt_->saturatedInverseFormationVolumeFactor(regionIdx, T, p);
|
||||
const auto& bUndersat = gasPvt_->inverseFormationVolumeFactor(regionIdx, T, p, Rv);
|
||||
return alpha*bSat + (1.0 - alpha)*bUndersat;
|
||||
}
|
||||
|
||||
return gasPvt_->saturatedInverseFormationVolumeFactor(regionIdx, T, p);
|
||||
}
|
||||
|
||||
const auto& Rv = getRv_<LhsEval, FluidState>(fluidState, regionIdx);
|
||||
return gasPvt_->inverseFormationVolumeFactor(regionIdx, T, p, Rv);
|
||||
}
|
||||
|
||||
const LhsEval Rv(0.0);
|
||||
return gasPvt_->inverseFormationVolumeFactor(regionIdx, T, p, Rv);
|
||||
}
|
||||
case waterPhaseIdx:
|
||||
return waterPvt_->formationVolumeFactor(regionIdx, T, p);
|
||||
return waterPvt_->inverseFormationVolumeFactor(regionIdx, T, p);
|
||||
default: OPM_THROW(std::logic_error, "Unhandled phase index " << phaseIdx);
|
||||
}
|
||||
}
|
||||
@ -515,9 +559,9 @@ public:
|
||||
* saturated and for the water phase, there is no difference to formationVolumeFactor()
|
||||
*/
|
||||
template <class FluidState, class LhsEval = typename FluidState::Scalar>
|
||||
static LhsEval saturatedFormationVolumeFactor(const FluidState& fluidState,
|
||||
unsigned phaseIdx,
|
||||
unsigned regionIdx)
|
||||
static LhsEval saturatedInverseFormationVolumeFactor(const FluidState& fluidState,
|
||||
unsigned phaseIdx,
|
||||
unsigned regionIdx)
|
||||
{
|
||||
assert(0 <= phaseIdx && phaseIdx <= numPhases);
|
||||
assert(0 <= regionIdx && regionIdx <= numRegions());
|
||||
@ -528,9 +572,9 @@ public:
|
||||
const auto& T = FsToolbox::template toLhs<LhsEval>(fluidState.temperature(phaseIdx));
|
||||
|
||||
switch (phaseIdx) {
|
||||
case oilPhaseIdx: return oilPvt_->saturatedFormationVolumeFactor(regionIdx, T, p);
|
||||
case gasPhaseIdx: return gasPvt_->saturatedFormationVolumeFactor(regionIdx, T, p);
|
||||
case waterPhaseIdx: return waterPvt_->formationVolumeFactor(regionIdx, T, p);
|
||||
case oilPhaseIdx: return oilPvt_->saturatedInverseFormationVolumeFactor(regionIdx, T, p);
|
||||
case gasPhaseIdx: return gasPvt_->saturatedInverseFormationVolumeFactor(regionIdx, T, p);
|
||||
case waterPhaseIdx: return waterPvt_->inverseFormationVolumeFactor(regionIdx, T, p);
|
||||
default: OPM_THROW(std::logic_error, "Unhandled phase index " << phaseIdx);
|
||||
}
|
||||
}
|
||||
@ -678,56 +722,56 @@ public:
|
||||
const auto& T = FsToolbox::template toLhs<LhsEval>(fluidState.temperature(phaseIdx));
|
||||
|
||||
switch (phaseIdx) {
|
||||
case oilPhaseIdx:
|
||||
if (!enableDissolvedGas())
|
||||
// if the oil phase is immiscible with the gas component, we can use the
|
||||
// "saturated" properties from the outset...
|
||||
return oilPvt_->saturatedViscosity(regionIdx, T, p);
|
||||
else if (fluidState.saturation(gasPhaseIdx) > 0.0) {
|
||||
if (fluidState.saturation(gasPhaseIdx) < 1e-4) {
|
||||
// here comes the relatively expensive case: first calculate and then
|
||||
// interpolate between the saturated and undersaturated quantities to
|
||||
// avoid a discontinuity
|
||||
const auto& Rs = getRs_<LhsEval>(fluidState, regionIdx);
|
||||
const auto& alpha = FsToolbox::template toLhs<LhsEval>(fluidState.saturation(gasPhaseIdx))/1e-4;
|
||||
const auto& muSat = oilPvt_->saturatedViscosity(regionIdx, T, p);
|
||||
const auto& muUndersat = oilPvt_->viscosity(regionIdx, T, p, Rs);
|
||||
return alpha*muSat + (1.0 - alpha)*muUndersat;
|
||||
case oilPhaseIdx: {
|
||||
if (enableDissolvedGas()) {
|
||||
if (fluidState.saturation(gasPhaseIdx) > 0.0) {
|
||||
if (fluidState.saturation(gasPhaseIdx) < 1e-4) {
|
||||
// here comes the relatively expensive case: first calculate and then
|
||||
// interpolate between the saturated and undersaturated quantities to
|
||||
// avoid a discontinuity
|
||||
const auto& Rs = getRs_<LhsEval, FluidState>(fluidState, regionIdx);
|
||||
const auto& alpha = FsToolbox::template toLhs<LhsEval>(fluidState.saturation(gasPhaseIdx))/1e-4;
|
||||
const auto& muSat = oilPvt_->saturatedViscosity(regionIdx, T, p);
|
||||
const auto& muUndersat = oilPvt_->viscosity(regionIdx, T, p, Rs);
|
||||
return alpha*muSat + (1.0 - alpha)*muUndersat;
|
||||
}
|
||||
|
||||
return oilPvt_->saturatedViscosity(regionIdx, T, p);
|
||||
}
|
||||
|
||||
return oilPvt_->saturatedViscosity(regionIdx, T, p);
|
||||
}
|
||||
else {
|
||||
// undersaturated oil
|
||||
const auto& Rs = getRs_<LhsEval>(fluidState, regionIdx);
|
||||
const auto& Rs = getRs_<LhsEval, FluidState>(fluidState, regionIdx);
|
||||
return oilPvt_->viscosity(regionIdx, T, p, Rs);
|
||||
}
|
||||
|
||||
case gasPhaseIdx:
|
||||
if (!enableVaporizedOil())
|
||||
// if the gas phase is immiscible with the oil component, we can use the
|
||||
// saturated properties from the outset...
|
||||
return gasPvt_->saturatedViscosity(regionIdx, T, p);
|
||||
else if (fluidState.saturation(oilPhaseIdx) > 0.0) {
|
||||
if (fluidState.saturation(oilPhaseIdx) < 1e-4) {
|
||||
// here comes the relatively expensive case: first calculate and then
|
||||
// interpolate between the saturated and undersaturated quantities to
|
||||
// avoid a discontinuity
|
||||
const auto& Rv = getRv_<LhsEval>(fluidState, regionIdx);
|
||||
const auto& alpha = FsToolbox::template toLhs<LhsEval>(fluidState.saturation(oilPhaseIdx))/1e-4;
|
||||
const auto& muSat = gasPvt_->saturatedViscosity(regionIdx, T, p);
|
||||
const auto& muUndersat = gasPvt_->viscosity(regionIdx, T, p, Rv);
|
||||
return alpha*muSat + (1.0 - alpha)*muUndersat;
|
||||
const LhsEval Rs(0.0);
|
||||
return oilPvt_->viscosity(regionIdx, T, p, Rs);
|
||||
}
|
||||
|
||||
case gasPhaseIdx: {
|
||||
if (enableVaporizedOil()) {
|
||||
if (fluidState.saturation(oilPhaseIdx) > 0.0) {
|
||||
if (fluidState.saturation(oilPhaseIdx) < 1e-4) {
|
||||
// here comes the relatively expensive case: first calculate and then
|
||||
// interpolate between the saturated and undersaturated quantities to
|
||||
// avoid a discontinuity
|
||||
const auto& Rv = getRv_<LhsEval, FluidState>(fluidState, regionIdx);
|
||||
const auto& alpha = FsToolbox::template toLhs<LhsEval>(fluidState.saturation(oilPhaseIdx))/1e-4;
|
||||
const auto& muSat = gasPvt_->saturatedViscosity(regionIdx, T, p);
|
||||
const auto& muUndersat = gasPvt_->viscosity(regionIdx, T, p, Rv);
|
||||
return alpha*muSat + (1.0 - alpha)*muUndersat;
|
||||
}
|
||||
|
||||
return gasPvt_->saturatedViscosity(regionIdx, T, p);
|
||||
}
|
||||
|
||||
return gasPvt_->saturatedViscosity(regionIdx, T, p);
|
||||
}
|
||||
else {
|
||||
// undersaturated gas
|
||||
const auto& Rv = getRv_<LhsEval>(fluidState, regionIdx);
|
||||
const auto& Rv = getRv_<LhsEval, FluidState>(fluidState, regionIdx);
|
||||
return gasPvt_->viscosity(regionIdx, T, p, Rv);
|
||||
}
|
||||
|
||||
const LhsEval Rv(0.0);
|
||||
return gasPvt_->viscosity(regionIdx, T, p, Rv);
|
||||
}
|
||||
|
||||
case waterPhaseIdx:
|
||||
// since water is always assumed to be immiscible in the black-oil model,
|
||||
// there is no "saturated water"
|
||||
|
@ -184,24 +184,24 @@ public:
|
||||
// calcultes the product of B_w and mu_w and then divides the
|
||||
// result by B_w...
|
||||
Scalar BoMuoRef = oilViscosity_[regionIdx]*oilReferenceFormationVolumeFactor_[regionIdx];
|
||||
const Evaluation& Bo = saturatedFormationVolumeFactor(regionIdx, temperature, pressure);
|
||||
const Evaluation& bo = saturatedInverseFormationVolumeFactor(regionIdx, temperature, pressure);
|
||||
|
||||
Scalar pRef = oilReferencePressure_[regionIdx];
|
||||
const Evaluation& Y =
|
||||
(oilCompressibility_[regionIdx] - oilViscosibility_[regionIdx])
|
||||
* (pressure - pRef);
|
||||
return BoMuoRef/((1 + Y*(1 + Y/2))*Bo);
|
||||
return BoMuoRef*bo/(1.0 + Y*(1.0 + Y/2.0));
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns the formation volume factor [-] of the fluid phase.
|
||||
*/
|
||||
template <class Evaluation>
|
||||
Evaluation formationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& temperature,
|
||||
const Evaluation& pressure,
|
||||
const Evaluation& /*Rs*/) const
|
||||
{ return saturatedFormationVolumeFactor(regionIdx, temperature, pressure); }
|
||||
Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& temperature,
|
||||
const Evaluation& pressure,
|
||||
const Evaluation& /*Rs*/) const
|
||||
{ return saturatedInverseFormationVolumeFactor(regionIdx, temperature, pressure); }
|
||||
|
||||
/*!
|
||||
* \brief Returns the formation volume factor [-] of gas saturated oil.
|
||||
@ -210,16 +210,16 @@ public:
|
||||
* is always gas saturated by by definition.
|
||||
*/
|
||||
template <class Evaluation>
|
||||
Evaluation saturatedFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure) const
|
||||
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure) const
|
||||
{
|
||||
// cf. ECLiPSE 2011 technical description, p. 116
|
||||
Scalar pRef = oilReferencePressure_[regionIdx];
|
||||
const Evaluation& X = oilCompressibility_[regionIdx]*(pressure - pRef);
|
||||
|
||||
Scalar BoRef = oilReferenceFormationVolumeFactor_[regionIdx];
|
||||
return BoRef/(1 + X*(1 + X/2));
|
||||
return (1 + X*(1 + X/2))/BoRef;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -181,9 +181,9 @@ public:
|
||||
* \brief Returns the formation volume factor [-] of the fluid phase.
|
||||
*/
|
||||
template <class Evaluation>
|
||||
Evaluation formationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure) const
|
||||
Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure) const
|
||||
{
|
||||
// cf. ECLiPSE 2011 technical description, p. 116
|
||||
Scalar pRef = waterReferencePressure_[regionIdx];
|
||||
@ -192,7 +192,7 @@ public:
|
||||
Scalar BwRef = waterReferenceFormationVolumeFactor_[regionIdx];
|
||||
|
||||
// TODO (?): consider the salt concentration of the brine
|
||||
return BwRef/(1 + X*(1 + X/2));
|
||||
return (1.0 + X*(1.0 + X/2.0))/BwRef;
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -191,11 +191,11 @@ public:
|
||||
* \brief Returns the formation volume factor [-] of the fluid phase.
|
||||
*/
|
||||
template <class Evaluation>
|
||||
Evaluation formationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure,
|
||||
const Evaluation& /*Rs*/) const
|
||||
{ return 1.0 / inverseOilB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
|
||||
Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure,
|
||||
const Evaluation& /*Rs*/) const
|
||||
{ return inverseOilB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
|
||||
|
||||
/*!
|
||||
* \brief Returns the formation volume factor [-] of saturated oil.
|
||||
@ -203,10 +203,10 @@ public:
|
||||
* Note that by definition, dead oil is always gas saturated.
|
||||
*/
|
||||
template <class Evaluation>
|
||||
Evaluation saturatedFormationVolumeFactor(unsigned regionIdx,
|
||||
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure) const
|
||||
{ return 1.0 / inverseOilB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
|
||||
{ return inverseOilB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
|
||||
|
||||
/*!
|
||||
* \brief Returns the gas dissolution factor \f$R_s\f$ [m^3/m^3] of the oil phase.
|
||||
|
@ -213,47 +213,24 @@ public:
|
||||
return invBg/invMugBg;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns the density [kg/m^3] of the fluid phase given a set of parameters.
|
||||
*/
|
||||
template <class Evaluation>
|
||||
Evaluation density(unsigned regionIdx,
|
||||
const Evaluation& temperature,
|
||||
const Evaluation& pressure,
|
||||
const Evaluation& /*Rv*/) const
|
||||
{ return saturatedDensity(regionIdx, temperature, pressure); }
|
||||
|
||||
/*!
|
||||
* \brief Returns the density [kg/m^3] of oil saturated gas at given pressure.
|
||||
*/
|
||||
template <class Evaluation>
|
||||
Evaluation saturatedDensity(unsigned regionIdx,
|
||||
const Evaluation& temperature,
|
||||
const Evaluation& pressure) const
|
||||
{
|
||||
// gas formation volume factor at reservoir pressure
|
||||
const Evaluation& Bg = saturatedFormationVolumeFactor(regionIdx, temperature, pressure);
|
||||
return gasReferenceDensity_[regionIdx]/Bg;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns the formation volume factor [-] of the fluid phase.
|
||||
*/
|
||||
template <class Evaluation>
|
||||
Evaluation formationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& temperature,
|
||||
const Evaluation& pressure,
|
||||
const Evaluation& /*Rv*/) const
|
||||
{ return saturatedFormationVolumeFactor(regionIdx, temperature, pressure); }
|
||||
Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& temperature,
|
||||
const Evaluation& pressure,
|
||||
const Evaluation& /*Rv*/) const
|
||||
{ return saturatedInverseFormationVolumeFactor(regionIdx, temperature, pressure); }
|
||||
|
||||
/*!
|
||||
* \brief Returns the formation volume factor [-] of oil saturated gas at given pressure.
|
||||
*/
|
||||
template <class Evaluation>
|
||||
Evaluation saturatedFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure) const
|
||||
{ return 1.0/inverseGasB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
|
||||
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure) const
|
||||
{ return inverseGasB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
|
||||
|
||||
/*!
|
||||
* \brief Returns the saturation pressure of the gas phase [Pa]
|
||||
|
@ -162,20 +162,20 @@ public:
|
||||
* \brief Returns the formation volume factor [-] of the fluid phase.
|
||||
*/
|
||||
template <class Evaluation = Scalar>
|
||||
Evaluation formationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& temperature,
|
||||
const Evaluation& pressure,
|
||||
const Evaluation& Rv) const
|
||||
{ OPM_GAS_PVT_MULTIPLEXER_CALL(return pvtImpl.formationVolumeFactor(regionIdx, temperature, pressure, Rv)); return 0; }
|
||||
Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& temperature,
|
||||
const Evaluation& pressure,
|
||||
const Evaluation& Rv) const
|
||||
{ OPM_GAS_PVT_MULTIPLEXER_CALL(return pvtImpl.inverseFormationVolumeFactor(regionIdx, temperature, pressure, Rv)); return 0; }
|
||||
|
||||
/*!
|
||||
* \brief Returns the formation volume factor [-] of oil saturated gas given a set of parameters.
|
||||
*/
|
||||
template <class Evaluation = Scalar>
|
||||
Evaluation saturatedFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& temperature,
|
||||
const Evaluation& pressure) const
|
||||
{ OPM_GAS_PVT_MULTIPLEXER_CALL(return pvtImpl.saturatedFormationVolumeFactor(regionIdx, temperature, pressure)); return 0; }
|
||||
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& temperature,
|
||||
const Evaluation& pressure) const
|
||||
{ OPM_GAS_PVT_MULTIPLEXER_CALL(return pvtImpl.saturatedInverseFormationVolumeFactor(regionIdx, temperature, pressure)); return 0; }
|
||||
|
||||
/*!
|
||||
* \brief Returns the oil vaporization factor \f$R_v\f$ [m^3/m^3] of oil saturated gas.
|
||||
|
@ -433,25 +433,25 @@ public:
|
||||
* \brief Returns the formation volume factor [-] of the fluid phase.
|
||||
*/
|
||||
template <class Evaluation>
|
||||
Evaluation formationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure,
|
||||
const Evaluation& Rs) const
|
||||
Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure,
|
||||
const Evaluation& Rs) const
|
||||
{
|
||||
// ATTENTION: Rs is represented by the _first_ axis!
|
||||
return 1.0 / inverseOilBTable_[regionIdx].eval(Rs, pressure, /*extrapolate=*/true);
|
||||
return inverseOilBTable_[regionIdx].eval(Rs, pressure, /*extrapolate=*/true);
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns the formation volume factor [-] of the fluid phase.
|
||||
*/
|
||||
template <class Evaluation>
|
||||
Evaluation saturatedFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure) const
|
||||
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure) const
|
||||
{
|
||||
// ATTENTION: Rs is represented by the _first_ axis!
|
||||
return 1.0 / inverseSaturatedOilBTable_[regionIdx].eval(pressure, /*extrapolate=*/true);
|
||||
return inverseSaturatedOilBTable_[regionIdx].eval(pressure, /*extrapolate=*/true);
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -153,20 +153,20 @@ public:
|
||||
* \brief Returns the formation volume factor [-] of the fluid phase.
|
||||
*/
|
||||
template <class Evaluation>
|
||||
Evaluation formationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& temperature,
|
||||
const Evaluation& pressure,
|
||||
const Evaluation& Rs) const
|
||||
{ OPM_OIL_PVT_MULTIPLEXER_CALL(return pvtImpl.formationVolumeFactor(regionIdx, temperature, pressure, Rs)); return 0; }
|
||||
Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& temperature,
|
||||
const Evaluation& pressure,
|
||||
const Evaluation& Rs) const
|
||||
{ OPM_OIL_PVT_MULTIPLEXER_CALL(return pvtImpl.inverseFormationVolumeFactor(regionIdx, temperature, pressure, Rs)); return 0; }
|
||||
|
||||
/*!
|
||||
* \brief Returns the formation volume factor [-] of the fluid phase.
|
||||
*/
|
||||
template <class Evaluation>
|
||||
Evaluation saturatedFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& temperature,
|
||||
const Evaluation& pressure) const
|
||||
{ OPM_OIL_PVT_MULTIPLEXER_CALL(return pvtImpl.saturatedFormationVolumeFactor(regionIdx, temperature, pressure)); return 0; }
|
||||
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& temperature,
|
||||
const Evaluation& pressure) const
|
||||
{ OPM_OIL_PVT_MULTIPLEXER_CALL(return pvtImpl.saturatedInverseFormationVolumeFactor(regionIdx, temperature, pressure)); return 0; }
|
||||
|
||||
/*!
|
||||
* \brief Returns the gas dissolution factor \f$R_s\f$ [m^3/m^3] of saturated oil.
|
||||
|
@ -107,10 +107,10 @@ public:
|
||||
* \brief Returns the formation volume factor [-] of the fluid phase.
|
||||
*/
|
||||
template <class Evaluation>
|
||||
Evaluation formationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& temperature,
|
||||
const Evaluation& pressure) const
|
||||
{ OPM_WATER_PVT_MULTIPLEXER_CALL(return pvtImpl.formationVolumeFactor(regionIdx, temperature, pressure)); return 0; }
|
||||
Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& temperature,
|
||||
const Evaluation& pressure) const
|
||||
{ OPM_WATER_PVT_MULTIPLEXER_CALL(return pvtImpl.inverseFormationVolumeFactor(regionIdx, temperature, pressure)); return 0; }
|
||||
|
||||
void setApproach(WaterPvtApproach appr)
|
||||
{
|
||||
|
@ -464,20 +464,20 @@ public:
|
||||
* \brief Returns the formation volume factor [-] of the fluid phase.
|
||||
*/
|
||||
template <class Evaluation>
|
||||
Evaluation formationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure,
|
||||
const Evaluation& Rv) const
|
||||
{ return 1.0 / inverseGasB_[regionIdx].eval(pressure, Rv, /*extrapolate=*/true); }
|
||||
Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure,
|
||||
const Evaluation& Rv) const
|
||||
{ return inverseGasB_[regionIdx].eval(pressure, Rv, /*extrapolate=*/true); }
|
||||
|
||||
/*!
|
||||
* \brief Returns the formation volume factor [-] of oil saturated gas at a given pressure.
|
||||
*/
|
||||
template <class Evaluation>
|
||||
Evaluation saturatedFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure) const
|
||||
{ return 1.0 / inverseSaturatedGasB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
|
||||
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
|
||||
const Evaluation& /*temperature*/,
|
||||
const Evaluation& pressure) const
|
||||
{ return inverseSaturatedGasB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
|
||||
|
||||
/*!
|
||||
* \brief Returns the gas dissolution factor \f$R_s\f$ [m^3/m^3] of the oil phase.
|
||||
|
@ -145,9 +145,9 @@ void ensurePvtApi(const OilPvt& oilPvt, const GasPvt& gasPvt, const WaterPvt& wa
|
||||
tmp = waterPvt.viscosity(/*regionIdx=*/0,
|
||||
temperature,
|
||||
pressure);
|
||||
tmp = waterPvt.formationVolumeFactor(/*regionIdx=*/0,
|
||||
temperature,
|
||||
pressure);
|
||||
tmp = waterPvt.inverseFormationVolumeFactor(/*regionIdx=*/0,
|
||||
temperature,
|
||||
pressure);
|
||||
|
||||
/////
|
||||
// oil PVT API
|
||||
@ -156,16 +156,16 @@ void ensurePvtApi(const OilPvt& oilPvt, const GasPvt& gasPvt, const WaterPvt& wa
|
||||
temperature,
|
||||
pressure,
|
||||
Rs);
|
||||
tmp = oilPvt.formationVolumeFactor(/*regionIdx=*/0,
|
||||
temperature,
|
||||
pressure,
|
||||
Rs);
|
||||
tmp = oilPvt.inverseFormationVolumeFactor(/*regionIdx=*/0,
|
||||
temperature,
|
||||
pressure,
|
||||
Rs);
|
||||
tmp = oilPvt.saturatedViscosity(/*regionIdx=*/0,
|
||||
temperature,
|
||||
pressure);
|
||||
tmp = oilPvt.saturatedFormationVolumeFactor(/*regionIdx=*/0,
|
||||
temperature,
|
||||
pressure);
|
||||
tmp = oilPvt.saturatedInverseFormationVolumeFactor(/*regionIdx=*/0,
|
||||
temperature,
|
||||
pressure);
|
||||
tmp = oilPvt.saturationPressure(/*regionIdx=*/0,
|
||||
temperature,
|
||||
Rs);
|
||||
@ -180,16 +180,16 @@ void ensurePvtApi(const OilPvt& oilPvt, const GasPvt& gasPvt, const WaterPvt& wa
|
||||
temperature,
|
||||
pressure,
|
||||
Rv);
|
||||
tmp = gasPvt.formationVolumeFactor(/*regionIdx=*/0,
|
||||
temperature,
|
||||
pressure,
|
||||
Rv);
|
||||
tmp = gasPvt.inverseFormationVolumeFactor(/*regionIdx=*/0,
|
||||
temperature,
|
||||
pressure,
|
||||
Rv);
|
||||
tmp = gasPvt.saturatedViscosity(/*regionIdx=*/0,
|
||||
temperature,
|
||||
pressure);
|
||||
tmp = gasPvt.saturatedFormationVolumeFactor(/*regionIdx=*/0,
|
||||
temperature,
|
||||
pressure);
|
||||
tmp = gasPvt.saturatedInverseFormationVolumeFactor(/*regionIdx=*/0,
|
||||
temperature,
|
||||
pressure);
|
||||
tmp = gasPvt.saturationPressure(/*regionIdx=*/0,
|
||||
temperature,
|
||||
Rv);
|
||||
|
@ -146,8 +146,8 @@ void ensureBlackoilApi()
|
||||
for (unsigned phaseIdx = 0; phaseIdx < FluidSystem::numPhases; ++ phaseIdx) {
|
||||
dummy = FluidSystem::density(fluidState, phaseIdx, /*regionIdx=*/0);
|
||||
dummy = FluidSystem::saturatedDensity(fluidState, phaseIdx, /*regionIdx=*/0);
|
||||
dummy = FluidSystem::formationVolumeFactor(fluidState, phaseIdx, /*regionIdx=*/0);
|
||||
dummy = FluidSystem::saturatedFormationVolumeFactor(fluidState, phaseIdx, /*regionIdx=*/0);
|
||||
dummy = FluidSystem::inverseFormationVolumeFactor(fluidState, phaseIdx, /*regionIdx=*/0);
|
||||
dummy = FluidSystem::saturatedInverseFormationVolumeFactor(fluidState, phaseIdx, /*regionIdx=*/0);
|
||||
dummy = FluidSystem::viscosity(fluidState, phaseIdx, /*regionIdx=*/0);
|
||||
dummy = FluidSystem::saturatedDissolutionFactor(fluidState, phaseIdx, /*regionIdx=*/0);
|
||||
dummy = FluidSystem::saturationPressure(fluidState, phaseIdx, /*regionIdx=*/0);
|
||||
|
Loading…
Reference in New Issue
Block a user