2012-01-04 07:44:55 -06:00
|
|
|
/*
|
|
|
|
Copyright 2012 SINTEF ICT, Applied Mathematics.
|
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef OPM_ROCKFROMDECK_HEADER_INCLUDED
|
|
|
|
#define OPM_ROCKFROMDECK_HEADER_INCLUDED
|
|
|
|
|
2014-01-24 05:04:04 -06:00
|
|
|
#include <opm/parser/eclipse/Deck/Deck.hpp>
|
|
|
|
|
2012-01-05 08:38:50 -06:00
|
|
|
#include <vector>
|
|
|
|
|
2012-08-10 03:12:45 -05:00
|
|
|
struct UnstructuredGrid;
|
2012-01-05 08:38:50 -06:00
|
|
|
|
2012-01-04 07:44:55 -06:00
|
|
|
namespace Opm
|
|
|
|
{
|
|
|
|
|
|
|
|
class RockFromDeck
|
|
|
|
{
|
2012-01-05 08:38:50 -06:00
|
|
|
public:
|
|
|
|
/// Default constructor.
|
|
|
|
RockFromDeck();
|
|
|
|
|
2014-02-17 06:23:01 -06:00
|
|
|
/// Initialize from deck and cell mapping.
|
2014-02-19 08:22:18 -06:00
|
|
|
/// \param newParserDeck Deck produced by the opm-parser code
|
|
|
|
/// \param number_of_cells The number of cells in the grid.
|
|
|
|
/// \param global_cell The mapping fom local to global cell indices.
|
|
|
|
/// global_cell[i] is the corresponding global index of i.
|
|
|
|
/// \param cart_dims The size of the underlying cartesian grid.
|
2014-01-24 05:04:04 -06:00
|
|
|
void init(Opm::DeckConstPtr newParserDeck,
|
2014-02-19 08:22:18 -06:00
|
|
|
int number_of_cells, const int* global_cell,
|
|
|
|
const int* cart_dims);
|
2014-01-24 05:04:04 -06:00
|
|
|
|
2012-01-05 09:43:36 -06:00
|
|
|
/// \return D, the number of spatial dimensions. Always 3 for deck input.
|
2012-01-05 08:38:50 -06:00
|
|
|
int numDimensions() const
|
|
|
|
{
|
2012-01-05 09:43:36 -06:00
|
|
|
return 3;
|
2012-01-05 08:38:50 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
/// \return N, the number of cells.
|
|
|
|
int numCells() const
|
|
|
|
{
|
|
|
|
return porosity_.size();
|
|
|
|
}
|
|
|
|
|
|
|
|
/// \return Array of N porosity values.
|
|
|
|
const double* porosity() const
|
|
|
|
{
|
|
|
|
return &porosity_[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
/// \return Array of ND^2 permeability values.
|
|
|
|
/// The D^2 permeability values for a cell are organized as a matrix,
|
|
|
|
/// which is symmetric (so ordering does not matter).
|
|
|
|
const double* permeability() const
|
|
|
|
{
|
|
|
|
return &permeability_[0];
|
|
|
|
}
|
|
|
|
|
|
|
|
private:
|
2014-01-24 05:04:04 -06:00
|
|
|
void assignPorosity(Opm::DeckConstPtr newParserDeck,
|
2014-02-19 08:22:18 -06:00
|
|
|
int number_of_cells,
|
|
|
|
const int* global_cell);
|
2014-01-24 05:04:04 -06:00
|
|
|
void assignPermeability(Opm::DeckConstPtr newParserDeck,
|
2014-02-19 08:22:18 -06:00
|
|
|
int number_of_cells,
|
|
|
|
const int* global_cell,
|
|
|
|
const int* cart_dims,
|
2014-01-24 05:04:04 -06:00
|
|
|
double perm_threshold);
|
2012-01-05 09:43:36 -06:00
|
|
|
|
2012-01-05 08:38:50 -06:00
|
|
|
std::vector<double> porosity_;
|
|
|
|
std::vector<double> permeability_;
|
2012-01-05 09:43:36 -06:00
|
|
|
std::vector<unsigned char> permfield_valid_;
|
2012-01-04 07:44:55 -06:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} // namespace Opm
|
|
|
|
|
|
|
|
|
|
|
|
#endif // OPM_ROCKFROMDECK_HEADER_INCLUDED
|