27#ifndef OPM_DRY_GAS_PVT_HPP
28#define OPM_DRY_GAS_PVT_HPP
48template <
class Scalar>
51 using SamplingPoints = std::vector<std::pair<Scalar, Scalar>>;
67 void setVapPars(
const Scalar,
const Scalar)
79 gasReferenceDensity_[regionIdx] = rhoRefGas;
97 { gasMu_[regionIdx] = mug; }
106 const SamplingPoints& samplePoints);
117 {
return gasReferenceDensity_.size(); }
122 template <
class Evaluation>
127 const Evaluation&)
const
129 throw std::runtime_error(
"Requested the enthalpy of gas but the thermal "
130 "option is not enabled");
133 Scalar hVap(
unsigned)
const
135 throw std::runtime_error(
"Requested the hvap of oil but the thermal "
136 "option is not enabled");
141 template <
class Evaluation>
143 const Evaluation& temperature,
144 const Evaluation& pressure,
146 const Evaluation& )
const
152 template <
class Evaluation>
155 const Evaluation& pressure)
const
157 const Evaluation& invBg = inverseGasB_[regionIdx].eval(pressure,
true);
158 const Evaluation& invMugBg = inverseGasBMu_[regionIdx].eval(pressure,
true);
160 return invBg / invMugBg;
166 template <
class Evaluation>
168 const Evaluation& temperature,
169 const Evaluation& pressure,
171 const Evaluation& )
const
177 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::Scalar>
178 std::pair<LhsEval, LhsEval>
181 const LhsEval& p = decay<LhsEval>(fluidState.pressure(FluidState::gasPhaseIdx));
182 const auto segIdx = this->inverseGasB_[regionIdx].findSegmentIndex(p,
true);
183 const auto& invBg = this->inverseGasB_[regionIdx].eval(p,
SegmentIndex{segIdx});
184 const auto& invMugBg = this->inverseGasBMu_[regionIdx].eval(p,
SegmentIndex{segIdx});
185 return { invBg, invBg / invMugBg };
191 template <
class Evaluation>
194 const Evaluation& pressure)
const
195 {
return inverseGasB_[regionIdx].eval(pressure,
true); }
204 template <
class Evaluation>
207 const Evaluation& )
const
213 template <
class Evaluation>
216 const Evaluation& )
const
222 template <
class Evaluation = Scalar>
226 const Evaluation& )
const
232 template <
class Evaluation>
237 const Evaluation& )
const
243 template <
class Evaluation>
246 const Evaluation& )
const
249 template <
class Evaluation>
250 Evaluation diffusionCoefficient(
const Evaluation& ,
254 throw std::runtime_error(
"Not implemented: The PVT model does not provide "
255 "a diffusionCoefficient()");
258 Scalar gasReferenceDensity(
unsigned regionIdx)
const
259 {
return gasReferenceDensity_[regionIdx]; }
261 const std::vector<TabulatedOneDFunction>& inverseGasB()
const
262 {
return inverseGasB_; }
264 const std::vector<TabulatedOneDFunction>& gasMu()
const
267 const std::vector<TabulatedOneDFunction>& inverseGasBMu()
const
268 {
return inverseGasBMu_; }
271 std::vector<Scalar> gasReferenceDensity_{};
272 std::vector<TabulatedOneDFunction> inverseGasB_{};
273 std::vector<TabulatedOneDFunction> gasMu_{};
274 std::vector<TabulatedOneDFunction> inverseGasBMu_{};
Implements a linearly interpolated scalar function that depends on one variable.
This class represents the Pressure-Volume-Temperature relations of the gas phase without vaporized oi...
Definition DryGasPvt.hpp:50
Evaluation saturatedViscosity(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the dynamic viscosity [Pa s] of oil saturated gas at given pressure.
Definition DryGasPvt.hpp:153
Evaluation saturationPressure(unsigned, const Evaluation &, const Evaluation &) const
Returns the saturation pressure of the gas phase [Pa] depending on its mass fraction of the oil compo...
Definition DryGasPvt.hpp:205
Evaluation internalEnergy(unsigned, const Evaluation &, const Evaluation &, const Evaluation &, const Evaluation &) const
Returns the specific enthalpy [J/kg] of gas given a set of parameters.
Definition DryGasPvt.hpp:123
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition DryGasPvt.hpp:116
void setGasFormationVolumeFactor(unsigned regionIdx, const SamplingPoints &samplePoints)
Initialize the function for the formation volume factor of dry gas.
Definition DryGasPvt.cpp:103
Evaluation inverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &, const Evaluation &) const
Returns the formation volume factor [-] of the fluid phase.
Definition DryGasPvt.hpp:167
Evaluation saturatedWaterVaporizationFactor(unsigned, const Evaluation &, const Evaluation &, const Evaluation &) const
Returns the water vaporization factor [m^3/m^3] of water saturated gas.
Definition DryGasPvt.hpp:223
Evaluation saturatedOilVaporizationFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the oil vaporization factor [m^3/m^3] of the oil phase.
Definition DryGasPvt.hpp:244
Evaluation viscosity(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &, const Evaluation &) const
Returns the dynamic viscosity [Pa s] of the fluid phase given a set of parameters.
Definition DryGasPvt.hpp:142
std::pair< LhsEval, LhsEval > inverseFormationVolumeFactorAndViscosity(const FluidState &fluidState, unsigned regionIdx)
Returns the formation volume factor [-] and viscosity [Pa s] of the fluid phase.
Definition DryGasPvt.hpp:179
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the formation volume factor [-] of oil saturated gas at given pressure.
Definition DryGasPvt.hpp:192
void initEnd()
Finish initializing the oil phase PVT properties.
Definition DryGasPvt.cpp:117
Evaluation saturatedWaterVaporizationFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the water vaporization factor [m^3/m^3] of the water phase.
Definition DryGasPvt.hpp:214
void setMolarMasses(unsigned, Scalar, Scalar, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition DryGasPvt.hpp:85
void setGasViscosity(unsigned regionIdx, const TabulatedOneDFunction &mug)
Initialize the viscosity of the gas phase.
Definition DryGasPvt.hpp:96
void setReferenceDensities(unsigned regionIdx, Scalar, Scalar rhoRefGas, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition DryGasPvt.hpp:74
Evaluation saturatedOilVaporizationFactor(unsigned, const Evaluation &, const Evaluation &, const Evaluation &, const Evaluation &) const
Returns the oil vaporization factor [m^3/m^3] of the oil phase.
Definition DryGasPvt.hpp:233
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