Rock.hpp
1 /*
2  Copyright 2009, 2010 SINTEF ICT, Applied Mathematics.
3  Copyright 2009, 2010 Statoil ASA.
4 
5  This file is part of the Open Porous Media project (OPM).
6 
7  OPM is free software: you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  OPM is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with OPM. If not, see <http://www.gnu.org/licenses/>.
19 */
20 
21 #ifndef OPM_ROCK_HEADER_INCLUDED
22 #define OPM_ROCK_HEADER_INCLUDED
23 
24 #include <opm/porsol/common/Matrix.hpp>
25 #include <opm/porsol/common/ReservoirPropertyCommon.hpp>
26 
27 #include <opm/parser/eclipse/Deck/Deck.hpp>
28 
29 namespace Opm
30 {
31 
34  template <int dim>
35  class Rock
36  {
37  public:
39  typedef ImmutableCMatrix PermTensor;
43  typedef SharedCMatrix SharedPermTensor;
44 
45 
47  Rock();
48 
61  void init(const Opm::Deck& deck,
62  const std::vector<int>& global_cell,
63  const double perm_threshold = 0.0);
64 
69  void init(const int num_cells,
70  const double uniform_poro,
71  const double uniform_perm);
72 
73 
77  double porosity(int cell_index) const;
78 
82  PermTensor permeability(int cell_index) const;
83 
88 
89  protected:
90  // Methods
91  void assignPorosity(const Opm::Deck& deck,
92  const std::vector<int>& global_cell);
93  void assignPermeability(const Opm::Deck& deck,
94  const std::vector<int>& global_cell,
95  const double perm_threshold);
96 
97  // Data members.
98  std::vector<double> porosity_;
99  std::vector<double> permeability_;
100  std::vector<unsigned char> permfield_valid_;
101  PermeabilityKind permeability_kind_;
102  };
103 
104 
105 } // namespace Opm
106 
107 #include "Rock_impl.hpp"
108 
109 
110 #endif // OPM_ROCK_HEADER_INCLUDED
void init(const Opm::Deck &deck, const std::vector< int > &global_cell, const double perm_threshold=0.0)
Initialize from a grdecl file.
Definition: Rock_impl.hpp:44
PermeabilityKind
Enum for the kind of permeability field originally retrieved.
Definition: ReservoirPropertyCommon.hpp:50
FullMatrix< double, OwnData, COrdering > OwnCMatrix
Convenience typedefs for C-ordered.
Definition: Matrix.hpp:580
double porosity(int cell_index) const
Read-access to porosity.
Definition: Rock_impl.hpp:76
Class for immiscible dead oil and dry gas.
Definition: applier.hpp:18
Rock()
Default constructor.
Definition: Rock_impl.hpp:37
ImmutableCMatrix PermTensor
Tensor type for read-only access to permeability.
Definition: Rock.hpp:39
SharedCMatrix SharedPermTensor
Tensor type for read and write access to permeability.
Definition: Rock.hpp:43
SharedPermTensor permeabilityModifiable(int cell_index)
Read- and write-access to permeability.
Definition: Rock_impl.hpp:95
OwnCMatrix MutablePermTensor
Tensor type to be used for holding copies of permeability tensors.
Definition: Rock.hpp:41
PermTensor permeability(int cell_index) const
Read-access to permeability.
Definition: Rock_impl.hpp:84