My Project
GasPvtThermal.hpp
Go to the documentation of this file.
1 // -*- mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
2 // vi: set et ts=4 sw=4 sts=4:
3 /*
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 2 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 
19  Consult the COPYING file in the top-level source directory of this
20  module for the precise wording of the license and the list of
21  copyright holders.
22 */
27 #ifndef OPM_GAS_PVT_THERMAL_HPP
28 #define OPM_GAS_PVT_THERMAL_HPP
29 
31 
32 #if HAVE_ECL_INPUT
33 #include <opm/input/eclipse/EclipseState/EclipseState.hpp>
34 #include <opm/input/eclipse/EclipseState/Tables/SimpleTable.hpp>
35 #include <opm/input/eclipse/EclipseState/Tables/TableManager.hpp>
36 #endif
37 
38 namespace Opm {
39 template <class Scalar, bool enableThermal>
40 class GasPvtMultiplexer;
41 
48 template <class Scalar>
50 {
51 public:
52  using IsothermalPvt = GasPvtMultiplexer<Scalar, /*enableThermal=*/false>;
54 
56  {
57  enableThermalDensity_ = false;
58  enableJouleThomson_ = false;
59  enableThermalViscosity_ = false;
60  isothermalPvt_ = nullptr;
61  }
62 
63  GasPvtThermal(IsothermalPvt* isothermalPvt,
64  const std::vector<TabulatedOneDFunction>& gasvisctCurves,
65  const std::vector<Scalar>& gasdentRefTemp,
66  const std::vector<Scalar>& gasdentCT1,
67  const std::vector<Scalar>& gasdentCT2,
68  const std::vector<Scalar>& gasJTRefPres,
69  const std::vector<Scalar>& gasJTC,
70  const std::vector<TabulatedOneDFunction>& internalEnergyCurves,
72  bool enableJouleThomson,
74  bool enableInternalEnergy)
75  : isothermalPvt_(isothermalPvt)
76  , gasvisctCurves_(gasvisctCurves)
77  , gasdentRefTemp_(gasdentRefTemp)
78  , gasdentCT1_(gasdentCT1)
79  , gasdentCT2_(gasdentCT2)
80  , gasJTRefPres_(gasJTRefPres)
81  , gasJTC_(gasJTC)
82  , internalEnergyCurves_(internalEnergyCurves)
83  , enableThermalDensity_(enableThermalDensity)
84  , enableJouleThomson_(enableJouleThomson)
85  , enableThermalViscosity_(enableThermalViscosity)
86  , enableInternalEnergy_(enableInternalEnergy)
87  { }
88 
89  GasPvtThermal(const GasPvtThermal& data)
90  { *this = data; }
91 
92  ~GasPvtThermal()
93  { delete isothermalPvt_; }
94 
95 #if HAVE_ECL_INPUT
99  void initFromState(const EclipseState& eclState, const Schedule& schedule)
100  {
102  // initialize the isothermal part
104  isothermalPvt_ = new IsothermalPvt;
105  isothermalPvt_->initFromState(eclState, schedule);
106 
108  // initialize the thermal part
110  const auto& tables = eclState.getTableManager();
111 
112  enableThermalDensity_ = tables.GasDenT().size() > 0;
113  enableJouleThomson_ = tables.GasJT().size() > 0;
114  enableThermalViscosity_ = tables.hasTables("GASVISCT");
115  enableInternalEnergy_ = tables.hasTables("SPECHEAT");
116 
117  unsigned numRegions = isothermalPvt_->numRegions();
118  setNumRegions(numRegions);
119 
120  // viscosity
121  if (enableThermalViscosity_) {
122  const auto& gasvisctTables = tables.getGasvisctTables();
123  auto gasCompIdx = tables.gas_comp_index();
124  std::string gasvisctColumnName = "Viscosity" + std::to_string(static_cast<long long>(gasCompIdx));
125 
126  for (unsigned regionIdx = 0; regionIdx < numRegions; ++regionIdx) {
127  const auto& T = gasvisctTables[regionIdx].getColumn("Temperature").vectorCopy();
128  const auto& mu = gasvisctTables[regionIdx].getColumn(gasvisctColumnName).vectorCopy();
129  gasvisctCurves_[regionIdx].setXYContainers(T, mu);
130  }
131  }
132 
133  // temperature dependence of gas density
134  if (enableThermalDensity_) {
135  const auto& gasDenT = tables.GasDenT();
136 
137  assert(gasDenT.size() == numRegions);
138  for (unsigned regionIdx = 0; regionIdx < numRegions; ++regionIdx) {
139  const auto& record = gasDenT[regionIdx];
140 
141  gasdentRefTemp_[regionIdx] = record.T0;
142  gasdentCT1_[regionIdx] = record.C1;
143  gasdentCT2_[regionIdx] = record.C2;
144  }
145  }
146 
147  // Joule Thomson
148  if (enableJouleThomson_) {
149  const auto& gasJT = tables.GasJT();
150 
151  assert(gasJT.size() == numRegions);
152  for (unsigned regionIdx = 0; regionIdx < numRegions; ++regionIdx) {
153  const auto& record = gasJT[regionIdx];
154 
155  gasJTRefPres_[regionIdx] = record.P0;
156  gasJTC_[regionIdx] = record.C1;
157  }
158 
159  const auto& densityTable = eclState.getTableManager().getDensityTable();
160 
161  assert(densityTable.size() == numRegions);
162  for (unsigned regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
163  rhoRefO_[regionIdx] = densityTable[regionIdx].oil;
164  }
165  }
166 
167  if (enableInternalEnergy_) {
168  // the specific internal energy of gas. be aware that ecl only specifies the heat capacity
169  // (via the SPECHEAT keyword) and we need to integrate it ourselfs to get the
170  // internal energy
171  for (unsigned regionIdx = 0; regionIdx < numRegions; ++regionIdx) {
172  const auto& specHeatTable = tables.getSpecheatTables()[regionIdx];
173  const auto& temperatureColumn = specHeatTable.getColumn("TEMPERATURE");
174  const auto& cvGasColumn = specHeatTable.getColumn("CV_GAS");
175 
176  std::vector<double> uSamples(temperatureColumn.size());
177 
178  // the specific enthalpy of vaporization. since ECL does not seem to
179  // feature a proper way to specify this quantity, we use the value for
180  // methane. A proper model would also need to consider the enthalpy
181  // change due to dissolution, i.e. the enthalpies of the gas and oil
182  // phases should depend on the phase composition
183  const Scalar hVap = 480.6e3; // [J / kg]
184 
185  Scalar u = temperatureColumn[0]*cvGasColumn[0] + hVap;
186  for (size_t i = 0;; ++i) {
187  uSamples[i] = u;
188 
189  if (i >= temperatureColumn.size() - 1)
190  break;
191 
192  // integrate to the heat capacity from the current sampling point to the next
193  // one. this leads to a quadratic polynomial.
194  Scalar c_v0 = cvGasColumn[i];
195  Scalar c_v1 = cvGasColumn[i + 1];
196  Scalar T0 = temperatureColumn[i];
197  Scalar T1 = temperatureColumn[i + 1];
198  u += 0.5*(c_v0 + c_v1)*(T1 - T0);
199  }
200 
201  internalEnergyCurves_[regionIdx].setXYContainers(temperatureColumn.vectorCopy(), uSamples);
202  }
203  }
204  }
205 #endif // HAVE_ECL_INPUT
206 
210  void setNumRegions(size_t numRegions)
211  {
212  gasvisctCurves_.resize(numRegions);
213  internalEnergyCurves_.resize(numRegions);
214  gasdentRefTemp_.resize(numRegions);
215  gasdentCT1_.resize(numRegions);
216  gasdentCT2_.resize(numRegions);
217  gasJTRefPres_.resize(numRegions);
218  gasJTC_.resize(numRegions);
219  rhoRefO_.resize(numRegions);
220  }
221 
225  void initEnd()
226  { }
227 
228  size_t numRegions() const
229  { return gasvisctCurves_.size(); }
230 
234  bool enableThermalDensity() const
235  { return enableThermalDensity_; }
236 
240  bool enableJouleThomsony() const
241  { return enableJouleThomson_; }
242 
247  { return enableThermalViscosity_; }
248 
252  template <class Evaluation>
253  Evaluation internalEnergy(unsigned regionIdx,
254  const Evaluation& temperature,
255  const Evaluation& pressure,
256  const Evaluation& Rv) const
257  {
258  if (!enableInternalEnergy_)
259  throw std::runtime_error("Requested the internal energy of gas but it is disabled");
260 
261  if (!enableJouleThomson_) {
262  // compute the specific internal energy for the specified tempature. We use linear
263  // interpolation here despite the fact that the underlying heat capacities are
264  // piecewise linear (which leads to a quadratic function)
265  return internalEnergyCurves_[regionIdx].eval(temperature, /*extrapolate=*/true);
266  }
267  else {
268  Evaluation Tref = gasdentRefTemp_[regionIdx];
269  Evaluation Pref = gasJTRefPres_[regionIdx];
270  Scalar JTC = gasJTC_[regionIdx]; // if JTC is default then JTC is calculated
271  Evaluation Rvw = 0.0;
272 
273  Evaluation invB = inverseFormationVolumeFactor(regionIdx, temperature, pressure, Rv, Rvw);
274  constexpr const Scalar hVap = 480.6e3; // [J / kg]
275  Evaluation Cp = (internalEnergyCurves_[regionIdx].eval(temperature, /*extrapolate=*/true) - hVap)/temperature;
276  Evaluation density = invB * (gasReferenceDensity(regionIdx) + Rv * rhoRefO_[regionIdx]);
277 
278  Evaluation enthalpyPres;
279  if (JTC != 0) {
280  enthalpyPres = -Cp * JTC * (pressure -Pref);
281  }
282  else if(enableThermalDensity_) {
283  Scalar c1T = gasdentCT1_[regionIdx];
284  Scalar c2T = gasdentCT2_[regionIdx];
285 
286  Evaluation alpha = (c1T + 2 * c2T * (temperature - Tref)) /
287  (1 + c1T *(temperature - Tref) + c2T * (temperature - Tref) * (temperature - Tref));
288 
289  constexpr const int N = 100; // value is experimental
290  Evaluation deltaP = (pressure - Pref)/N;
291  Evaluation enthalpyPresPrev = 0;
292  for (size_t i = 0; i < N; ++i) {
293  Evaluation Pnew = Pref + i * deltaP;
294  Evaluation rho = inverseFormationVolumeFactor(regionIdx, temperature, Pnew, Rv, Rvw) *
295  (gasReferenceDensity(regionIdx) + Rv * rhoRefO_[regionIdx]);
296  // see e.g.https://en.wikipedia.org/wiki/Joule-Thomson_effect for a derivation of the Joule-Thomson coeff.
297  Evaluation jouleThomsonCoefficient = -(1.0/Cp) * (1.0 - alpha * temperature)/rho;
298  Evaluation deltaEnthalpyPres = -Cp * jouleThomsonCoefficient * deltaP;
299  enthalpyPres = enthalpyPresPrev + deltaEnthalpyPres;
300  enthalpyPresPrev = enthalpyPres;
301  }
302  }
303  else {
304  throw std::runtime_error("Requested Joule-thomson calculation but thermal gas density (GASDENT) is not provided");
305  }
306 
307  Evaluation enthalpy = Cp * (temperature - Tref) + enthalpyPres;
308 
309  return enthalpy - pressure/density;
310  }
311  }
312 
316  template <class Evaluation>
317  Evaluation viscosity(unsigned regionIdx,
318  const Evaluation& temperature,
319  const Evaluation& pressure,
320  const Evaluation& Rv,
321  const Evaluation& Rvw) const
322  {
323  if (!enableThermalViscosity())
324  return isothermalPvt_->viscosity(regionIdx, temperature, pressure, Rv, Rvw);
325 
326  // compute the viscosity deviation due to temperature
327  const auto& muGasvisct = gasvisctCurves_[regionIdx].eval(temperature);
328  return muGasvisct;
329  }
330 
334  template <class Evaluation>
335  Evaluation saturatedViscosity(unsigned regionIdx,
336  const Evaluation& temperature,
337  const Evaluation& pressure) const
338  {
339  if (!enableThermalViscosity())
340  return isothermalPvt_->saturatedViscosity(regionIdx, temperature, pressure);
341 
342  // compute the viscosity deviation due to temperature
343  const auto& muGasvisct = gasvisctCurves_[regionIdx].eval(temperature, true);
344  return muGasvisct;
345  }
346 
350  template <class Evaluation>
351  Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
352  const Evaluation& temperature,
353  const Evaluation& pressure,
354  const Evaluation& Rv,
355  const Evaluation& /*Rvw*/) const
356  {
357  const Evaluation& Rvw = 0.0;
358  const auto& b =
359  isothermalPvt_->inverseFormationVolumeFactor(regionIdx, temperature, pressure, Rv, Rvw);
360 
361  if (!enableThermalDensity())
362  return b;
363 
364  // we use the same approach as for the for water here, but with the OPM-specific
365  // GASDENT keyword.
366  //
367  // TODO: Since gas is quite a bit more compressible than water, it might be
368  // necessary to make GASDENT to a table keyword. If the current temperature
369  // is relatively close to the reference temperature, the current approach
370  // should be good enough, though.
371  Scalar TRef = gasdentRefTemp_[regionIdx];
372  Scalar cT1 = gasdentCT1_[regionIdx];
373  Scalar cT2 = gasdentCT2_[regionIdx];
374  const Evaluation& Y = temperature - TRef;
375 
376  return b/(1 + (cT1 + cT2*Y)*Y);
377  }
378 
382  template <class Evaluation>
383  Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
384  const Evaluation& temperature,
385  const Evaluation& pressure) const
386  {
387  const auto& b =
388  isothermalPvt_->saturatedInverseFormationVolumeFactor(regionIdx, temperature, pressure);
389 
390  if (!enableThermalDensity())
391  return b;
392 
393  // we use the same approach as for the for water here, but with the OPM-specific
394  // GASDENT keyword.
395  //
396  // TODO: Since gas is quite a bit more compressible than water, it might be
397  // necessary to make GASDENT to a table keyword. If the current temperature
398  // is relatively close to the reference temperature, the current approach
399  // should be good enough, though.
400  Scalar TRef = gasdentRefTemp_[regionIdx];
401  Scalar cT1 = gasdentCT1_[regionIdx];
402  Scalar cT2 = gasdentCT2_[regionIdx];
403  const Evaluation& Y = temperature - TRef;
404 
405  return b/(1 + (cT1 + cT2*Y)*Y);
406  }
407 
411  template <class Evaluation>
412  Evaluation saturatedWaterVaporizationFactor(unsigned /*regionIdx*/,
413  const Evaluation& /*temperature*/,
414  const Evaluation& /*pressure*/) const
415  { return 0.0; }
416 
417 
425  template <class Evaluation>
426  Evaluation saturatedOilVaporizationFactor(unsigned regionIdx,
427  const Evaluation& temperature,
428  const Evaluation& pressure) const
429  { return isothermalPvt_->saturatedOilVaporizationFactor(regionIdx, temperature, pressure); }
430 
438  template <class Evaluation>
439  Evaluation saturatedOilVaporizationFactor(unsigned regionIdx,
440  const Evaluation& temperature,
441  const Evaluation& pressure,
442  const Evaluation& oilSaturation,
443  const Evaluation& maxOilSaturation) const
444  { return isothermalPvt_->saturatedOilVaporizationFactor(regionIdx, temperature, pressure, oilSaturation, maxOilSaturation); }
445 
453  template <class Evaluation>
454  Evaluation saturationPressure(unsigned regionIdx,
455  const Evaluation& temperature,
456  const Evaluation& pressure) const
457  { return isothermalPvt_->saturationPressure(regionIdx, temperature, pressure); }
458 
459  template <class Evaluation>
460  Evaluation diffusionCoefficient(const Evaluation& temperature,
461  const Evaluation& pressure,
462  unsigned compIdx) const
463  {
464  return isothermalPvt_->diffusionCoefficient(temperature, pressure, compIdx);
465  }
466  const IsothermalPvt* isoThermalPvt() const
467  { return isothermalPvt_; }
468 
469  const Scalar gasReferenceDensity(unsigned regionIdx) const
470  { return isothermalPvt_->gasReferenceDensity(regionIdx); }
471 
472  const std::vector<TabulatedOneDFunction>& gasvisctCurves() const
473  { return gasvisctCurves_; }
474 
475  const std::vector<Scalar>& gasdentRefTemp() const
476  { return gasdentRefTemp_; }
477 
478  const std::vector<Scalar>& gasdentCT1() const
479  { return gasdentCT1_; }
480 
481  const std::vector<Scalar>& gasdentCT2() const
482  { return gasdentCT2_; }
483 
484  const std::vector<TabulatedOneDFunction>& internalEnergyCurves() const
485  { return internalEnergyCurves_; }
486 
487  bool enableInternalEnergy() const
488  { return enableInternalEnergy_; }
489 
490  const std::vector<Scalar>& gasJTRefPres() const
491  { return gasJTRefPres_; }
492 
493  const std::vector<Scalar>& gasJTC() const
494  { return gasJTC_; }
495 
496 
497  bool operator==(const GasPvtThermal<Scalar>& data) const
498  {
499  if (isothermalPvt_ && !data.isothermalPvt_)
500  return false;
501  if (!isothermalPvt_ && data.isothermalPvt_)
502  return false;
503 
504  return (!this->isoThermalPvt() ||
505  (*this->isoThermalPvt() == *data.isoThermalPvt())) &&
506  this->gasvisctCurves() == data.gasvisctCurves() &&
507  this->gasdentRefTemp() == data.gasdentRefTemp() &&
508  this->gasdentCT1() == data.gasdentCT1() &&
509  this->gasdentCT2() == data.gasdentCT2() &&
510  this->gasJTRefPres() == data.gasJTRefPres() &&
511  this->gasJTC() == data.gasJTC() &&
512  this->internalEnergyCurves() == data.internalEnergyCurves() &&
513  this->enableThermalDensity() == data.enableThermalDensity() &&
514  this->enableJouleThomson() == data.enableJouleThomson() &&
515  this->enableThermalViscosity() == data.enableThermalViscosity() &&
516  this->enableInternalEnergy() == data.enableInternalEnergy();
517  }
518 
519  GasPvtThermal<Scalar>& operator=(const GasPvtThermal<Scalar>& data)
520  {
521  if (data.isothermalPvt_)
522  isothermalPvt_ = new IsothermalPvt(*data.isothermalPvt_);
523  else
524  isothermalPvt_ = nullptr;
525  gasvisctCurves_ = data.gasvisctCurves_;
526  gasdentRefTemp_ = data.gasdentRefTemp_;
527  gasdentCT1_ = data.gasdentCT1_;
528  gasdentCT2_ = data.gasdentCT2_;
529  gasJTRefPres_ = data.gasJTRefPres_;
530  gasJTC_ = data.gasJTC_;
531  internalEnergyCurves_ = data.internalEnergyCurves_;
532  enableThermalDensity_ = data.enableThermalDensity_;
533  enableJouleThomson_ = data.enableJouleThomson_;
534  enableThermalViscosity_ = data.enableThermalViscosity_;
535  enableInternalEnergy_ = data.enableInternalEnergy_;
536 
537  return *this;
538  }
539 
540 private:
541  IsothermalPvt* isothermalPvt_;
542 
543  // The PVT properties needed for temperature dependence of the viscosity. We need
544  // to store one value per PVT region.
545  std::vector<TabulatedOneDFunction> gasvisctCurves_;
546 
547  std::vector<Scalar> gasdentRefTemp_;
548  std::vector<Scalar> gasdentCT1_;
549  std::vector<Scalar> gasdentCT2_;
550 
551  std::vector<Scalar> gasJTRefPres_;
552  std::vector<Scalar> gasJTC_;
553 
554  std::vector<Scalar> rhoRefO_;
555 
556  // piecewise linear curve representing the internal energy of gas
557  std::vector<TabulatedOneDFunction> internalEnergyCurves_;
558 
559  bool enableThermalDensity_;
560  bool enableJouleThomson_;
561  bool enableThermalViscosity_;
562  bool enableInternalEnergy_;
563 };
564 
565 } // namespace Opm
566 
567 #endif
Implements a linearly interpolated scalar function that depends on one variable.
This class represents the Pressure-Volume-Temperature relations of the gas phase in the black-oil mod...
Definition: GasPvtMultiplexer.hpp:100
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure) const
Returns the formation volume factor [-] of oil saturated gas given a set of parameters.
Definition: GasPvtMultiplexer.hpp:272
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition: GasPvtMultiplexer.hpp:218
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: GasPvtMultiplexer.hpp:261
Evaluation viscosity(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &Rv, const Evaluation &Rvw) const
Returns the dynamic viscosity [Pa s] of the fluid phase given a set of parameters.
Definition: GasPvtMultiplexer.hpp:241
Evaluation diffusionCoefficient(const Evaluation &temperature, const Evaluation &pressure, unsigned compIdx) const
Calculate the binary molecular diffusion coefficient for a component in a fluid phase [mol^2 * s / (k...
Definition: GasPvtMultiplexer.hpp:322
Evaluation saturatedOilVaporizationFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure) const
Returns the oil vaporization factor [m^3/m^3] of oil saturated gas.
Definition: GasPvtMultiplexer.hpp:281
const Scalar gasReferenceDensity(unsigned regionIdx)
Return the reference density which are considered by this PVT-object.
Definition: GasPvtMultiplexer.hpp:224
Evaluation saturationPressure(unsigned regionIdx, const Evaluation &temperature, const Evaluation &Rv) const
Returns the saturation pressure of the gas phase [Pa] depending on its mass fraction of the oil compo...
Definition: GasPvtMultiplexer.hpp:313
Evaluation saturatedViscosity(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure) const
Returns the dynamic viscosity [Pa s] of oil saturated gas given a set of parameters.
Definition: GasPvtMultiplexer.hpp:252
This class implements temperature dependence of the PVT properties of gas.
Definition: GasPvtThermal.hpp:50
bool enableThermalDensity() const
Returns true iff the density of the gas phase is temperature dependent.
Definition: GasPvtThermal.hpp:234
Evaluation viscosity(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &Rv, const Evaluation &Rvw) const
Returns the dynamic viscosity [Pa s] of the fluid phase given a set of parameters.
Definition: GasPvtThermal.hpp:317
Evaluation saturatedOilVaporizationFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &oilSaturation, const Evaluation &maxOilSaturation) const
Returns the oil vaporization factor [m^3/m^3] of the gas phase.
Definition: GasPvtThermal.hpp:439
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure) const
Returns the formation volume factor [-] of oil-saturated gas.
Definition: GasPvtThermal.hpp:383
bool enableJouleThomsony() const
Returns true iff Joule-Thomson effect for the gas phase is active.
Definition: GasPvtThermal.hpp:240
Evaluation saturatedOilVaporizationFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure) const
Returns the oil vaporization factor [m^3/m^3] of the gas phase.
Definition: GasPvtThermal.hpp:426
void initEnd()
Finish initializing the thermal part of the gas phase PVT properties.
Definition: GasPvtThermal.hpp:225
void setNumRegions(size_t numRegions)
Set the number of PVT-regions considered by this object.
Definition: GasPvtThermal.hpp:210
Evaluation inverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &Rv, const Evaluation &) const
Returns the formation volume factor [-] of the fluid phase.
Definition: GasPvtThermal.hpp:351
bool enableThermalViscosity() const
Returns true iff the viscosity of the gas phase is temperature dependent.
Definition: GasPvtThermal.hpp:246
Evaluation saturatedWaterVaporizationFactor(unsigned, const Evaluation &, const Evaluation &) const
Returns the water vaporization factor [m^3/m^3] of the water phase.
Definition: GasPvtThermal.hpp:412
Evaluation internalEnergy(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure, const Evaluation &Rv) const
Returns the specific internal energy [J/kg] of gas given a set of parameters.
Definition: GasPvtThermal.hpp:253
Evaluation saturatedViscosity(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure) const
Returns the dynamic viscosity [Pa s] of the oil-saturated gas phase given a set of parameters.
Definition: GasPvtThermal.hpp:335
Evaluation saturationPressure(unsigned regionIdx, const Evaluation &temperature, const Evaluation &pressure) const
Returns the saturation pressure of the gas phase [Pa].
Definition: GasPvtThermal.hpp:454
Implements a linearly interpolated scalar function that depends on one variable.
Definition: Tabulated1DFunction.hpp:48