BlackoilPvtProperties.hpp
Go to the documentation of this file.
1 /*
2  Copyright 2012 SINTEF ICT, Applied Mathematics.
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 3 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 
20 #ifndef OPM_BLACKOILPVTPROPERTIES_HEADER_INCLUDED
21 #define OPM_BLACKOILPVTPROPERTIES_HEADER_INCLUDED
22 
25 
26 #include <opm/parser/eclipse/Deck/Deck.hpp>
27 #include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
28 
29 #include <string>
30 #include <memory>
31 #include <array>
32 
33 namespace Opm
34 {
35 
48  {
49  public:
52 
56  void init(Opm::DeckConstPtr deck,
57  Opm::EclipseStateConstPtr eclipseState,
58  int samples);
59 
61  PhaseUsage phaseUsage() const;
62 
64  int numPhases() const;
65 
69  const int* phaseUsed() const;
70 
74  const int* phasePosition() const;
75 
78  const double* surfaceDensities(int regionIdx = 0) const;
79 
81  void mu(const int n,
82  const int *pvtTableIdx,
83  const double* p,
84  const double* T,
85  const double* z,
86  double* output_mu) const;
87 
89  void B(const int n,
90  const int *pvtTableIdx,
91  const double* p,
92  const double* T,
93  const double* z,
94  double* output_B) const;
95 
97  void dBdp(const int n,
98  const int *pvtTableIdx,
99  const double* p,
100  const double* T,
101  const double* z,
102  double* output_B,
103  double* output_dBdp) const;
104 
106  void R(const int n,
107  const int *pvtTableIdx,
108  const double* p,
109  const double* z,
110  double* output_R) const;
111 
113  void dRdp(const int n,
114  const int *pvtTableIdx,
115  const double* p,
116  const double* z,
117  double* output_R,
118  double* output_dRdp) const;
119 
120  private:
121  // Disabling copying (just to avoid surprises, since we use shared_ptr).
123  BlackoilPvtProperties& operator=(const BlackoilPvtProperties&);
124 
125  PhaseUsage phase_usage_;
126 
127  // The PVT properties. We need to store one object per PVT
128  // region per active fluid phase.
129  std::vector<std::shared_ptr<PvtInterface> > props_;
130  std::vector<std::array<double, MaxNumPhases> > densities_;
131 
132  mutable std::vector<double> data1_;
133  mutable std::vector<double> data2_;
134  };
135 
136 }
137 
138 
139 
140 #endif // OPM_BLACKOILPVTPROPERTIES_HEADER_INCLUDED
void B(const int n, const int *pvtTableIdx, const double *p, const double *T, const double *z, double *output_B) const
Formation volume factor as a function of p, T and z.
const int * phasePosition() const
Definition: AnisotropicEikonal.hpp:43
Definition: BlackoilPhases.hpp:27
void dBdp(const int n, const int *pvtTableIdx, const double *p, const double *T, const double *z, double *output_B, double *output_dBdp) const
Formation volume factor and p-derivative as functions of p, T and z.
const int * phaseUsed() const
int numPhases() const
Number of active phases.
void mu(const int n, const int *pvtTableIdx, const double *p, const double *T, const double *z, double *output_mu) const
Viscosity as a function of p, T and z.
void R(const int n, const int *pvtTableIdx, const double *p, const double *z, double *output_R) const
Solution factor as a function of p and z.
Definition: BlackoilPvtProperties.hpp:47
void dRdp(const int n, const int *pvtTableIdx, const double *p, const double *z, double *output_R, double *output_dRdp) const
Solution factor and p-derivative as functions of p and z.
const double * surfaceDensities(int regionIdx=0) const
PhaseUsage phaseUsage() const
BlackoilPvtProperties()
Default constructor.
Definition: BlackoilPhases.hpp:36
void init(Opm::DeckConstPtr deck, Opm::EclipseStateConstPtr eclipseState, int samples)