All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
LiveOilPvt.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_LIVE_OIL_PVT_HPP
28 #define OPM_LIVE_OIL_PVT_HPP
29 
31 
35 
36 #if HAVE_OPM_PARSER
37 #include <opm/parser/eclipse/Deck/Deck.hpp>
38 #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
39 #include <opm/parser/eclipse/EclipseState/Tables/SimpleTable.hpp>
40 #include <opm/parser/eclipse/EclipseState/Tables/TableManager.hpp>
41 #endif
42 
43 namespace Opm {
48 template <class Scalar>
50 {
53  typedef std::vector<std::pair<Scalar, Scalar> > SamplingPoints;
54 
55 public:
56  LiveOilPvt()
57  {
58  vapPar2_ = 0.0;
59  }
60 
61 #if HAVE_OPM_PARSER
62 
65  void initFromDeck(const Deck& deck, const EclipseState& eclState)
66  {
67  const auto& pvtoTables = eclState.getTableManager().getPvtoTables();
68  const auto& densityKeyword = deck.getKeyword("DENSITY");
69 
70  assert(pvtoTables.size() == densityKeyword.size());
71 
72  size_t numRegions = pvtoTables.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  // initialize the internal table objects
84  for (unsigned regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
85  const auto& pvtoTable = pvtoTables[regionIdx];
86 
87  const auto& saturatedTable = pvtoTable.getSaturatedTable();
88  assert(saturatedTable.numRows() > 1);
89 
90  auto& oilMu = oilMuTable_[regionIdx];
91  auto& satOilMu = saturatedOilMuTable_[regionIdx];
92  auto& invOilB = inverseOilBTable_[regionIdx];
93  auto& invSatOilB = inverseSaturatedOilBTable_[regionIdx];
94  auto& gasDissolutionFac = saturatedGasDissolutionFactorTable_[regionIdx];
95  std::vector<Scalar> invSatOilBArray;
96  std::vector<Scalar> satOilMuArray;
97 
98  // extract the table for the gas dissolution and the oil formation volume factors
99  for (unsigned outerIdx = 0; outerIdx < saturatedTable.numRows(); ++ outerIdx) {
100  Scalar Rs = saturatedTable.get("RS", outerIdx);
101  Scalar BoSat = saturatedTable.get("BO", outerIdx);
102  Scalar muoSat = saturatedTable.get("MU", outerIdx);
103 
104  satOilMuArray.push_back(muoSat);
105  invSatOilBArray.push_back(1.0/BoSat);
106 
107  invOilB.appendXPos(Rs);
108  oilMu.appendXPos(Rs);
109 
110  assert(invOilB.numX() == outerIdx + 1);
111  assert(oilMu.numX() == outerIdx + 1);
112 
113  const auto& underSaturatedTable = pvtoTable.getUnderSaturatedTable(outerIdx);
114  size_t numRows = underSaturatedTable.numRows();
115  for (unsigned innerIdx = 0; innerIdx < numRows; ++ innerIdx) {
116  Scalar po = underSaturatedTable.get("P", innerIdx);
117  Scalar Bo = underSaturatedTable.get("BO", innerIdx);
118  Scalar muo = underSaturatedTable.get("MU", innerIdx);
119 
120  invOilB.appendSamplePoint(outerIdx, po, 1.0/Bo);
121  oilMu.appendSamplePoint(outerIdx, po, muo);
122  }
123  }
124 
125  // update the tables for the formation volume factor and for the gas
126  // dissolution factor of saturated oil
127  {
128  const auto& tmpPressureColumn = saturatedTable.getColumn("P");
129  const auto& tmpGasSolubilityColumn = saturatedTable.getColumn("RS");
130 
131  invSatOilB.setXYContainers(tmpPressureColumn, invSatOilBArray);
132  satOilMu.setXYContainers(tmpPressureColumn, satOilMuArray);
133  gasDissolutionFac.setXYContainers(tmpPressureColumn, tmpGasSolubilityColumn);
134  }
135 
136  updateSaturationPressure_(regionIdx);
137  // make sure to have at least two sample points per Rs value
138  for (unsigned xIdx = 0; xIdx < invOilB.numX(); ++xIdx) {
139  // a single sample point is definitely needed
140  assert(invOilB.numY(xIdx) > 0);
141 
142  // everything is fine if the current table has two or more sampling points
143  // for a given mole fraction
144  if (invOilB.numY(xIdx) > 1)
145  continue;
146 
147  // find the master table which will be used as a template to extend the
148  // current line. We define master table as the first table which has values
149  // for undersaturated oil...
150  size_t masterTableIdx = xIdx + 1;
151  for (; masterTableIdx < saturatedTable.numRows(); ++masterTableIdx)
152  {
153  if (pvtoTable.getUnderSaturatedTable(masterTableIdx).numRows() > 1)
154  break;
155  }
156 
157  if (masterTableIdx >= saturatedTable.numRows())
158  OPM_THROW(std::runtime_error,
159  "PVTO tables are invalid: The last table must exhibit at least one "
160  "entry for undersaturated oil!");
161 
162  // extend the current table using the master table.
163  extendPvtoTable_(regionIdx,
164  xIdx,
165  pvtoTable.getUnderSaturatedTable(xIdx),
166  pvtoTable.getUnderSaturatedTable(masterTableIdx));
167  }
168  }
169 
170  vapPar2_ = 0.0;
171  if (deck.hasKeyword("VAPPARS")) {
172  const auto& vapParsKeyword = deck.getKeyword("VAPPARS");
173  vapPar2_ = vapParsKeyword.getRecord(0).getItem("OIL_DENSITY_PROPENSITY").template get<double>(0);
174  }
175 
176  initEnd();
177  }
178 
179 private:
180  void extendPvtoTable_(unsigned regionIdx,
181  unsigned xIdx,
182  const SimpleTable& curTable,
183  const SimpleTable& masterTable)
184  {
185  std::vector<double> pressuresArray = curTable.getColumn("P").vectorCopy();
186  std::vector<double> oilBArray = curTable.getColumn("BO").vectorCopy();
187  std::vector<double> oilMuArray = curTable.getColumn("MU").vectorCopy();
188 
189  auto& invOilB = inverseOilBTable_[regionIdx];
190  auto& oilMu = oilMuTable_[regionIdx];
191 
192  for (unsigned newRowIdx = 1; newRowIdx < masterTable.numRows(); ++ newRowIdx) {
193  const auto& pressureColumn = masterTable.getColumn("P");
194  const auto& BOColumn = masterTable.getColumn("BO");
195  const auto& viscosityColumn = masterTable.getColumn("MU");
196 
197  // compute the oil pressure for the new entry
198  Scalar diffPo = pressureColumn[newRowIdx] - pressureColumn[newRowIdx - 1];
199  Scalar newPo = pressuresArray.back() + diffPo;
200 
201  // calculate the compressibility of the master table
202  Scalar B1 = BOColumn[newRowIdx];
203  Scalar B2 = BOColumn[newRowIdx - 1];
204  Scalar x = (B1 - B2)/( (B1 + B2)/2.0 );
205 
206  // calculate the oil formation volume factor which exhibits the same
207  // compressibility for the new pressure
208  Scalar newBo = oilBArray.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 oil formation volume factor which exhibits the same
216  // compressibility for the new pressure
217  Scalar newMuo = oilMuArray.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  pressuresArray.push_back(newPo);
222  oilBArray.push_back(newBo);
223  oilMuArray.push_back(newMuo);
224 
225  // ... and register them with the internal table objects
226  invOilB.appendSamplePoint(xIdx, newPo, 1.0/newBo);
227  oilMu.appendSamplePoint(xIdx, newPo, newMuo);
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  inverseOilBTable_.resize(numRegions);
239  inverseOilBMuTable_.resize(numRegions);
240  inverseSaturatedOilBTable_.resize(numRegions);
241  inverseSaturatedOilBMuTable_.resize(numRegions);
242  oilMuTable_.resize(numRegions);
243  saturatedOilMuTable_.resize(numRegions);
244  saturatedGasDissolutionFactorTable_.resize(numRegions);
245  saturationPressure_.resize(numRegions);
246  }
247 
251  void setReferenceDensities(unsigned regionIdx,
252  Scalar rhoRefOil,
253  Scalar rhoRefGas,
254  Scalar /*rhoRefWater*/)
255  {
256  oilReferenceDensity_[regionIdx] = rhoRefOil;
257  gasReferenceDensity_[regionIdx] = rhoRefGas;
258  }
259 
265  void setSaturatedOilGasDissolutionFactor(unsigned regionIdx, const SamplingPoints& samplePoints)
266  { saturatedGasDissolutionFactorTable_[regionIdx].setContainerOfTuples(samplePoints); }
267 
277  void setSaturatedOilFormationVolumeFactor(unsigned regionIdx, const SamplingPoints& samplePoints)
278  {
279  Scalar T = 273.15 + 15.56; // [K]
280  auto& invOilB = inverseOilBTable_[regionIdx];
281 
282  updateSaturationPressure_(regionIdx);
283 
284  // calculate a table of estimated densities of undersatured gas
285  for (size_t pIdx = 0; pIdx < samplePoints.size(); ++pIdx) {
286  Scalar p1 = std::get<0>(samplePoints[pIdx]);
287  Scalar p2 = p1 * 2.0;
288 
289  Scalar Bo1 = std::get<1>(samplePoints[pIdx]);
290  Scalar drhoo_dp = (1.1200 - 1.1189)/((5000 - 4000)*6894.76);
291  Scalar Bo2 = Bo1/(1.0 + (p2 - p1)*drhoo_dp);
292 
293  Scalar Rs = saturatedGasDissolutionFactor(regionIdx, T, p1);
294 
295  invOilB.appendXPos(Rs);
296  invOilB.appendSamplePoint(pIdx, p1, 1.0/Bo1);
297  invOilB.appendSamplePoint(pIdx, p2, 1.0/Bo2);
298  }
299  }
300 
313  void setInverseOilFormationVolumeFactor(unsigned regionIdx, const TabulatedTwoDFunction& invBo)
314  { inverseOilBTable_[regionIdx] = invBo; }
315 
321  void setOilViscosity(unsigned regionIdx, const TabulatedTwoDFunction& muo)
322  { oilMuTable_[regionIdx] = muo; }
323 
331  void setSaturatedOilViscosity(unsigned regionIdx, const SamplingPoints& samplePoints)
332  {
333  Scalar T = 273.15 + 15.56; // [K]
334 
335  // update the table for the saturated oil
336  saturatedOilMuTable_[regionIdx].setContainerOfTuples(samplePoints);
337 
338  // calculate a table of estimated viscosities depending on pressure and gas mass
339  // fraction for untersaturated oil to make the other code happy
340  for (size_t pIdx = 0; pIdx < samplePoints.size(); ++pIdx) {
341  Scalar p1 = std::get<0>(samplePoints[pIdx]);
342  Scalar p2 = p1 * 2.0;
343 
344  // no pressure dependence of the viscosity
345  Scalar mu1 = std::get<1>(samplePoints[pIdx]);
346  Scalar mu2 = mu1;
347 
348  Scalar Rs = saturatedGasDissolutionFactor(regionIdx, T, p1);
349 
350  oilMuTable_[regionIdx].appendXPos(Rs);
351  oilMuTable_[regionIdx].appendSamplePoint(pIdx, p1, mu1);
352  oilMuTable_[regionIdx].appendSamplePoint(pIdx, p2, mu2);
353  }
354  }
355 
359  void initEnd()
360  {
361  // calculate the final 2D functions which are used for interpolation.
362  size_t numRegions = oilMuTable_.size();
363  for (unsigned regionIdx = 0; regionIdx < numRegions; ++ regionIdx) {
364  // calculate the table which stores the inverse of the product of the oil
365  // formation volume factor and the oil viscosity
366  const auto& oilMu = oilMuTable_[regionIdx];
367  const auto& satOilMu = saturatedOilMuTable_[regionIdx];
368  const auto& invOilB = inverseOilBTable_[regionIdx];
369  assert(oilMu.numX() == invOilB.numX());
370 
371  auto& invOilBMu = inverseOilBMuTable_[regionIdx];
372  auto& invSatOilB = inverseSaturatedOilBTable_[regionIdx];
373  auto& invSatOilBMu = inverseSaturatedOilBMuTable_[regionIdx];
374 
375  std::vector<Scalar> satPressuresArray;
376  std::vector<Scalar> invSatOilBArray;
377  std::vector<Scalar> invSatOilBMuArray;
378  for (unsigned rsIdx = 0; rsIdx < oilMu.numX(); ++rsIdx) {
379  invOilBMu.appendXPos(oilMu.xAt(rsIdx));
380 
381  assert(oilMu.numY(rsIdx) == invOilB.numY(rsIdx));
382 
383  size_t numPressures = oilMu.numY(rsIdx);
384  for (unsigned pIdx = 0; pIdx < numPressures; ++pIdx)
385  invOilBMu.appendSamplePoint(rsIdx,
386  oilMu.yAt(rsIdx, pIdx),
387  invOilB.valueAt(rsIdx, pIdx)
388  / oilMu.valueAt(rsIdx, pIdx));
389 
390  // the sampling points in UniformXTabulated2DFunction are always sorted
391  // in ascending order. Thus, the value for saturated oil is the first one
392  // (i.e., the one for the lowest pressure value)
393  satPressuresArray.push_back(oilMu.yAt(rsIdx, 0));
394  invSatOilBArray.push_back(invOilB.valueAt(rsIdx, 0));
395  invSatOilBMuArray.push_back(invSatOilBArray.back()/satOilMu.valueAt(rsIdx));
396  }
397 
398  invSatOilB.setXYContainers(satPressuresArray, invSatOilBArray);
399  invSatOilBMu.setXYContainers(satPressuresArray, invSatOilBMuArray);
400 
401  updateSaturationPressure_(regionIdx);
402  }
403  }
404 
408  unsigned numRegions() const
409  { return inverseOilBMuTable_.size(); }
410 
414  template <class Evaluation>
415  Evaluation viscosity(unsigned regionIdx,
416  const Evaluation& /*temperature*/,
417  const Evaluation& pressure,
418  const Evaluation& Rs) const
419  {
420  // ATTENTION: Rs is the first axis!
421  const Evaluation& invBo = inverseOilBTable_[regionIdx].eval(Rs, pressure, /*extrapolate=*/true);
422  const Evaluation& invMuoBo = inverseOilBMuTable_[regionIdx].eval(Rs, pressure, /*extrapolate=*/true);
423 
424  return invBo/invMuoBo;
425  }
426 
430  template <class Evaluation>
431  Evaluation saturatedViscosity(unsigned regionIdx,
432  const Evaluation& /*temperature*/,
433  const Evaluation& pressure) const
434  {
435  // ATTENTION: Rs is the first axis!
436  const Evaluation& invBo = inverseSaturatedOilBTable_[regionIdx].eval(pressure, /*extrapolate=*/true);
437  const Evaluation& invMuoBo = inverseSaturatedOilBMuTable_[regionIdx].eval(pressure, /*extrapolate=*/true);
438 
439  return invBo/invMuoBo;
440  }
441 
445  template <class Evaluation>
446  Evaluation inverseFormationVolumeFactor(unsigned regionIdx,
447  const Evaluation& /*temperature*/,
448  const Evaluation& pressure,
449  const Evaluation& Rs) const
450  {
451  // ATTENTION: Rs is represented by the _first_ axis!
452  return inverseOilBTable_[regionIdx].eval(Rs, pressure, /*extrapolate=*/true);
453  }
454 
458  template <class Evaluation>
459  Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx,
460  const Evaluation& /*temperature*/,
461  const Evaluation& pressure) const
462  {
463  // ATTENTION: Rs is represented by the _first_ axis!
464  return inverseSaturatedOilBTable_[regionIdx].eval(pressure, /*extrapolate=*/true);
465  }
466 
470  template <class Evaluation>
471  Evaluation saturatedGasDissolutionFactor(unsigned regionIdx,
472  const Evaluation& /*temperature*/,
473  const Evaluation& pressure) const
474  { return saturatedGasDissolutionFactorTable_[regionIdx].eval(pressure, /*extrapolate=*/true); }
475 
483  template <class Evaluation>
484  Evaluation saturatedGasDissolutionFactor(unsigned regionIdx,
485  const Evaluation& /*temperature*/,
486  const Evaluation& pressure,
487  const Evaluation& oilSaturation,
488  Scalar maxOilSaturation) const
489  {
490  Evaluation tmp =
491  saturatedGasDissolutionFactorTable_[regionIdx].eval(pressure, /*extrapolate=*/true);
492 
493  // apply the vaporization parameters for the gas phase (cf. the Eclipse VAPPARS
494  // keyword)
495  maxOilSaturation = std::min(maxOilSaturation, Scalar(1.0));
496  if (vapPar2_ > 0.0 && maxOilSaturation > 0.01 && oilSaturation < maxOilSaturation) {
497  static const Scalar eps = 0.001;
498  const Evaluation& So = Opm::max(oilSaturation, eps);
499  tmp *= Opm::max(1e-3, Opm::pow(So/maxOilSaturation, vapPar2_));
500  }
501 
502  return tmp;
503  }
504 
511  template <class Evaluation>
512  Evaluation saturationPressure(unsigned regionIdx,
513  const Evaluation& temperature OPM_UNUSED,
514  const Evaluation& Rs) const
515  {
516  typedef Opm::MathToolbox<Evaluation> Toolbox;
517 
518  const auto& RsTable = saturatedGasDissolutionFactorTable_[regionIdx];
519  const Scalar eps = std::numeric_limits<typename Toolbox::Scalar>::epsilon()*1e6;
520 
521  // use the saturation pressure function to get a pretty good initial value
522  Evaluation pSat = saturationPressure_[regionIdx].eval(Rs, /*extrapolate=*/true);
523 
524  // Newton method to do the remaining work. If the initial
525  // value is good, this should only take two to three
526  // iterations...
527  bool onProbation = false;
528  for (int i = 0; i < 20; ++i) {
529  const Evaluation& f = RsTable.eval(pSat, /*extrapolate=*/true) - Rs;
530  const Evaluation& fPrime = RsTable.evalDerivative(pSat, /*extrapolate=*/true);
531 
532  // If the derivative is "zero" Newton will not converge,
533  // so simply return our initial guess.
534  if (std::abs(Opm::scalarValue(fPrime)) < 1.0e-30) {
535  return pSat;
536  }
537 
538  const Evaluation& delta = f/fPrime;
539 
540  pSat -= delta;
541 
542  if (pSat < 0.0) {
543  // if the pressure is lower than 0 Pascals, we set it back to 0. if this
544  // happens twice, we give up and just return 0 Pa...
545  if (onProbation)
546  return 0.0;
547 
548  onProbation = true;
549  pSat = 0.0;
550  }
551 
552  if (std::abs(Opm::scalarValue(delta)) < std::abs(Opm::scalarValue(pSat))*eps)
553  return pSat;
554  }
555 
556  std::stringstream errlog;
557  errlog << "Finding saturation pressure did not converge:"
558  << " pSat = " << pSat
559  << ", Rs = " << Rs;
560  OpmLog::debug("Live oil saturation pressure", errlog.str());
561  OPM_THROW_NOLOG(NumericalProblem, errlog.str());
562  }
563 
564 private:
565  void updateSaturationPressure_(unsigned regionIdx)
566  {
567  typedef std::pair<Scalar, Scalar> Pair;
568  const auto& gasDissolutionFac = saturatedGasDissolutionFactorTable_[regionIdx];
569 
570  // create the function representing saturation pressure depending of the mass
571  // fraction in gas
572  size_t n = gasDissolutionFac.numSamples();
573  Scalar delta = (gasDissolutionFac.xMax() - gasDissolutionFac.xMin())/Scalar(n + 1);
574 
575  SamplingPoints pSatSamplePoints;
576  Scalar Rs = 0;
577  for (size_t i=0; i <= n; ++ i) {
578  Scalar pSat = gasDissolutionFac.xMin() + Scalar(i)*delta;
579  Rs = saturatedGasDissolutionFactor(regionIdx,
580  /*temperature=*/Scalar(1e30),
581  pSat);
582 
583  Pair val(Rs, pSat);
584  pSatSamplePoints.push_back(val);
585  }
586 
587  //Prune duplicate Rs values (can occur, and will cause problems in further interpolation)
588  auto x_coord_comparator = [](const Pair& a, const Pair& b) { return a.first == b.first; };
589  auto last = std::unique(pSatSamplePoints.begin(), pSatSamplePoints.end(), x_coord_comparator);
590  pSatSamplePoints.erase(last, pSatSamplePoints.end());
591 
592  saturationPressure_[regionIdx].setContainerOfTuples(pSatSamplePoints);
593  }
594 
595  std::vector<Scalar> gasReferenceDensity_;
596  std::vector<Scalar> oilReferenceDensity_;
597  std::vector<TabulatedTwoDFunction> inverseOilBTable_;
598  std::vector<TabulatedTwoDFunction> oilMuTable_;
599  std::vector<TabulatedTwoDFunction> inverseOilBMuTable_;
600  std::vector<TabulatedOneDFunction> saturatedOilMuTable_;
601  std::vector<TabulatedOneDFunction> inverseSaturatedOilBTable_;
602  std::vector<TabulatedOneDFunction> inverseSaturatedOilBMuTable_;
603  std::vector<TabulatedOneDFunction> saturatedGasDissolutionFactorTable_;
604  std::vector<TabulatedOneDFunction> saturationPressure_;
605 
606  Scalar vapPar2_;
607 };
608 
609 } // namespace Opm
610 
611 #endif
Implements a scalar function that depends on two variables and which is sampled uniformly in the X di...
Evaluation saturationPressure(unsigned regionIdx, const Evaluation &temperature OPM_UNUSED, const Evaluation &Rs) const
Returns the saturation pressure of the oil phase [Pa] depending on its mass fraction of the gas compo...
Definition: LiveOilPvt.hpp:512
void setOilViscosity(unsigned regionIdx, const TabulatedTwoDFunction &muo)
Initialize the viscosity of the oil phase.
Definition: LiveOilPvt.hpp:321
Implements a scalar function that depends on two variables and which is sampled uniformly in the X di...
Definition: UniformXTabulated2DFunction.hpp:55
Evaluation saturatedInverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the formation volume factor [-] of the fluid phase.
Definition: LiveOilPvt.hpp:459
void initEnd()
Finish initializing the oil phase PVT properties.
Definition: LiveOilPvt.hpp:359
Evaluation inverseFormationVolumeFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure, const Evaluation &Rs) const
Returns the formation volume factor [-] of the fluid phase.
Definition: LiveOilPvt.hpp:446
This class represents the Pressure-Volume-Temperature relations of the oil phas with dissolved gas...
Definition: LiveOilPvt.hpp:49
Evaluation saturatedViscosity(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the dynamic viscosity [Pa s] of the fluid phase given a set of parameters.
Definition: LiveOilPvt.hpp:431
void setReferenceDensities(unsigned regionIdx, Scalar rhoRefOil, Scalar rhoRefGas, Scalar)
Initialize the reference densities of all fluids for a given PVT region.
Definition: LiveOilPvt.hpp:251
void setSaturatedOilViscosity(unsigned regionIdx, const SamplingPoints &samplePoints)
Initialize the phase viscosity for gas saturated oil.
Definition: LiveOilPvt.hpp:331
void setSaturatedOilFormationVolumeFactor(unsigned regionIdx, const SamplingPoints &samplePoints)
Initialize the function for the oil formation volume factor.
Definition: LiveOilPvt.hpp:277
void setSaturatedOilGasDissolutionFactor(unsigned regionIdx, const SamplingPoints &samplePoints)
Initialize the function for the gas dissolution factor .
Definition: LiveOilPvt.hpp:265
Definition: MathToolbox.hpp:48
Evaluation saturatedGasDissolutionFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure, const Evaluation &oilSaturation, Scalar maxOilSaturation) const
Returns the gas dissolution factor [m^3/m^3] of the oil phase.
Definition: LiveOilPvt.hpp:484
void setInverseOilFormationVolumeFactor(unsigned regionIdx, const TabulatedTwoDFunction &invBo)
Initialize the function for the oil formation volume factor.
Definition: LiveOilPvt.hpp:313
Evaluation viscosity(unsigned regionIdx, const Evaluation &, const Evaluation &pressure, const Evaluation &Rs) const
Returns the dynamic viscosity [Pa s] of the fluid phase given a set of parameters.
Definition: LiveOilPvt.hpp:415
Implements a linearly interpolated scalar function that depends on one variable.
A central place for various physical constants occuring in some equations.
This file provides a wrapper around the &quot;final&quot; C++-2011 statement.
Implements a linearly interpolated scalar function that depends on one variable.
Definition: Tabulated1DFunction.hpp:47
unsigned numRegions() const
Return the number of PVT regions which are considered by this PVT-object.
Definition: LiveOilPvt.hpp:408
Evaluation saturatedGasDissolutionFactor(unsigned regionIdx, const Evaluation &, const Evaluation &pressure) const
Returns the gas dissolution factor [m^3/m^3] of the oil phase.
Definition: LiveOilPvt.hpp:471