All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Pages
BlackoilPropertiesFromDeck.hpp
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_BLACKOILPROPERTIESFROMDECK_HEADER_INCLUDED
21 #define OPM_BLACKOILPROPERTIESFROMDECK_HEADER_INCLUDED
22 
23 
24 #include <opm/core/props/BlackoilPropertiesInterface.hpp>
25 #include <opm/core/props/rock/RockFromDeck.hpp>
26 #include <opm/core/props/satfunc/SaturationPropsFromDeck.hpp>
27 #include <opm/core/utility/parameters/ParameterGroup.hpp>
28 #include <opm/material/fluidsystems/blackoilpvt/OilPvtMultiplexer.hpp>
29 #include <opm/material/fluidsystems/blackoilpvt/GasPvtMultiplexer.hpp>
30 #include <opm/material/fluidsystems/blackoilpvt/WaterPvtMultiplexer.hpp>
31 
32 #include <opm/parser/eclipse/Deck/Deck.hpp>
33 
34 #include <memory>
35 
36 struct UnstructuredGrid;
37 
38 namespace Opm
39 {
40 
44  {
45  public:
47 
53  BlackoilPropertiesFromDeck(const Opm::Deck& deck,
54  const Opm::EclipseState& eclState,
55  const UnstructuredGrid& grid, bool init_rock=true );
56 
68  BlackoilPropertiesFromDeck(const Opm::Deck& deck,
69  const Opm::EclipseState& eclState,
70  const UnstructuredGrid& grid,
71  const ParameterGroup& param,
72  bool init_rock=true);
73 
74  BlackoilPropertiesFromDeck(const Opm::Deck& deck,
75  const Opm::EclipseState& eclState,
76  int number_of_cells,
77  const int* global_cell,
78  const int* cart_dims,
79  bool init_rock=true);
80 
81  BlackoilPropertiesFromDeck(const Opm::Deck& deck,
82  const Opm::EclipseState& eclState,
83  int number_of_cells,
84  const int* global_cell,
85  const int* cart_dims,
86  const ParameterGroup& param,
87  bool init_rock=true);
88 
89  BlackoilPropertiesFromDeck(const Opm::Deck& deck,
90  const Opm::EclipseState& eclState,
91  std::shared_ptr<MaterialLawManager> materialLawManager,
92  int number_of_cells,
93  const int* global_cell,
94  const int* cart_dims,
95  const ParameterGroup& param,
96  bool init_rock=true);
97 
100 
101 
102  // ---- Rock interface ----
103 
105  virtual int numDimensions() const;
106 
108  virtual int numCells() const;
109 
112  virtual const int* cellPvtRegionIndex() const
113  { return &cellPvtRegionIdx_[0]; }
114 
116  virtual const double* porosity() const;
117 
121  virtual const double* permeability() const;
122 
123 
124  // ---- Fluid interface ----
125 
127  virtual int numPhases() const;
128 
130  virtual PhaseUsage phaseUsage() const;
131 
140  virtual void viscosity(const int n,
141  const double* p,
142  const double* T,
143  const double* z,
144  const int* cells,
145  double* mu,
146  double* dmudp) const;
147 
159  virtual void matrix(const int n,
160  const double* p,
161  const double* T,
162  const double* z,
163  const int* cells,
164  double* A,
165  double* dAdp) const;
166 
167 
176  virtual void density(const int n,
177  const double* A,
178  const int* cells,
179  double* rho) const;
180 
183  virtual const double* surfaceDensity(int cellIdx = 0) const;
184 
194  virtual void relperm(const int n,
195  const double* s,
196  const int* cells,
197  double* kr,
198  double* dkrds) const;
199 
200 
210  virtual void capPress(const int n,
211  const double* s,
212  const int* cells,
213  double* pc,
214  double* dpcds) const;
215 
216 
224  virtual void satRange(const int n,
225  const int* cells,
226  double* smin,
227  double* smax) const;
228 
229 
234  virtual void swatInitScaling(const int cell,
235  const double pcow,
236  double & swat);
237 
238  const OilPvtMultiplexer<double>& oilPvt() const
239  {
240  return oilPvt_;
241  }
242 
243  const GasPvtMultiplexer<double>& gasPvt() const
244  {
245  return gasPvt_;
246  }
247 
248  const WaterPvtMultiplexer<double>& waterPvt() const
249  {
250  return waterPvt_;
251  }
252 
253  private:
254  int getTableIndex_(const int* pvtTableIdx, int cellIdx) const
255  {
256  if (!pvtTableIdx)
257  return 0;
258  return pvtTableIdx[cellIdx];
259  }
260 
261  void initSurfaceDensities_(const Opm::Deck& deck);
262 
263  void compute_B_(const int n,
264  const double* p,
265  const double* T,
266  const double* z,
267  const int* cells,
268  double* B) const;
269 
270  void compute_dBdp_(const int n,
271  const double* p,
272  const double* T,
273  const double* z,
274  const int* cells,
275  double* B,
276  double* dBdp) const;
277 
278  void compute_R_(const int n,
279  const double* p,
280  const double* T,
281  const double* z,
282  const int* cells,
283  double* R) const;
284 
285  void compute_dRdp_(const int n,
286  const double* p,
287  const double* T,
288  const double* z,
289  const int* cells,
290  double* R,
291  double* dRdp) const;
292 
293  void init(const Opm::Deck& deck,
294  const Opm::EclipseState& eclState,
295  std::shared_ptr<MaterialLawManager> materialLawManager,
296  int number_of_cells,
297  const int* global_cell,
298  const int* cart_dims,
299  bool init_rock);
300 
301  void init(const Opm::Deck& deck,
302  const Opm::EclipseState& eclState,
303  std::shared_ptr<MaterialLawManager> materialLawManager,
304  int number_of_cells,
305  const int* global_cell,
306  const int* cart_dims,
307  const ParameterGroup& param,
308  bool init_rock);
309 
310  RockFromDeck rock_;
311  PhaseUsage phaseUsage_;
312  std::vector<int> cellPvtRegionIdx_;
313  OilPvtMultiplexer<double> oilPvt_;
314  GasPvtMultiplexer<double> gasPvt_;
315  WaterPvtMultiplexer<double> waterPvt_;
316  std::shared_ptr<MaterialLawManager> materialLawManager_;
317  std::shared_ptr<SaturationPropsInterface> satprops_;
318  std::vector<double> surfaceDensities_;
319  mutable std::vector<double> B_;
320  mutable std::vector<double> dB_;
321  mutable std::vector<double> R_;
322  mutable std::vector<double> dR_;
323  };
324 
325 
326 
327 } // namespace Opm
328 
329 #endif // OPM_BLACKOILPROPERTIESFROMDECK_HEADER_INCLUDED
virtual const double * porosity() const
Definition: BlackoilPropertiesFromDeck.cpp:200
BlackoilPropertiesFromDeck(const Opm::Deck &deck, const Opm::EclipseState &eclState, const UnstructuredGrid &grid, bool init_rock=true)
Initialize from deck and grid.
Definition: BlackoilPropertiesFromDeck.cpp:32
virtual void relperm(const int n, const double *s, const int *cells, double *kr, double *dkrds) const
Definition: BlackoilPropertiesFromDeck.cpp:730
virtual void capPress(const int n, const double *s, const int *cells, double *pc, double *dpcds) const
Definition: BlackoilPropertiesFromDeck.cpp:749
virtual int numCells() const
Definition: BlackoilPropertiesFromDeck.cpp:194
virtual void swatInitScaling(const int cell, const double pcow, double &swat)
Update capillary pressure scaling according to pressure diff.
Definition: BlackoilPropertiesFromDeck.cpp:779
virtual void satRange(const int n, const int *cells, double *smin, double *smax) const
Obtain the range of allowable saturation values.
Definition: BlackoilPropertiesFromDeck.cpp:766
virtual PhaseUsage phaseUsage() const
Definition: BlackoilPropertiesFromDeck.cpp:223
Concrete class implementing the blackoil property interface, reading all data and properties from ecl...
Definition: BlackoilPropertiesFromDeck.hpp:43
virtual int numDimensions() const
Definition: BlackoilPropertiesFromDeck.cpp:188
virtual const double * permeability() const
Definition: BlackoilPropertiesFromDeck.cpp:208
Abstract base class for blackoil fluid and reservoir properties.
Definition: BlackoilPropertiesInterface.hpp:37
Definition: BlackoilPhases.hpp:36
virtual ~BlackoilPropertiesFromDeck()
Destructor.
Definition: BlackoilPropertiesFromDeck.cpp:183
virtual void density(const int n, const double *A, const int *cells, double *rho) const
Densities of stock components at reservoir conditions.
Definition: BlackoilPropertiesFromDeck.cpp:665
virtual int numPhases() const
Definition: BlackoilPropertiesFromDeck.cpp:217
virtual void viscosity(const int n, const double *p, const double *T, const double *z, const int *cells, double *mu, double *dmudp) const
Definition: BlackoilPropertiesFromDeck.cpp:236
ParameterGroup is a class that is used to provide run-time parameters.
Definition: ParameterGroup.hpp:81
virtual const double * surfaceDensity(int cellIdx=0) const
Densities of stock components at surface conditions.
Definition: BlackoilPropertiesFromDeck.cpp:686
virtual const int * cellPvtRegionIndex() const
Return an array containing the PVT table index for each grid cell.
Definition: BlackoilPropertiesFromDeck.hpp:112
Definition: SaturationPropsFromDeck.hpp:43
virtual void matrix(const int n, const double *p, const double *T, const double *z, const int *cells, double *A, double *dAdp) const
Definition: BlackoilPropertiesFromDeck.cpp:302