27#ifndef OPM_CONSTANT_RS_DEAD_OIL_PVT_HPP
28#define OPM_CONSTANT_RS_DEAD_OIL_PVT_HPP
50template <
class Scalar>
64 void setVapPars(
const Scalar,
const Scalar)
77 oilReferenceDensity_[regionIdx] = rhoRefOil;
78 gasReferenceDensity_[regionIdx] = rhoRefGas;
85 { constantRs_ = rsConst; }
91 { bubblePointPressure_ = pbub; }
97 const TabulatedOneDFunction& invBo)
98 { inverseOilB_[regionIdx] = invBo; }
104 { oilMu_[regionIdx] = muo; }
115 {
return inverseOilBMu_.size(); }
120 template <
class Evaluation>
124 const Evaluation&)
const
126 throw std::runtime_error(
"Requested the enthalpy of oil but the thermal "
127 "option is not enabled");
130 Scalar hVap(
unsigned)
const
132 throw std::runtime_error(
"Requested the hvap of oil but the thermal "
133 "option is not enabled");
140 template <
class Evaluation>
142 const Evaluation& temperature,
143 const Evaluation& pressure,
144 const Evaluation& )
const
151 template <
class Evaluation>
154 const Evaluation& pressure)
const
156 const Evaluation& invBo = inverseOilB_[regionIdx].eval(pressure,
true);
157 const Evaluation& invMuoBo = inverseOilBMu_[regionIdx].eval(pressure,
true);
158 return invBo / invMuoBo;
165 template <
class Evaluation>
168 const Evaluation& pressure,
169 const Evaluation& )
const
170 {
return inverseOilB_[regionIdx].eval(pressure,
true); }
175 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::ValueType>
176 std::pair<LhsEval, LhsEval>
179 const LhsEval& p = decay<LhsEval>(fluidState.pressure(FluidState::oilPhaseIdx));
180 const auto segIdx = this->inverseOilB_[regionIdx].findSegmentIndex(p,
true);
181 const auto& invBo = this->inverseOilB_[regionIdx].eval(p,
SegmentIndex{segIdx});
182 const auto& invMuoBo = this->inverseOilBMu_[regionIdx].eval(p,
SegmentIndex{segIdx});
183 return { invBo, invBo / invMuoBo };
190 template <
class Evaluation>
193 const Evaluation& pressure)
const
194 {
return inverseOilB_[regionIdx].eval(pressure,
true); }
201 template <
class Evaluation>
204 const Evaluation& pressure)
const
208 if (pressure < bubblePointPressure_) {
210 "Pressure is below RSCONST bubble point pressure of " +
211 std::to_string(bubblePointPressure_)
222 template <
class Evaluation>
225 const Evaluation& pressure,
227 const Evaluation& )
const
231 if (pressure < bubblePointPressure_) {
233 "Pressure is below RSCONST bubble point pressure of " +
234 std::to_string(bubblePointPressure_)
244 template <
class Evaluation>
247 const Evaluation& )
const
248 {
return bubblePointPressure_; }
250 template <
class Evaluation>
251 Evaluation diffusionCoefficient(
const Evaluation& ,
255 throw std::runtime_error(
"Not implemented: The PVT model does not provide "
256 "a diffusionCoefficient()");
259 Scalar oilReferenceDensity(
unsigned regionIdx)
const
260 {
return oilReferenceDensity_[regionIdx]; }
262 Scalar gasReferenceDensity(
unsigned regionIdx)
const
263 {
return gasReferenceDensity_[regionIdx]; }
265 Scalar constantRs()
const
266 {
return constantRs_; }
268 Scalar bubblePointPressure()
const
269 {
return bubblePointPressure_; }
271 const std::vector<TabulatedOneDFunction>& inverseOilB()
const
272 {
return inverseOilB_; }
274 const std::vector<TabulatedOneDFunction>& oilMu()
const
277 const std::vector<TabulatedOneDFunction>& inverseOilBMu()
const
278 {
return inverseOilBMu_; }
282 std::vector<Scalar> oilReferenceDensity_{};
283 std::vector<Scalar> gasReferenceDensity_{};
284 std::vector<TabulatedOneDFunction> inverseOilB_{};
285 std::vector<TabulatedOneDFunction> oilMu_{};
286 std::vector<TabulatedOneDFunction> inverseOilBMu_{};
289 Scalar constantRs_ = 0.0;
290 Scalar bubblePointPressure_ = 0.0;
Provides the OPM specific exception classes.
Implements a linearly interpolated scalar function that depends on one variable.
This class represents the Pressure-Volume-Temperature relations of dead oil with constant dissolved g...
Definition ConstantRsDeadOilPvt.hpp:52
void setInverseOilFormationVolumeFactor(unsigned regionIdx, const TabulatedOneDFunction &invBo)
Initialize the function for the oil formation volume factor.
Definition ConstantRsDeadOilPvt.hpp:96
void initFromState(const EclipseState &eclState, const Schedule &schedule)
Initialize the oil parameters via the data specified by the PVDO ECL keyword with additional constant...
Definition ConstantRsDeadOilPvt.cpp:41
void setOilViscosity(unsigned regionIdx, const TabulatedOneDFunction &muo)
Initialize the viscosity of the oil phase.
Definition ConstantRsDeadOilPvt.hpp:103
Evaluation saturationPressure(unsigned, const Evaluation &, const Evaluation &) const
Returns the bubble point pressure [Pa] from RSCONST.
Definition ConstantRsDeadOilPvt.hpp:245
Evaluation saturatedGasDissolutionFactor(unsigned, const Evaluation &, const Evaluation &pressure, const Evaluation &, const Evaluation &) const
Returns the constant gas dissolution factor [m^3/m^3] of the oil phase.
Definition ConstantRsDeadOilPvt.hpp:223
void setConstantRs(Scalar rsConst)
Set the constant Rs value (global for all regions).
Definition ConstantRsDeadOilPvt.hpp:84
void setReferenceDensities(unsigned regionIdx, Scalar rhoRefOil, Scalar rhoRefGas, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition ConstantRsDeadOilPvt.hpp:72
void initEnd()
Finish initializing the oil phase PVT properties.
Definition ConstantRsDeadOilPvt.cpp:113
std::pair< LhsEval, LhsEval > inverseFormationVolumeFactorAndViscosity(const FluidState &fluidState, unsigned regionIdx)
Returns the formation volume factor [-] and viscosity [Pa s] of the fluid phase.
Definition ConstantRsDeadOilPvt.hpp:177
Evaluation saturatedGasDissolutionFactor(unsigned, const Evaluation &, const Evaluation &pressure) const
Returns the constant gas dissolution factor [m^3/m^3] of the oil phase.
Definition ConstantRsDeadOilPvt.hpp:202
Evaluation saturatedViscosity(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the dynamic viscosity [Pa s] of oil given a pressure.
Definition ConstantRsDeadOilPvt.hpp:152
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the formation volume factor [-] of oil.
Definition ConstantRsDeadOilPvt.hpp:191
Evaluation internalEnergy(unsigned, const Evaluation &, const Evaluation &, const Evaluation &) const
Returns the specific enthalpy [J/kg] of oil given a set of parameters.
Definition ConstantRsDeadOilPvt.hpp:121
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 ConstantRsDeadOilPvt.hpp:141
void setBubblePointPressure(Scalar pbub)
Set the bubble point pressure (global for all regions).
Definition ConstantRsDeadOilPvt.hpp:90
Evaluation inverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure, const Evaluation &) const
Returns the formation volume factor [-] of the fluid phase.
Definition ConstantRsDeadOilPvt.hpp:166
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition ConstantRsDeadOilPvt.hpp:114
Definition EclipseState.hpp:66
Definition Exceptions.hpp:40
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