27 #ifndef OPM_DEAD_OIL_PVT_HPP 28 #define OPM_DEAD_OIL_PVT_HPP 44 template <
class Scalar>
57 void setVapPars(
const Scalar,
const Scalar)
69 oilReferenceDensity_[regionIdx] = rhoRefOil;
84 { inverseOilB_[regionIdx] = invBo; }
92 { oilMu_[regionIdx] = muo; }
103 {
return inverseOilBMu_.size(); }
108 template <
class Evaluation>
112 const Evaluation&)
const 114 throw std::runtime_error(
"Requested the enthalpy of oil but the thermal " 115 "option is not enabled");
118 Scalar hVap(
unsigned)
const 120 throw std::runtime_error(
"Requested the hvap of oil but the thermal " 121 "option is not enabled");
126 template <
class Evaluation>
128 const Evaluation& temperature,
129 const Evaluation& pressure,
130 const Evaluation& )
const 136 template <
class Evaluation>
139 const Evaluation& pressure)
const 141 const Evaluation& invBo = inverseOilB_[regionIdx].eval(pressure,
true);
142 const Evaluation& invMuoBo = inverseOilBMu_[regionIdx].eval(pressure,
true);
144 return invBo / invMuoBo;
150 template <
class Evaluation>
153 const Evaluation& pressure,
154 const Evaluation& )
const 155 {
return inverseOilB_[regionIdx].eval(pressure,
true); }
160 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::ValueType>
161 std::pair<LhsEval, LhsEval>
164 const LhsEval& p = decay<LhsEval>(fluidState.pressure(FluidState::oilPhaseIdx));
165 const auto segIdx = this->inverseOilB_[regionIdx].findSegmentIndex(p,
true);
166 const auto& invBo = this->inverseOilB_[regionIdx].eval(p,
SegmentIndex{segIdx});
167 const auto& invMuoBo = this->inverseOilBMu_[regionIdx].eval(p,
SegmentIndex{segIdx});
168 return { invBo, invBo / invMuoBo };
176 template <
class Evaluation>
179 const Evaluation& pressure)
const 180 {
return inverseOilB_[regionIdx].eval(pressure,
true); }
185 template <
class Evaluation>
188 const Evaluation& )
const 194 template <
class Evaluation>
199 const Evaluation& )
const 208 template <
class Evaluation>
211 const Evaluation& )
const 214 template <
class Evaluation>
215 Evaluation saturatedGasMassFraction(
unsigned ,
217 const Evaluation& )
const 220 template <
class Evaluation>
221 Evaluation saturatedGasMoleFraction(
unsigned ,
223 const Evaluation& )
const 226 template <
class Evaluation>
227 Evaluation diffusionCoefficient(
const Evaluation& ,
231 throw std::runtime_error(
"Not implemented: The PVT model does not provide " 232 "a diffusionCoefficient()");
235 Scalar oilReferenceDensity(
unsigned regionIdx)
const 236 {
return oilReferenceDensity_[regionIdx]; }
238 const std::vector<TabulatedOneDFunction>& inverseOilB()
const 239 {
return inverseOilB_; }
241 const std::vector<TabulatedOneDFunction>& oilMu()
const 244 const std::vector<TabulatedOneDFunction>& inverseOilBMu()
const 245 {
return inverseOilBMu_; }
248 std::vector<Scalar> oilReferenceDensity_{};
249 std::vector<TabulatedOneDFunction> inverseOilB_{};
250 std::vector<TabulatedOneDFunction> oilMu_{};
251 std::vector<TabulatedOneDFunction> inverseOilBMu_{};
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the formation volume factor [-] of saturated oil.
Definition: DeadOilPvt.hpp:177
This class represents the Pressure-Volume-Temperature relations of the oil phase without dissolved ga...
Definition: DeadOilPvt.hpp:45
void setOilViscosity(unsigned regionIdx, const TabulatedOneDFunction &muo)
Initialize the viscosity of the oil phase.
Definition: DeadOilPvt.hpp:91
Definition: Schedule.hpp:100
void initEnd()
Finish initializing the oil phase PVT properties.
Definition: DeadOilPvt.cpp:88
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
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:195
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition: DeadOilPvt.hpp:102
Definition: EclipseState.hpp:66
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:109
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:137
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:209
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:162
void setReferenceDensities(unsigned regionIdx, Scalar rhoRefOil, Scalar, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition: DeadOilPvt.hpp:64
Evaluation saturatedGasDissolutionFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the gas dissolution factor [m^3/m^3] of the oil phase.
Definition: DeadOilPvt.hpp:186
Evaluation inverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure, const Evaluation &) const
Returns the formation volume factor [-] of the fluid phase.
Definition: DeadOilPvt.hpp:151
Implements a linearly interpolated scalar function that depends on one variable.
Implements a linearly interpolated scalar function that depends on one variable.
Definition: Tabulated1DFunction.hpp:50
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:127
void initFromState(const EclipseState &eclState, const Schedule &)
Initialize the oil parameters via the data specified by the PVDO ECL keyword.
Definition: DeadOilPvt.cpp:39
Definition: Tabulated1DFunction.hpp:41
void setInverseOilFormationVolumeFactor(unsigned regionIdx, const TabulatedOneDFunction &invBo)
Initialize the function for the oil formation volume factor.
Definition: DeadOilPvt.hpp:82