diff --git a/opm/material/fluidsystems/BlackOilFluidSystem.hpp b/opm/material/fluidsystems/BlackOilFluidSystem.hpp index 903eb610c..9d1f1c4ca 100644 --- a/opm/material/fluidsystems/BlackOilFluidSystem.hpp +++ b/opm/material/fluidsystems/BlackOilFluidSystem.hpp @@ -380,39 +380,39 @@ public: case oilPhaseIdx: { if (!enableDissolvedGas()) { // immiscible oil - const auto& Bo = formationVolumeFactor(fluidState, oilPhaseIdx, regionIdx); - return referenceDensity(phaseIdx, regionIdx)/Bo; + const auto& bo = inverseFormationVolumeFactor(fluidState, oilPhaseIdx, regionIdx); + return referenceDensity(phaseIdx, regionIdx)*bo; } // miscible oil - const auto& Bo = formationVolumeFactor(fluidState, oilPhaseIdx, regionIdx); + const auto& bo = inverseFormationVolumeFactor(fluidState, oilPhaseIdx, regionIdx); const auto& Rs = getRs_(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, gasPhaseIdx, regionIdx); - return Bg*referenceDensity(phaseIdx, regionIdx); + const auto& bg = inverseFormationVolumeFactor(fluidState, gasPhaseIdx, regionIdx); + return bg*referenceDensity(phaseIdx, regionIdx); } // miscible gas - const auto& Bg = formationVolumeFactor(fluidState, gasPhaseIdx, regionIdx); + const auto& bg = inverseFormationVolumeFactor(fluidState, gasPhaseIdx, regionIdx); const auto& Rv = getRv_(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, waterPhaseIdx, regionIdx); + *inverseFormationVolumeFactor(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, oilPhaseIdx, regionIdx); - return referenceDensity(phaseIdx, regionIdx)/Bo; + const auto& bo = inverseFormationVolumeFactor(fluidState, oilPhaseIdx, regionIdx); + return referenceDensity(phaseIdx, regionIdx)*bo; } // miscible oil - const auto& Bo = saturatedFormationVolumeFactor(fluidState, oilPhaseIdx, regionIdx); + const auto& bo = saturatedInverseFormationVolumeFactor(fluidState, oilPhaseIdx, regionIdx); const auto& Rs = saturatedDissolutionFactor(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, gasPhaseIdx, regionIdx); - return referenceDensity(phaseIdx, regionIdx)/Bg; + const auto& bg = inverseFormationVolumeFactor(fluidState, gasPhaseIdx, regionIdx); + return referenceDensity(phaseIdx, regionIdx)*bg; } // miscible gas - const auto& Bg = saturatedFormationVolumeFactor(fluidState, gasPhaseIdx, regionIdx); + const auto& bg = saturatedInverseFormationVolumeFactor(fluidState, gasPhaseIdx, regionIdx); const auto& Rv = saturatedDissolutionFactor(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, waterPhaseIdx, regionIdx); + *saturatedInverseFormationVolumeFactor(fluidState, waterPhaseIdx, regionIdx); } OPM_THROW(std::logic_error, "Unhandled phase index " << phaseIdx); @@ -484,9 +484,9 @@ public: * the given temperature and pressure. */ template - 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(fluidState.temperature(phaseIdx)); switch (phaseIdx) { - case oilPhaseIdx: - return oilPvt_->formationVolumeFactor(regionIdx, T, p, getRs_(fluidState, regionIdx)); - case gasPhaseIdx: - return gasPvt_->formationVolumeFactor(regionIdx, T, p, getRv_(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_(fluidState, regionIdx); + const auto& alpha = FsToolbox::template toLhs(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_(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_(fluidState, regionIdx); + const auto& alpha = FsToolbox::template toLhs(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_(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 - 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(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(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_(fluidState, regionIdx); - const auto& alpha = FsToolbox::template toLhs(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_(fluidState, regionIdx); + const auto& alpha = FsToolbox::template toLhs(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_(fluidState, regionIdx); + const auto& Rs = getRs_(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_(fluidState, regionIdx); - const auto& alpha = FsToolbox::template toLhs(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_(fluidState, regionIdx); + const auto& alpha = FsToolbox::template toLhs(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_(fluidState, regionIdx); + const auto& Rv = getRv_(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" diff --git a/opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityOilPvt.hpp b/opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityOilPvt.hpp index b04d33def..a352775e3 100644 --- a/opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityOilPvt.hpp +++ b/opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityOilPvt.hpp @@ -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 - 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 - 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; } /*! diff --git a/opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityWaterPvt.hpp b/opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityWaterPvt.hpp index 404b1fe19..68b08a75b 100644 --- a/opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityWaterPvt.hpp +++ b/opm/material/fluidsystems/blackoilpvt/ConstantCompressibilityWaterPvt.hpp @@ -181,9 +181,9 @@ public: * \brief Returns the formation volume factor [-] of the fluid phase. */ template - 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: diff --git a/opm/material/fluidsystems/blackoilpvt/DeadOilPvt.hpp b/opm/material/fluidsystems/blackoilpvt/DeadOilPvt.hpp index 30eab7f28..30d8d0da9 100644 --- a/opm/material/fluidsystems/blackoilpvt/DeadOilPvt.hpp +++ b/opm/material/fluidsystems/blackoilpvt/DeadOilPvt.hpp @@ -191,11 +191,11 @@ public: * \brief Returns the formation volume factor [-] of the fluid phase. */ template - 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 - 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. diff --git a/opm/material/fluidsystems/blackoilpvt/DryGasPvt.hpp b/opm/material/fluidsystems/blackoilpvt/DryGasPvt.hpp index 41ca5cf4e..964450abe 100644 --- a/opm/material/fluidsystems/blackoilpvt/DryGasPvt.hpp +++ b/opm/material/fluidsystems/blackoilpvt/DryGasPvt.hpp @@ -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 - 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 - 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 - 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 - 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] diff --git a/opm/material/fluidsystems/blackoilpvt/GasPvtMultiplexer.hpp b/opm/material/fluidsystems/blackoilpvt/GasPvtMultiplexer.hpp index 8802e5bc2..f6c4c89c2 100644 --- a/opm/material/fluidsystems/blackoilpvt/GasPvtMultiplexer.hpp +++ b/opm/material/fluidsystems/blackoilpvt/GasPvtMultiplexer.hpp @@ -162,20 +162,20 @@ public: * \brief Returns the formation volume factor [-] of the fluid phase. */ template - 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 - 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. diff --git a/opm/material/fluidsystems/blackoilpvt/LiveOilPvt.hpp b/opm/material/fluidsystems/blackoilpvt/LiveOilPvt.hpp index 3ea680bba..ad4935a3e 100644 --- a/opm/material/fluidsystems/blackoilpvt/LiveOilPvt.hpp +++ b/opm/material/fluidsystems/blackoilpvt/LiveOilPvt.hpp @@ -433,25 +433,25 @@ public: * \brief Returns the formation volume factor [-] of the fluid phase. */ template - 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 - 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); } /*! diff --git a/opm/material/fluidsystems/blackoilpvt/OilPvtMultiplexer.hpp b/opm/material/fluidsystems/blackoilpvt/OilPvtMultiplexer.hpp index 3ad68f795..e000059c9 100644 --- a/opm/material/fluidsystems/blackoilpvt/OilPvtMultiplexer.hpp +++ b/opm/material/fluidsystems/blackoilpvt/OilPvtMultiplexer.hpp @@ -153,20 +153,20 @@ public: * \brief Returns the formation volume factor [-] of the fluid phase. */ template - 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 - 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. diff --git a/opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp b/opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp index 09bbdef2b..257a0407c 100644 --- a/opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp +++ b/opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp @@ -107,10 +107,10 @@ public: * \brief Returns the formation volume factor [-] of the fluid phase. */ template - 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) { diff --git a/opm/material/fluidsystems/blackoilpvt/WetGasPvt.hpp b/opm/material/fluidsystems/blackoilpvt/WetGasPvt.hpp index 537e2334f..91436fcf5 100644 --- a/opm/material/fluidsystems/blackoilpvt/WetGasPvt.hpp +++ b/opm/material/fluidsystems/blackoilpvt/WetGasPvt.hpp @@ -464,20 +464,20 @@ public: * \brief Returns the formation volume factor [-] of the fluid phase. */ template - 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 - 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. diff --git a/tests/test_eclblackoilpvt.cpp b/tests/test_eclblackoilpvt.cpp index 9a3fbceed..98485d2a7 100644 --- a/tests/test_eclblackoilpvt.cpp +++ b/tests/test_eclblackoilpvt.cpp @@ -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); diff --git a/tests/test_fluidsystems.cpp b/tests/test_fluidsystems.cpp index ae512907b..f56bcd1a3 100644 --- a/tests/test_fluidsystems.cpp +++ b/tests/test_fluidsystems.cpp @@ -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);