SaturationPropsFromDeck: add the code to calculate all saturation properties using opm-material

also remove the now obsolete code in that class.
This commit is contained in:
Andreas Lauser
2015-07-28 17:28:51 +02:00
parent 97f62d5f6f
commit 4a81a0acf1
5 changed files with 177 additions and 744 deletions

View File

@@ -32,7 +32,20 @@ namespace Opm
{
rock_.init(eclState, grid.number_of_cells, grid.global_cell, grid.cartdims);
pvt_.init(deck);
satprops_.init(deck, eclState, grid);
auto materialLawManager = std::make_shared<typename SaturationPropsFromDeck::MaterialLawManager>();
std::vector<int> compressedToCartesianIdx(grid.number_of_cells);
for (unsigned cellIdx = 0; cellIdx < grid.number_of_cells; ++cellIdx) {
if (grid.global_cell) {
compressedToCartesianIdx[cellIdx] = grid.global_cell[cellIdx];
}
else {
compressedToCartesianIdx[cellIdx] = cellIdx;
}
}
materialLawManager->initFromDeck(deck, eclState, compressedToCartesianIdx);
satprops_.init(deck, eclState, materialLawManager, grid);
if (pvt_.numPhases() != satprops_.numPhases()) {
OPM_THROW(std::runtime_error, "IncompPropertiesFromDeck::IncompPropertiesFromDeck() - Inconsistent number of phases in pvt data ("
<< pvt_.numPhases() << ") and saturation-dependent function data (" << satprops_.numPhases() << ").");