handle the ROCK keywords using the new opm-parser utility class

This commit is contained in:
Andreas Lauser 2014-02-05 15:23:05 +01:00
parent a107613687
commit 927530a26a

View File

@ -26,6 +26,7 @@
#include <opm/core/utility/linearInterpolation.hpp> #include <opm/core/utility/linearInterpolation.hpp>
#include <opm/parser/eclipse/Utility/RocktabTable.hpp> #include <opm/parser/eclipse/Utility/RocktabTable.hpp>
#include <opm/parser/eclipse/Utility/RockTable.hpp>
#include <iostream> #include <iostream>
@ -94,13 +95,12 @@ namespace Opm
poromult_ = rocktabTable.getPoreVolumeMultiplierColumn(); poromult_ = rocktabTable.getPoreVolumeMultiplierColumn();
transmult_ = rocktabTable.getTransmisibilityMultiplierColumn(); transmult_ = rocktabTable.getTransmisibilityMultiplierColumn();
} else if (newParserDeck->hasKeyword("ROCK")) { } else if (newParserDeck->hasKeyword("ROCK")) {
Opm::DeckKeywordConstPtr rockKeyword = newParserDeck->getKeyword("ROCK"); Opm::RockTable rockTable(newParserDeck->getKeyword("ROCK"));
if (rockKeyword->size() != 1) if (rockTable.numRows() != 1)
OPM_THROW(std::runtime_error, "Can only handle a single region in ROCK."); OPM_THROW(std::runtime_error, "Can only handle a single region in ROCK.");
Opm::DeckRecordConstPtr rockRecord = rockKeyword->getRecord(0); pref_ = rockTable.getPressureColumn()[0];
pref_ = rockRecord->getItem(0)->getSIDouble(0); rock_comp_ = rockTable.getCompressibilityColumn()[0];
rock_comp_ = rockRecord->getItem(1)->getSIDouble(0);
} else { } else {
std::cout << "**** warning: no rock compressibility data found in deck (ROCK or ROCKTAB)." << std::endl; std::cout << "**** warning: no rock compressibility data found in deck (ROCK or ROCKTAB)." << std::endl;
} }