27#ifndef OPM_H2_GAS_PVT_HPP
28#define OPM_H2_GAS_PVT_HPP
48template <
class Scalar>
54 static const bool extrapolate =
true;
62 explicit H2GasPvt(
const std::vector<Scalar>& salinity,
63 Scalar T_ref = 288.71,
64 Scalar P_ref = 101325);
75 void setVapPars(
const Scalar,
const Scalar)
94 { enableVaporization_ = yesno; }
107 {
return gasReferenceDensity_.size(); }
109 Scalar hVap(
unsigned )
const
116 template <
class Evaluation>
118 const Evaluation& temperature,
119 const Evaluation& pressure,
121 const Evaluation& )
const
143 template <
class Evaluation>
145 const Evaluation& temperature,
146 const Evaluation& pressure,
148 const Evaluation& )
const
156 template <
class Evaluation>
158 const Evaluation& temperature,
159 const Evaluation& pressure)
const
167 template <
class Evaluation>
169 const Evaluation& temperature,
170 const Evaluation& pressure,
171 const Evaluation& rv,
172 const Evaluation& rvw)
const
175 if (!enableVaporization_) {
177 gasReferenceDensity_[regionIdx];
181 const auto& rhoH2 =
H2::gasDensity(temperature, pressure, extrapolate);
188 return rhoH2 / (gasReferenceDensity_[regionIdx] +
189 max(rvw,rv) * brineReferenceDensity_[regionIdx]);
195 template <
class Evaluation>
197 const Evaluation& temperature,
198 const Evaluation& pressure)
const
200 const Evaluation rvw = rvwSat_(regionIdx, temperature, pressure,
201 Evaluation(salinity_[regionIdx]));
203 Evaluation(0.0), rvw);
213 template <
class Evaluation>
216 const Evaluation& )
const
222 template <
class Evaluation>
224 const Evaluation& temperature,
225 const Evaluation& pressure)
const
227 return rvwSat_(regionIdx, temperature, pressure, Evaluation(salinity_[regionIdx]));
233 template <
class Evaluation = Scalar>
235 const Evaluation& temperature,
236 const Evaluation& pressure,
237 const Evaluation& saltConcentration)
const
239 const Evaluation salinity = salinityFromConcentration(temperature, pressure,
241 return rvwSat_(regionIdx, temperature, pressure, salinity);
247 template <
class Evaluation>
249 const Evaluation& temperature,
250 const Evaluation& pressure,
252 const Evaluation& )
const
254 return rvwSat_(regionIdx, temperature, pressure, Evaluation(salinity_[regionIdx]));
260 template <
class Evaluation>
262 const Evaluation& temperature,
263 const Evaluation& pressure)
const
265 return rvwSat_(regionIdx, temperature, pressure, Evaluation(salinity_[regionIdx]));
268 template <
class Evaluation>
269 Evaluation diffusionCoefficient(
const Evaluation& temperature,
270 const Evaluation& pressure,
276 Scalar gasReferenceDensity(
unsigned regionIdx)
const
277 {
return gasReferenceDensity_[regionIdx]; }
279 Scalar oilReferenceDensity(
unsigned regionIdx)
const
280 {
return brineReferenceDensity_[regionIdx]; }
282 Scalar waterReferenceDensity(
unsigned regionIdx)
const
283 {
return brineReferenceDensity_[regionIdx]; }
285 Scalar salinity(
unsigned regionIdx)
const
286 {
return salinity_[regionIdx]; }
289 template <
class LhsEval>
290 LhsEval rvwSat_(
unsigned regionIdx,
291 const LhsEval& temperature,
292 const LhsEval& pressure,
293 const LhsEval& salinity)
const
296 if (!enableVaporization_) {
302 LhsEval yH2O = pw_sat / pressure;
305 yH2O = max(0.0, min(1.0, yH2O));
306 return convertXgWToRvw(convertxgWToXgW(yH2O, salinity), regionIdx);
313 template <
class LhsEval>
314 LhsEval convertXgWToRvw(
const LhsEval& XgW,
unsigned regionIdx)
const
316 Scalar rho_wRef = brineReferenceDensity_[regionIdx];
317 Scalar rho_gRef = gasReferenceDensity_[regionIdx];
319 return XgW / (1.0 - XgW) * (rho_gRef / rho_wRef);
326 template <
class LhsEval>
327 LhsEval convertRvwToXgW_(
const LhsEval& Rvw,
unsigned regionIdx)
const
329 Scalar rho_wRef = brineReferenceDensity_[regionIdx];
330 Scalar rho_gRef = gasReferenceDensity_[regionIdx];
332 const LhsEval& rho_wG = Rvw * rho_wRef;
333 return rho_wG / (rho_gRef + rho_wG);
339 template <
class LhsEval>
340 LhsEval convertxgWToXgW(
const LhsEval& xgW,
const LhsEval& salinity)
const
345 return xgW * M_Brine / (xgW * (M_Brine - M_H2) + M_H2);
348 template <
class LhsEval>
349 const LhsEval salinityFromConcentration(
const LhsEval&T,
const LhsEval& P,
350 const LhsEval& saltConcentration)
const
355 std::vector<Scalar> gasReferenceDensity_{};
356 std::vector<Scalar> brineReferenceDensity_{};
357 std::vector<Scalar> salinity_{};
358 bool enableVaporization_ =
true;
A class for the brine fluid properties.
Binary coefficients for brine and H2.
Properties of pure molecular hydrogen .
A simple version of pure water with density from Hu et al.
Binary coefficients for brine and H2.
Definition Brine_H2.hpp:41
static Evaluation gasDiffCoeff(const Evaluation &temperature, const Evaluation &pressure)
Binary diffusion coefficent [m^2/s] for molecular water and H2 as an approximation for brine-H2 diffu...
Definition Brine_H2.hpp:186
A class for the brine fluid properties.
Definition BrineDynamic.hpp:49
static Scalar molarMass()
The molar mass in of the component.
Definition Component.hpp:93
Definition EclipseState.hpp:62
This class represents the Pressure-Volume-Temperature relations of the gas phase for H2.
Definition H2GasPvt.hpp:50
void initEnd()
Finish initializing the oil phase PVT properties.
Definition H2GasPvt.hpp:99
Evaluation saturatedWaterVaporizationFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure) const
Returns the water vaporization factor [m^3/m^3] of the water phase.
Definition H2GasPvt.hpp:223
Evaluation internalEnergy(unsigned, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &, const Evaluation &) const
Returns the specific enthalpy [J/kg] of gas given a set of parameters.
Definition H2GasPvt.hpp:117
Evaluation saturatedOilVaporizationFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure) const
Returns the oil vaporization factor [m^3/m^3] of the oil phase.
Definition H2GasPvt.hpp:261
void setEnableVaporizationWater(bool yesno)
Specify whether the PVT model should consider that the water component can vaporize in the gas phase.
Definition H2GasPvt.hpp:93
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure) const
Returns the formation volume factor [-] of oil saturated gas at given pressure.
Definition H2GasPvt.hpp:196
void setReferenceDensities(unsigned regionIdx, Scalar rhoRefBrine, Scalar rhoRefGas, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition H2GasPvt.cpp:93
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition H2GasPvt.hpp:106
Evaluation saturatedViscosity(unsigned, const Evaluation &temperature, const Evaluation &pressure) const
Returns the dynamic viscosity [Pa s] of oil saturated gas at given pressure.
Definition H2GasPvt.hpp:157
Evaluation saturatedWaterVaporizationFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &saltConcentration) const
Returns the water vaporization factor [m^3/m^3] of water saturated gas.
Definition H2GasPvt.hpp:234
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 H2GasPvt.hpp:214
Evaluation saturatedOilVaporizationFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &, const Evaluation &) const
Returns the oil vaporization factor [m^3/m^3] of the oil phase.
Definition H2GasPvt.hpp:248
Evaluation inverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &rv, const Evaluation &rvw) const
Returns the formation volume factor [-] of the fluid phase.
Definition H2GasPvt.hpp:168
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 H2GasPvt.hpp:144
Properties of pure molecular hydrogen .
Definition H2.hpp:90
static Evaluation gasInternalEnergy(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate=false)
Specific internal energy of H2 [J/kg].
Definition H2.hpp:247
static Evaluation gasViscosity(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate=false)
The dynamic viscosity of at a given pressure and temperature.
Definition H2.hpp:281
static constexpr Scalar molarMass()
The molar mass in of molecular hydrogen.
Definition H2.hpp:109
static Evaluation gasDensity(Evaluation temperature, Evaluation pressure, bool extrapolate=false)
The density of at a given pressure and temperature.
Definition H2.hpp:199
Definition Schedule.hpp:101
A simple version of pure water with density from Hu et al.
Definition SimpleHuDuanH2O.hpp:65
static OPM_HOST_DEVICE Evaluation liquidDensity(const Evaluation &temperature, const Evaluation &pressure, bool extrapolate)
The density of pure water at a given pressure and temperature .
Definition SimpleHuDuanH2O.hpp:313
static OPM_HOST_DEVICE Evaluation vaporPressure(const Evaluation &T)
The vapor pressure in of pure water at a given temperature.
Definition SimpleHuDuanH2O.hpp:142
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition Exceptions.hpp:30