WetGasPvt.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_WET_GAS_PVT_HPP
28 #define OPM_WET_GAS_PVT_HPP
29 
34 
35 #if HAVE_OPM_PARSER
36 #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
37 #include <opm/parser/eclipse/EclipseState/Tables/TableManager.hpp>
38 #endif
39 
40 namespace Opm {
41 
46 template <class Scalar>
47 class WetGasPvt
48 {
51  typedef std::vector<std::pair<Scalar, Scalar> > SamplingPoints;
52 
53 public:
54  WetGasPvt()
55  {
56  vapPar1_ = 0.0;
57  }
58 
59 #if HAVE_OPM_PARSER
60 
65  void initFromDeck(const Deck& deck, const EclipseState& eclState)
66  {
67  const auto& pvtgTables = eclState.getTableManager().getPvtgTables();
68  const auto& densityKeyword = deck.getKeyword("DENSITY");
69 
70  assert(pvtgTables.size() == densityKeyword.size());
71 
72  size_t numRegions = pvtgTables.size();
73  setNumRegions(numRegions);
74 
75  for (unsigned regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
76  Scalar rhoRefO = densityKeyword.getRecord(regionIdx).getItem("OIL").getSIDouble(0);
77  Scalar rhoRefG = densityKeyword.getRecord(regionIdx).getItem("GAS").getSIDouble(0);
78  Scalar rhoRefW = densityKeyword.getRecord(regionIdx).getItem("WATER").getSIDouble(0);
79 
80  setReferenceDensities(regionIdx, rhoRefO, rhoRefG, rhoRefW);
81  }
82 
83  for (unsigned regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
84  const auto& pvtgTable = pvtgTables[regionIdx];
85 
86  const auto& saturatedTable = pvtgTable.getSaturatedTable();
87  assert(saturatedTable.numRows() > 1);
88 
89  auto& gasMu = gasMu_[regionIdx];
90  auto& invGasB = inverseGasB_[regionIdx];
91  auto& invSatGasB = inverseSaturatedGasB_[regionIdx];
92  auto& invSatGasBMu = inverseSaturatedGasBMu_[regionIdx];
93  auto& oilVaporizationFac = saturatedOilVaporizationFactorTable_[regionIdx];
94 
95  oilVaporizationFac.setXYArrays(saturatedTable.numRows(),
96  saturatedTable.getColumn("PG"),
97  saturatedTable.getColumn("RV"));
98 
99  std::vector<Scalar> invSatGasBArray;
100  std::vector<Scalar> invSatGasBMuArray;
101 
102  // extract the table for the gas dissolution and the oil formation volume factors
103  for (unsigned outerIdx = 0; outerIdx < saturatedTable.numRows(); ++ outerIdx) {
104  Scalar pg = saturatedTable.get("PG" , outerIdx);
105  Scalar B = saturatedTable.get("BG" , outerIdx);
106  Scalar mu = saturatedTable.get("MUG" , outerIdx);
107 
108  invGasB.appendXPos(pg);
109  gasMu.appendXPos(pg);
110 
111  invSatGasBArray.push_back(1.0/B);
112  invSatGasBMuArray.push_back(1.0/(mu*B));
113 
114  assert(invGasB.numX() == outerIdx + 1);
115  assert(gasMu.numX() == outerIdx + 1);
116 
117  const auto& underSaturatedTable = pvtgTable.getUnderSaturatedTable(outerIdx);
118  size_t numRows = underSaturatedTable.numRows();
119  for (size_t innerIdx = 0; innerIdx < numRows; ++ innerIdx) {
120  Scalar Rv = underSaturatedTable.get("RV" , innerIdx);
121  Scalar Bg = underSaturatedTable.get("BG" , innerIdx);
122  Scalar mug = underSaturatedTable.get("MUG" , innerIdx);
123 
124  invGasB.appendSamplePoint(outerIdx, Rv, 1.0/Bg);
125  gasMu.appendSamplePoint(outerIdx, Rv, mug);
126  }
127  }
128 
129  {
130  std::vector<double> tmpPressure = saturatedTable.getColumn("PG").vectorCopy( );
131 
132  invSatGasB.setXYContainers(tmpPressure, invSatGasBArray);
133  invSatGasBMu.setXYContainers(tmpPressure, invSatGasBMuArray);
134  }
135 
136  // make sure to have at least two sample points per gas pressure value
137  for (unsigned xIdx = 0; xIdx < invGasB.numX(); ++xIdx) {
138  // a single sample point is definitely needed
139  assert(invGasB.numY(xIdx) > 0);
140 
141  // everything is fine if the current table has two or more sampling points
142  // for a given mole fraction
143  if (invGasB.numY(xIdx) > 1)
144  continue;
145 
146  // find the master table which will be used as a template to extend the
147  // current line. We define master table as the first table which has values
148  // for undersaturated gas...
149  size_t masterTableIdx = xIdx + 1;
150  for (; masterTableIdx < saturatedTable.numRows(); ++masterTableIdx)
151  {
152  if (pvtgTable.getUnderSaturatedTable(masterTableIdx).numRows() > 1)
153  break;
154  }
155 
156  if (masterTableIdx >= saturatedTable.numRows())
157  OPM_THROW(std::runtime_error,
158  "PVTG tables are invalid: The last table must exhibit at least one "
159  "entry for undersaturated gas!");
160 
161 
162  // extend the current table using the master table.
163  extendPvtgTable_(regionIdx,
164  xIdx,
165  pvtgTable.getUnderSaturatedTable(xIdx),
166  pvtgTable.getUnderSaturatedTable(masterTableIdx));
167  }
168  }
169 
170  vapPar1_ = 0.0;
171  if (deck.hasKeyword("VAPPARS")) {
172  const auto& vapParsKeyword = deck.getKeyword("VAPPARS");
173  vapPar1_ = vapParsKeyword.getRecord(0).getItem("OIL_VAP_PROPENSITY").template get<double>(0);
174  }
175 
176  initEnd();
177  }
178 
179 private:
180  void extendPvtgTable_(unsigned regionIdx,
181  unsigned xIdx,
182  const SimpleTable& curTable,
183  const SimpleTable& masterTable)
184  {
185  std::vector<double> RvArray = curTable.getColumn("RV").vectorCopy();
186  std::vector<double> gasBArray = curTable.getColumn("BG").vectorCopy();
187  std::vector<double> gasMuArray = curTable.getColumn("MUG").vectorCopy();
188 
189  auto& invGasB = inverseGasB_[regionIdx];
190  auto& gasMu = gasMu_[regionIdx];
191 
192  for (size_t newRowIdx = 1; newRowIdx < masterTable.numRows(); ++ newRowIdx) {
193  const auto& RVColumn = masterTable.getColumn("RV");
194  const auto& BGColumn = masterTable.getColumn("BG");
195  const auto& viscosityColumn = masterTable.getColumn("MUG");
196 
197  // compute the gas pressure for the new entry
198  Scalar diffRv = RVColumn[newRowIdx] - RVColumn[newRowIdx - 1];
199  Scalar newRv = RvArray.back() + diffRv;
200 
201  // calculate the compressibility of the master table
202  Scalar B1 = BGColumn[newRowIdx];
203  Scalar B2 = BGColumn[newRowIdx - 1];
204  Scalar x = (B1 - B2)/( (B1 + B2)/2.0 );
205 
206  // calculate the gas formation volume factor which exhibits the same
207  // "compressibility" for the new value of Rv
208  Scalar newBg = gasBArray.back()*(1.0 + x/2.0)/(1.0 - x/2.0);
209 
210  // calculate the "viscosibility" of the master table
211  Scalar mu1 = viscosityColumn[newRowIdx];
212  Scalar mu2 = viscosityColumn[newRowIdx - 1];
213  Scalar xMu = (mu1 - mu2)/( (mu1 + mu2)/2.0 );
214 
215  // calculate the gas formation volume factor which exhibits the same
216  // compressibility for the new pressure
217  Scalar newMug = gasMuArray.back()*(1.0 + xMu/2)/(1.0 - xMu/2.0);
218 
219  // append the new values to the arrays which we use to compute the additional
220  // values ...
221  RvArray.push_back(newRv);
222  gasBArray.push_back(newBg);
223  gasMuArray.push_back(newMug);
224 
225  // ... and register them with the internal table objects
226  invGasB.appendSamplePoint(xIdx, newRv, 1.0/newBg);
227  gasMu.appendSamplePoint(xIdx, newRv, newMug);
228  }
229  }
230 
231 public:
232 #endif // HAVE_OPM_PARSER
233 
234  void setNumRegions(size_t numRegions)
235  {
236  oilReferenceDensity_.resize(numRegions);
237  gasReferenceDensity_.resize(numRegions);
238  inverseGasB_.resize(numRegions);
239  inverseGasBMu_.resize(numRegions);
240  inverseSaturatedGasB_.resize(numRegions);
241  inverseSaturatedGasBMu_.resize(numRegions);
242  gasMu_.resize(numRegions);
243  saturatedOilVaporizationFactorTable_.resize(numRegions);
244  saturationPressure_.resize(numRegions);
245  }
246 
250  void setReferenceDensities(unsigned regionIdx,
251  Scalar rhoRefOil,
252  Scalar rhoRefGas,
253  Scalar /*rhoRefWater*/)
254  {
255  oilReferenceDensity_[regionIdx] = rhoRefOil;
256  gasReferenceDensity_[regionIdx] = rhoRefGas;
257  }
258 
264  void setSaturatedGasOilVaporizationFactor(unsigned regionIdx, const SamplingPoints& samplePoints)
265  { saturatedOilVaporizationFactorTable_[regionIdx].setContainerOfTuples(samplePoints); }
266 
276  void setSaturatedGasFormationVolumeFactor(unsigned regionIdx, const SamplingPoints& samplePoints)
277  {
278  auto& invGasB = inverseGasB_[regionIdx];
279 
280  const auto& RvTable = saturatedOilVaporizationFactorTable_[regionIdx];
281 
282  Scalar T = 273.15 + 15.56; // [K]
283 
284  Scalar RvMin = 0.0;
285  Scalar RvMax = RvTable.eval(saturatedOilVaporizationFactorTable_[regionIdx].xMax(), /*extrapolate=*/true);
286 
287  Scalar poMin = samplePoints.front().first;
288  Scalar poMax = samplePoints.back().first;
289 
290  size_t nRv = 20;
291  size_t nP = samplePoints.size()*2;
292 
293  Scalar rhogRef = gasReferenceDensity_[regionIdx];
294  Scalar rhooRef = oilReferenceDensity_[regionIdx];
295 
296  TabulatedOneDFunction gasFormationVolumeFactor;
297  gasFormationVolumeFactor.setContainerOfTuples(samplePoints);
298 
299  updateSaturationPressure_(regionIdx);
300 
301  // calculate a table of estimated densities depending on pressure and gas mass
302  // fraction. note that this assumes oil of constant compressibility. (having said
303  // that, if only the saturated gas densities are available, there's not much
304  // choice.)
305  for (size_t RvIdx = 0; RvIdx < nRv; ++RvIdx) {
306  Scalar Rv = RvMin + (RvMax - RvMin)*RvIdx/nRv;
307 
308  invGasB.appendXPos(Rv);
309 
310  for (size_t pIdx = 0; pIdx < nP; ++pIdx) {
311  Scalar pg = poMin + (poMax - poMin)*pIdx/nP;
312 
313  Scalar poSat = saturationPressure(regionIdx, T, Rv);
314  Scalar BgSat = gasFormationVolumeFactor.eval(poSat, /*extrapolate=*/true);
315  Scalar drhoo_dp = (1.1200 - 1.1189)/((5000 - 4000)*6894.76);
316  Scalar rhoo = rhooRef/BgSat*(1 + drhoo_dp*(pg - poSat));
317 
318  Scalar Bg = rhooRef/rhoo;
319 
320  invGasB.appendSamplePoint(RvIdx, pg, 1.0/Bg);
321  }
322  }
323  }
324 
337  void setInverseGasFormationVolumeFactor(unsigned regionIdx, const TabulatedTwoDFunction& invBg)
338  { inverseGasB_[regionIdx] = invBg; }
339 
345  void setGasViscosity(unsigned regionIdx, const TabulatedTwoDFunction& mug)
346  { gasMu_[regionIdx] = mug; }
347 
355  void setSaturatedGasViscosity(unsigned regionIdx, const SamplingPoints& samplePoints )
356  {
357  auto& oilVaporizationFac = saturatedOilVaporizationFactorTable_[regionIdx];
358 
359  Scalar RvMin = 0.0;
360  Scalar RvMax = oilVaporizationFac.eval(saturatedOilVaporizationFactorTable_[regionIdx].xMax(), /*extrapolate=*/true);
361 
362  Scalar poMin = samplePoints.front().first;
363  Scalar poMax = samplePoints.back().first;
364 
365  size_t nRv = 20;
366  size_t nP = samplePoints.size()*2;
367 
368  TabulatedOneDFunction mugTable;
369  mugTable.setContainerOfTuples(samplePoints);
370 
371  // calculate a table of estimated densities depending on pressure and gas mass
372  // fraction
373  for (size_t RvIdx = 0; RvIdx < nRv; ++RvIdx) {
374  Scalar Rv = RvMin + (RvMax - RvMin)*RvIdx/nRv;
375 
376  gasMu_[regionIdx].appendXPos(Rv);
377 
378  for (size_t pIdx = 0; pIdx < nP; ++pIdx) {
379  Scalar pg = poMin + (poMax - poMin)*pIdx/nP;
380  Scalar mug = mugTable.eval(pg, /*extrapolate=*/true);
381 
382  gasMu_[regionIdx].appendSamplePoint(RvIdx, pg, mug);
383  }
384  }
385  }
386 
390  void initEnd()
391  {
392  // calculate the final 2D functions which are used for interpolation.
393  size_t numRegions = gasMu_.size();
394  for (unsigned regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
395  // calculate the table which stores the inverse of the product of the gas
396  // formation volume factor and the gas viscosity
397  const auto& gasMu = gasMu_[regionIdx];
398  const auto& invGasB = inverseGasB_[regionIdx];
399  assert(gasMu.numX() == invGasB.numX());
400 
401  auto& invGasBMu = inverseGasBMu_[regionIdx];
402  auto& invSatGasB = inverseSaturatedGasB_[regionIdx];
403  auto& invSatGasBMu = inverseSaturatedGasBMu_[regionIdx];
404 
405  std::vector<Scalar> satPressuresArray;
406  std::vector<Scalar> invSatGasBArray;
407  std::vector<Scalar> invSatGasBMuArray;
408  for (size_t pIdx = 0; pIdx < gasMu.numX(); ++pIdx) {
409  invGasBMu.appendXPos(gasMu.xAt(pIdx));
410 
411  assert(gasMu.numY(pIdx) == invGasB.numY(pIdx));
412 
413  size_t numRv = gasMu.numY(pIdx);
414  for (size_t rvIdx = 0; rvIdx < numRv; ++rvIdx)
415  invGasBMu.appendSamplePoint(pIdx,
416  gasMu.yAt(pIdx, rvIdx),
417  invGasB.valueAt(pIdx, rvIdx)
418  / gasMu.valueAt(pIdx, rvIdx));
419 
420  // the sampling points in UniformXTabulated2DFunction are always sorted
421  // in ascending order. Thus, the value for saturated gas is the last one
422  // (i.e., the one with the largest Rv value)
423  satPressuresArray.push_back(gasMu.xAt(pIdx));
424  invSatGasBArray.push_back(invGasB.valueAt(pIdx, numRv - 1));
425  invSatGasBMuArray.push_back(invGasBMu.valueAt(pIdx, numRv - 1));
426  }
427 
428  invSatGasB.setXYContainers(satPressuresArray, invSatGasBArray);
429  invSatGasBMu.setXYContainers(satPressuresArray, invSatGasBMuArray);
430 
431  updateSaturationPressure_(regionIdx);
432  }
433  }
434 
438  unsigned numRegions() const
439  { return gasReferenceDensity_.size(); }
440 
444  template <class Evaluation>
445  Evaluation viscosity(unsigned regionIdx,
446  const Evaluation& /*temperature*/,
447  const Evaluation& pressure,
448  const Evaluation& Rv) const
449  {
450  const Evaluation& invBg = inverseGasB_[regionIdx].eval(pressure, Rv, /*extrapolate=*/true);
451  const Evaluation& invMugBg = inverseGasBMu_[regionIdx].eval(pressure, Rv, /*extrapolate=*/true);
452 
453  return invBg/invMugBg;
454  }
455 
459  template <class Evaluation>
460  Evaluation saturatedViscosity(unsigned regionIdx,
461  const Evaluation& /*temperature*/,
462  const Evaluation& pressure) const
463  {
464  const Evaluation& invBg = inverseSaturatedGasB_[regionIdx].eval(pressure, /*extrapolate=*/true);
465  const Evaluation& invMugBg = inverseSaturatedGasBMu_[regionIdx].eval(pressure, /*extrapolate=*/true);
466 
467  return invBg/invMugBg;
468  }
469 
473  template <class Evaluation>
474  Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
475  const Evaluation& /*temperature*/,
476  const Evaluation& pressure,
477  const Evaluation& Rv) const
478  { return inverseGasB_[regionIdx].eval(pressure, Rv, /*extrapolate=*/true); }
479 
483  template <class Evaluation>
484  Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
485  const Evaluation& /*temperature*/,
486  const Evaluation& pressure) const
487  { return inverseSaturatedGasB_[regionIdx].eval(pressure, /*extrapolate=*/true); }
488 
492  template <class Evaluation>
493  Evaluation saturatedOilVaporizationFactor(unsigned regionIdx,
494  const Evaluation& /*temperature*/,
495  const Evaluation& pressure) const
496  {
497  return saturatedOilVaporizationFactorTable_[regionIdx].eval(pressure, /*extrapolate=*/true);
498  }
499 
507  template <class Evaluation>
508  Evaluation saturatedOilVaporizationFactor(unsigned regionIdx,
509  const Evaluation& /*temperature*/,
510  const Evaluation& pressure,
511  const Evaluation& oilSaturation,
512  Scalar maxOilSaturation) const
513  {
514  Evaluation tmp =
515  saturatedOilVaporizationFactorTable_[regionIdx].eval(pressure, /*extrapolate=*/true);
516 
517  // apply the vaporization parameters for the gas phase (cf. the Eclipse VAPPARS
518  // keyword)
519  maxOilSaturation = std::min(maxOilSaturation, Scalar(1.0));
520  if (vapPar1_ > 0.0 && maxOilSaturation > 0.01 && oilSaturation < maxOilSaturation) {
521  static const Scalar eps = 0.001;
522  const Evaluation& So = Opm::max(oilSaturation, eps);
523  tmp *= Opm::max(1e-3, Opm::pow(So/maxOilSaturation, vapPar1_));
524  }
525 
526  return tmp;
527  }
528 
539  template <class Evaluation>
540  Evaluation saturationPressure(unsigned regionIdx,
541  const Evaluation& temperature OPM_UNUSED,
542  const Evaluation& Rv) const
543  {
544  typedef Opm::MathToolbox<Evaluation> Toolbox;
545 
546  const auto& RvTable = saturatedOilVaporizationFactorTable_[regionIdx];
547  const Scalar eps = std::numeric_limits<typename Toolbox::Scalar>::epsilon()*1e6;
548 
549  // use the tabulated saturation pressure function to get a pretty good initial value
550  Evaluation pSat = saturationPressure_[regionIdx].eval(Rv, /*extrapolate=*/true);
551 
552  // Newton method to do the remaining work. If the initial
553  // value is good, this should only take two to three
554  // iterations...
555  bool onProbation = false;
556  for (unsigned i = 0; i < 20; ++i) {
557  const Evaluation& f = RvTable.eval(pSat, /*extrapolate=*/true) - Rv;
558  const Evaluation& fPrime = RvTable.evalDerivative(pSat, /*extrapolate=*/true);
559 
560  // If the derivative is "zero" Newton will not converge,
561  // so simply return our initial guess.
562  if (std::abs(Opm::scalarValue(fPrime)) < 1.0e-30) {
563  return pSat;
564  }
565 
566  const Evaluation& delta = f/fPrime;
567 
568  pSat -= delta;
569 
570  if (pSat < 0.0) {
571  // if the pressure is lower than 0 Pascals, we set it back to 0. if this
572  // happens twice, we give up and just return 0 Pa...
573  if (onProbation)
574  return 0.0;
575 
576  onProbation = true;
577  pSat = 0.0;
578  }
579 
580  if (std::abs(Opm::scalarValue(delta)) < std::abs(Opm::scalarValue(pSat))*eps)
581  return pSat;
582  }
583 
584  std::stringstream errlog;
585  errlog << "Finding saturation pressure did not converge:"
586  << " pSat = " << pSat
587  << ", Rv = " << Rv;
588  OpmLog::debug("Wet gas saturation pressure", errlog.str());
589  OPM_THROW_NOLOG(NumericalProblem, errlog.str());
590  }
591 
592 private:
593  void updateSaturationPressure_(unsigned regionIdx)
594  {
595  typedef std::pair<Scalar, Scalar> Pair;
596  const auto& oilVaporizationFac = saturatedOilVaporizationFactorTable_[regionIdx];
597 
598  // create the taublated function representing saturation pressure depending of
599  // Rv
600  size_t n = oilVaporizationFac.numSamples();
601  Scalar delta = (oilVaporizationFac.xMax() - oilVaporizationFac.xMin())/Scalar(n + 1);
602 
603  SamplingPoints pSatSamplePoints;
604  Scalar Rv = 0;
605  for (size_t i = 0; i <= n; ++ i) {
606  Scalar pSat = oilVaporizationFac.xMin() + Scalar(i)*delta;
607  Rv = saturatedOilVaporizationFactor(regionIdx, /*temperature=*/Scalar(1e30), pSat);
608 
609  Pair val(Rv, pSat);
610  pSatSamplePoints.push_back(val);
611  }
612 
613  //Prune duplicate Rv values (can occur, and will cause problems in further interpolation)
614  auto x_coord_comparator = [](const Pair& a, const Pair& b) { return a.first == b.first; };
615  auto last = std::unique(pSatSamplePoints.begin(), pSatSamplePoints.end(), x_coord_comparator);
616  pSatSamplePoints.erase(last, pSatSamplePoints.end());
617 
618  saturationPressure_[regionIdx].setContainerOfTuples(pSatSamplePoints);
619  }
620 
621  std::vector<Scalar> gasReferenceDensity_;
622  std::vector<Scalar> oilReferenceDensity_;
623  std::vector<TabulatedTwoDFunction> inverseGasB_;
624  std::vector<TabulatedOneDFunction> inverseSaturatedGasB_;
625  std::vector<TabulatedTwoDFunction> gasMu_;
626  std::vector<TabulatedTwoDFunction> inverseGasBMu_;
627  std::vector<TabulatedOneDFunction> inverseSaturatedGasBMu_;
628  std::vector<TabulatedOneDFunction> saturatedOilVaporizationFactorTable_;
629  std::vector<TabulatedOneDFunction> saturationPressure_;
630 
631  Scalar vapPar1_;
632 };
633 
634 } // namespace Opm
635 
636 #endif
void setSaturatedGasViscosity(unsigned regionIdx, const SamplingPoints &samplePoints)
Initialize the phase viscosity for oil saturated gas.
Definition: WetGasPvt.hpp:355
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the formation volume factor [-] of oil saturated gas at a given pressure. ...
Definition: WetGasPvt.hpp:484
Implements a scalar function that depends on two variables and which is sampled uniformly in the X di...
void setInverseGasFormationVolumeFactor(unsigned regionIdx, const TabulatedTwoDFunction &invBg)
Initialize the function for the gas formation volume factor.
Definition: WetGasPvt.hpp:337
Implements a scalar function that depends on two variables and which is sampled uniformly in the X di...
Definition: UniformXTabulated2DFunction.hpp:55
Definition: Air_Mesitylene.hpp:33
Evaluation eval(const Evaluation &x, bool extrapolate=false) const
Evaluate the spline at a given position.
Definition: Tabulated1DFunction.hpp:252
void setGasViscosity(unsigned regionIdx, const TabulatedTwoDFunction &mug)
Initialize the viscosity of the gas phase.
Definition: WetGasPvt.hpp:345
void setSaturatedGasOilVaporizationFactor(unsigned regionIdx, const SamplingPoints &samplePoints)
Initialize the function for the oil vaporization factor .
Definition: WetGasPvt.hpp:264
void setReferenceDensities(unsigned regionIdx, Scalar rhoRefOil, Scalar rhoRefGas, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition: WetGasPvt.hpp:250
Definition: MathToolbox.hpp:48
This class represents the Pressure-Volume-Temperature relations of the gas phas with vaporized oil...
Definition: WetGasPvt.hpp:47
Evaluation saturationPressure(unsigned regionIdx, const Evaluation &temperature OPM_UNUSED, const Evaluation &Rv) const
Returns the saturation pressure of the gas phase [Pa] depending on its mass fraction of the oil compo...
Definition: WetGasPvt.hpp:540
Implements a linearly interpolated scalar function that depends on one variable.
A central place for various physical constants occuring in some equations.
void setContainerOfTuples(const XYContainer &points, bool sortInputs=true)
Set the sampling points of the piecewise linear function using a STL-compatible container of tuple-li...
Definition: Tabulated1DFunction.hpp:184
void initEnd()
Finish initializing the gas phase PVT properties.
Definition: WetGasPvt.hpp:390
void setSaturatedGasFormationVolumeFactor(unsigned regionIdx, const SamplingPoints &samplePoints)
Initialize the function for the gas formation volume factor.
Definition: WetGasPvt.hpp:276
Evaluation inverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure, const Evaluation &Rv) const
Returns the formation volume factor [-] of the fluid phase.
Definition: WetGasPvt.hpp:474
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition: WetGasPvt.hpp:438
This file provides a wrapper around the "final" C++-2011 statement.
Evaluation viscosity(unsigned regionIdx, const Evaluation &, const Evaluation &pressure, const Evaluation &Rv) const
Returns the dynamic viscosity [Pa s] of the fluid phase given a set of parameters.
Definition: WetGasPvt.hpp:445
Implements a linearly interpolated scalar function that depends on one variable.
Definition: Tabulated1DFunction.hpp:47
Evaluation saturatedOilVaporizationFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure, const Evaluation &oilSaturation, Scalar maxOilSaturation) const
Returns the oil vaporization factor [m^3/m^3] of the gas phase.
Definition: WetGasPvt.hpp:508
Evaluation saturatedOilVaporizationFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the oil vaporization factor [m^3/m^3] of the gas phase.
Definition: WetGasPvt.hpp:493
Evaluation saturatedViscosity(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the dynamic viscosity [Pa s] of oil saturated gas at a given pressure.
Definition: WetGasPvt.hpp:460