27#ifndef OPM_DEAD_OIL_PVT_HPP
28#define OPM_DEAD_OIL_PVT_HPP
46template <
class Scalar>
61 void setVapPars(
const Scalar,
const Scalar)
73 oilReferenceDensity_[regionIdx] = rhoRefOil;
87 const TabulatedOneDFunction& invBo)
88 { inverseOilB_[regionIdx] = invBo; }
96 { oilMu_[regionIdx] = muo; }
107 {
return inverseOilBMu_.size(); }
112 template <
class Evaluation>
116 const Evaluation&)
const
118 throw std::runtime_error(
"Requested the enthalpy of oil but the thermal "
119 "option is not enabled");
122 Scalar hVap(
unsigned)
const
124 throw std::runtime_error(
"Requested the hvap of oil but the thermal "
125 "option is not enabled");
130 template <
class Evaluation>
132 const Evaluation& temperature,
133 const Evaluation& pressure,
134 const Evaluation& )
const
140 template <
class Evaluation>
143 const Evaluation& pressure)
const
145 const Evaluation& invBo = inverseOilB_[regionIdx].eval(pressure,
true);
146 const Evaluation& invMuoBo = inverseOilBMu_[regionIdx].eval(pressure,
true);
148 return invBo / invMuoBo;
154 template <
class Evaluation>
157 const Evaluation& pressure,
158 const Evaluation& )
const
159 {
return inverseOilB_[regionIdx].eval(pressure,
true); }
164 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar>
165 std::pair<LhsEval, LhsEval>
168 const LhsEval& p = decay<LhsEval>(fluidState.pressure(FluidState::oilPhaseIdx));
169 const auto segIdx = this->inverseOilB_[regionIdx].findSegmentIndex(p,
true);
170 const auto& invBo = this->inverseOilB_[regionIdx].eval(p,
SegmentIndex{segIdx});
171 const auto& invMuoBo = this->inverseOilBMu_[regionIdx].eval(p,
SegmentIndex{segIdx});
172 return { invBo, invBo / invMuoBo };
180 template <
class Evaluation>
183 const Evaluation& pressure)
const
184 {
return inverseOilB_[regionIdx].eval(pressure,
true); }
189 template <
class Evaluation>
192 const Evaluation& )
const
198 template <
class Evaluation>
203 const Evaluation& )
const
212 template <
class Evaluation>
215 const Evaluation& )
const
218 template <
class Evaluation>
219 Evaluation saturatedGasMassFraction(
unsigned ,
221 const Evaluation& )
const
224 template <
class Evaluation>
225 Evaluation saturatedGasMoleFraction(
unsigned ,
227 const Evaluation& )
const
230 template <
class Evaluation>
231 Evaluation diffusionCoefficient(
const Evaluation& ,
235 throw std::runtime_error(
"Not implemented: The PVT model does not provide "
236 "a diffusionCoefficient()");
239 Scalar oilReferenceDensity(
unsigned regionIdx)
const
240 {
return oilReferenceDensity_[regionIdx]; }
242 const std::vector<TabulatedOneDFunction>& inverseOilB()
const
243 {
return inverseOilB_; }
245 const std::vector<TabulatedOneDFunction>& oilMu()
const
248 const std::vector<TabulatedOneDFunction>& inverseOilBMu()
const
249 {
return inverseOilBMu_; }
252 std::vector<Scalar> oilReferenceDensity_{};
253 std::vector<TabulatedOneDFunction> inverseOilB_{};
254 std::vector<TabulatedOneDFunction> oilMu_{};
255 std::vector<TabulatedOneDFunction> inverseOilBMu_{};
Implements a linearly interpolated scalar function that depends on one variable.
This class represents the Pressure-Volume-Temperature relations of the oil phase without dissolved ga...
Definition DeadOilPvt.hpp:48
void setOilViscosity(unsigned regionIdx, const TabulatedOneDFunction &muo)
Initialize the viscosity of the oil phase.
Definition DeadOilPvt.hpp:95
Evaluation saturatedGasDissolutionFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the gas dissolution factor [m^3/m^3] of the oil phase.
Definition DeadOilPvt.hpp:190
std::pair< LhsEval, LhsEval > inverseFormationVolumeFactorAndViscosity(const FluidState &fluidState, unsigned regionIdx)
Returns the formation volume factor [-] and viscosity [Pa s] of the fluid phase.
Definition DeadOilPvt.hpp:166
void setInverseOilFormationVolumeFactor(unsigned regionIdx, const TabulatedOneDFunction &invBo)
Initialize the function for the oil formation volume factor.
Definition DeadOilPvt.hpp:86
Evaluation viscosity(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &) const
Returns the dynamic viscosity [Pa s] of the fluid phase given a set of parameters.
Definition DeadOilPvt.hpp:131
void setReferenceDensities(unsigned regionIdx, Scalar rhoRefOil, Scalar, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition DeadOilPvt.hpp:68
void initEnd()
Finish initializing the oil phase PVT properties.
Definition DeadOilPvt.cpp:92
Evaluation saturatedViscosity(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the dynamic viscosity [Pa s] of gas saturated oil given a pressure.
Definition DeadOilPvt.hpp:141
Evaluation internalEnergy(unsigned, const Evaluation &, const Evaluation &, const Evaluation &) const
Returns the specific enthalpy [J/kg] of oil given a set of parameters.
Definition DeadOilPvt.hpp:113
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the formation volume factor [-] of saturated oil.
Definition DeadOilPvt.hpp:181
Evaluation saturationPressure(unsigned, const Evaluation &, const Evaluation &) const
Returns the saturation pressure of the oil phase [Pa] depending on its mass fraction of the gas compo...
Definition DeadOilPvt.hpp:213
Evaluation inverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure, const Evaluation &) const
Returns the formation volume factor [-] of the fluid phase.
Definition DeadOilPvt.hpp:155
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition DeadOilPvt.hpp:106
Evaluation saturatedGasDissolutionFactor(unsigned, const Evaluation &, const Evaluation &, const Evaluation &, const Evaluation &) const
Returns the gas dissolution factor [m^3/m^3] of the oil phase.
Definition DeadOilPvt.hpp:199
Definition EclipseState.hpp:62
Definition Schedule.hpp:101
Implements a linearly interpolated scalar function that depends on one variable.
Definition Tabulated1DFunction.hpp:51
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30
Definition Tabulated1DFunction.hpp:41