BlackoilPropertiesFromDeck.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_BLACKOILPROPERTIESFROMDECK_HEADER_INCLUDED
21 #define OPM_BLACKOILPROPERTIESFROMDECK_HEADER_INCLUDED
22 
23 
29 
30 #include <opm/parser/eclipse/Deck/Deck.hpp>
31 
32 #include <memory>
33 
34 struct UnstructuredGrid;
35 
36 namespace Opm
37 {
38 
42  {
43  public:
45 
51  BlackoilPropertiesFromDeck(Opm::DeckConstPtr deck,
52  Opm::EclipseStateConstPtr eclState,
53  const UnstructuredGrid& grid, bool init_rock=true );
54 
66  BlackoilPropertiesFromDeck(Opm::DeckConstPtr deck,
67  Opm::EclipseStateConstPtr eclState,
68  const UnstructuredGrid& grid,
69  const parameter::ParameterGroup& param,
70  bool init_rock=true);
71 
72  BlackoilPropertiesFromDeck(Opm::DeckConstPtr deck,
73  Opm::EclipseStateConstPtr eclState,
74  int number_of_cells,
75  const int* global_cell,
76  const int* cart_dims,
77  bool init_rock=true);
78 
79  BlackoilPropertiesFromDeck(Opm::DeckConstPtr deck,
80  Opm::EclipseStateConstPtr eclState,
81  int number_of_cells,
82  const int* global_cell,
83  const int* cart_dims,
84  const parameter::ParameterGroup& param,
85  bool init_rock=true);
86 
87  BlackoilPropertiesFromDeck(Opm::DeckConstPtr deck,
88  Opm::EclipseStateConstPtr eclState,
89  std::shared_ptr<MaterialLawManager> materialLawManager,
90  int number_of_cells,
91  const int* global_cell,
92  const int* cart_dims,
93  const parameter::ParameterGroup& param,
94  bool init_rock=true);
95 
98 
99 
100  // ---- Rock interface ----
101 
103  virtual int numDimensions() const;
104 
106  virtual int numCells() const;
107 
110  virtual const int* cellPvtRegionIndex() const
111  { return &cellPvtRegionIdx_[0]; }
112 
114  virtual const double* porosity() const;
115 
119  virtual const double* permeability() const;
120 
121 
122  // ---- Fluid interface ----
123 
125  virtual int numPhases() const;
126 
128  virtual PhaseUsage phaseUsage() const;
129 
138  virtual void viscosity(const int n,
139  const double* p,
140  const double* T,
141  const double* z,
142  const int* cells,
143  double* mu,
144  double* dmudp) const;
145 
157  virtual void matrix(const int n,
158  const double* p,
159  const double* T,
160  const double* z,
161  const int* cells,
162  double* A,
163  double* dAdp) const;
164 
165 
174  virtual void density(const int n,
175  const double* A,
176  const int* cells,
177  double* rho) const;
178 
181  virtual const double* surfaceDensity(int cellIdx = 0) const;
182 
192  virtual void relperm(const int n,
193  const double* s,
194  const int* cells,
195  double* kr,
196  double* dkrds) const;
197 
198 
208  virtual void capPress(const int n,
209  const double* s,
210  const int* cells,
211  double* pc,
212  double* dpcds) const;
213 
214 
222  virtual void satRange(const int n,
223  const int* cells,
224  double* smin,
225  double* smax) const;
226 
227 
232  virtual void swatInitScaling(const int cell,
233  const double pcow,
234  double & swat);
235 
236  private:
237  int getTableIndex_(const int* pvtTableIdx, int cellIdx) const
238  {
239  if (!pvtTableIdx)
240  return 0;
241  return pvtTableIdx[cellIdx];
242  }
243 
244  void init(Opm::DeckConstPtr deck,
245  Opm::EclipseStateConstPtr eclState,
246  std::shared_ptr<MaterialLawManager> materialLawManager,
247  int number_of_cells,
248  const int* global_cell,
249  const int* cart_dims,
250  bool init_rock);
251 
252  void init(Opm::DeckConstPtr deck,
253  Opm::EclipseStateConstPtr eclState,
254  std::shared_ptr<MaterialLawManager> materialLawManager,
255  int number_of_cells,
256  const int* global_cell,
257  const int* cart_dims,
258  const parameter::ParameterGroup& param,
259  bool init_rock);
260 
261  RockFromDeck rock_;
262  std::vector<int> cellPvtRegionIdx_;
263  BlackoilPvtProperties pvt_;
264  std::shared_ptr<MaterialLawManager> materialLawManager_;
265  std::shared_ptr<SaturationPropsInterface> satprops_;
266  mutable std::vector<double> B_;
267  mutable std::vector<double> dB_;
268  mutable std::vector<double> R_;
269  mutable std::vector<double> dR_;
270  };
271 
272 
273 
274 } // namespace Opm
275 
276 #endif // OPM_BLACKOILPROPERTIESFROMDECK_HEADER_INCLUDED
virtual const double * surfaceDensity(int cellIdx=0) const
BlackoilPropertiesFromDeck(Opm::DeckConstPtr deck, Opm::EclipseStateConstPtr eclState, const UnstructuredGrid &grid, bool init_rock=true)
Definition: grid.h:98
virtual void swatInitScaling(const int cell, const double pcow, double &swat)
virtual const double * permeability() const
Definition: AnisotropicEikonal.hpp:43
Definition: BlackoilPropertiesFromDeck.hpp:41
Definition: ParameterGroup.hpp:109
virtual int numCells() const
virtual ~BlackoilPropertiesFromDeck()
Destructor.
virtual PhaseUsage phaseUsage() const
virtual int numDimensions() const
SaturationPropsFromDeck::MaterialLawManager MaterialLawManager
Definition: BlackoilPropertiesFromDeck.hpp:44
virtual void relperm(const int n, const double *s, const int *cells, double *kr, double *dkrds) const
Definition: BlackoilPropertiesInterface.hpp:37
virtual void viscosity(const int n, const double *p, const double *T, const double *z, const int *cells, double *mu, double *dmudp) const
virtual int numPhases() const
virtual void matrix(const int n, const double *p, const double *T, const double *z, const int *cells, double *A, double *dAdp) const
virtual void density(const int n, const double *A, const int *cells, double *rho) const
virtual const int * cellPvtRegionIndex() const
Definition: BlackoilPropertiesFromDeck.hpp:110
virtual void satRange(const int n, const int *cells, double *smin, double *smax) const
Definition: SaturationPropsFromDeck.hpp:43
virtual void capPress(const int n, const double *s, const int *cells, double *pc, double *dpcds) const
virtual const double * porosity() const
const UnstructuredGrid & grid
Definition: ColumnExtract.hpp:31
Definition: BlackoilPhases.hpp:36