27 #ifndef OPM_DRY_GAS_PVT_HPP 28 #define OPM_DRY_GAS_PVT_HPP 46 template <
class Scalar>
49 using SamplingPoints = std::vector<std::pair<Scalar, Scalar>>;
63 void setVapPars(
const Scalar,
const Scalar)
75 gasReferenceDensity_[regionIdx] = rhoRefGas;
93 { gasMu_[regionIdx] = mug; }
102 const SamplingPoints& samplePoints);
113 {
return gasReferenceDensity_.size(); }
118 template <
class Evaluation>
123 const Evaluation&)
const 125 throw std::runtime_error(
"Requested the enthalpy of gas but the thermal " 126 "option is not enabled");
129 Scalar hVap(
unsigned)
const 131 throw std::runtime_error(
"Requested the hvap of oil but the thermal " 132 "option is not enabled");
137 template <
class Evaluation>
139 const Evaluation& temperature,
140 const Evaluation& pressure,
142 const Evaluation& )
const 148 template <
class Evaluation>
151 const Evaluation& pressure)
const 153 const Evaluation& invBg = inverseGasB_[regionIdx].eval(pressure,
true);
154 const Evaluation& invMugBg = inverseGasBMu_[regionIdx].eval(pressure,
true);
156 return invBg / invMugBg;
162 template <
class Evaluation>
164 const Evaluation& temperature,
165 const Evaluation& pressure,
167 const Evaluation& )
const 173 template <
class Flu
idState,
class LhsEval =
typename Flu
idState::ValueType>
174 std::pair<LhsEval, LhsEval>
177 const LhsEval& p = decay<LhsEval>(fluidState.pressure(FluidState::gasPhaseIdx));
178 const auto segIdx = this->inverseGasB_[regionIdx].findSegmentIndex(p,
true);
179 const auto& invBg = this->inverseGasB_[regionIdx].eval(p,
SegmentIndex{segIdx});
180 const auto& invMugBg = this->inverseGasBMu_[regionIdx].eval(p,
SegmentIndex{segIdx});
181 return { invBg, invBg / invMugBg };
187 template <
class Evaluation>
190 const Evaluation& pressure)
const 191 {
return inverseGasB_[regionIdx].eval(pressure,
true); }
200 template <
class Evaluation>
203 const Evaluation& )
const 209 template <
class Evaluation>
212 const Evaluation& )
const 218 template <
class Evaluation = Scalar>
222 const Evaluation& )
const 228 template <
class Evaluation>
233 const Evaluation& )
const 239 template <
class Evaluation>
242 const Evaluation& )
const 245 template <
class Evaluation>
246 Evaluation diffusionCoefficient(
const Evaluation& ,
250 throw std::runtime_error(
"Not implemented: The PVT model does not provide " 251 "a diffusionCoefficient()");
254 Scalar gasReferenceDensity(
unsigned regionIdx)
const 255 {
return gasReferenceDensity_[regionIdx]; }
257 const std::vector<TabulatedOneDFunction>& inverseGasB()
const 258 {
return inverseGasB_; }
260 const std::vector<TabulatedOneDFunction>& gasMu()
const 263 const std::vector<TabulatedOneDFunction>& inverseGasBMu()
const 264 {
return inverseGasBMu_; }
267 std::vector<Scalar> gasReferenceDensity_{};
268 std::vector<TabulatedOneDFunction> inverseGasB_{};
269 std::vector<TabulatedOneDFunction> gasMu_{};
270 std::vector<TabulatedOneDFunction> inverseGasBMu_{};
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:149
void initEnd()
Finish initializing the oil phase PVT properties.
Definition: DryGasPvt.cpp:113
void setGasFormationVolumeFactor(unsigned regionIdx, const SamplingPoints &samplePoints)
Initialize the function for the formation volume factor of dry gas.
Definition: DryGasPvt.cpp:99
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:119
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:175
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition: DryGasPvt.hpp:112
Definition: Schedule.hpp:100
void setMolarMasses(unsigned, Scalar, Scalar, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition: DryGasPvt.hpp:81
Evaluation saturatedOilVaporizationFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the oil vaporization factor [m^3/m^3] of the oil phase.
Definition: DryGasPvt.hpp:240
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:30
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:188
Definition: EclipseState.hpp:66
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:163
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:219
void setReferenceDensities(unsigned regionIdx, Scalar, Scalar rhoRefGas, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition: DryGasPvt.hpp:70
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:201
Implements a linearly interpolated scalar function that depends on one variable.
void initFromState(const EclipseState &eclState, const Schedule &)
Initialize the parameters for dry gas using an ECL deck.
Definition: DryGasPvt.cpp:39
This class represents the Pressure-Volume-Temperature relations of the gas phase without vaporized oi...
Definition: DryGasPvt.hpp:47
Evaluation saturatedWaterVaporizationFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the water vaporization factor [m^3/m^3] of the water phase.
Definition: DryGasPvt.hpp:210
Implements a linearly interpolated scalar function that depends on one variable.
Definition: Tabulated1DFunction.hpp:50
Definition: Tabulated1DFunction.hpp:41
void setGasViscosity(unsigned regionIdx, const TabulatedOneDFunction &mug)
Initialize the viscosity of the gas phase.
Definition: DryGasPvt.hpp:92
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:138
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:229