mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
add variants of all methods which take a deck of the new parser to the rock properties
This commit is contained in:
@@ -25,6 +25,8 @@
|
||||
#include <opm/core/utility/ErrorMacros.hpp>
|
||||
#include <opm/core/utility/linearInterpolation.hpp>
|
||||
|
||||
#include <opm/parser/eclipse/Utility/SimpleTable.hpp>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace Opm
|
||||
@@ -65,6 +67,53 @@ namespace Opm
|
||||
}
|
||||
}
|
||||
|
||||
RockCompressibility::RockCompressibility(Opm::DeckConstPtr newParserDeck)
|
||||
: pref_(0.0),
|
||||
rock_comp_(0.0)
|
||||
{
|
||||
if (newParserDeck->hasKeyword("ROCKTAB")) {
|
||||
Opm::DeckKeywordConstPtr rtKeyword = newParserDeck->getKeyword("ROCKTAB");
|
||||
if (rtKeyword->size() != 1)
|
||||
OPM_THROW(std::runtime_error, "Can only handle a single region in ROCKTAB.");
|
||||
|
||||
std::vector<std::string> rtColumnNames
|
||||
{
|
||||
"PRESSURE",
|
||||
"POREVOL MULT",
|
||||
"TRANSMISC MULT"
|
||||
};
|
||||
if (newParserDeck->hasKeyword("RKTRMDIR"))
|
||||
{
|
||||
// the number of colums of the "ROCKTAB" keyword
|
||||
// depends on the presence of the "RKTRMDIR"
|
||||
// keyword. Messy stuff...
|
||||
rtColumnNames.push_back("TRANSMISC MULT Y");
|
||||
rtColumnNames.push_back("TRANSMISC MULT Z");
|
||||
|
||||
// well, okay. we don't support non-isotropic
|
||||
// transmiscibility multipliers yet
|
||||
OPM_THROW(std::runtime_error, "Support for non-isotropic "
|
||||
"transmiscibility multipliers is not implemented yet.");
|
||||
};
|
||||
|
||||
Opm::SimpleTable rtTable(rtKeyword, rtColumnNames);
|
||||
|
||||
p_ = rtTable.getColumn(0);
|
||||
poromult_ = rtTable.getColumn(1);
|
||||
transmult_ = rtTable.getColumn(2);
|
||||
} else if (newParserDeck->hasKeyword("ROCK")) {
|
||||
Opm::DeckKeywordConstPtr rockKeyword = newParserDeck->getKeyword("ROCK");
|
||||
if (rockKeyword->size() != 1)
|
||||
OPM_THROW(std::runtime_error, "Can only handle a single region in ROCK.");
|
||||
|
||||
Opm::DeckRecordConstPtr rockRecord = rockKeyword->getRecord(0);
|
||||
pref_ = rockRecord->getItem(0)->getSIDouble(0);
|
||||
rock_comp_ = rockRecord->getItem(1)->getSIDouble(0);
|
||||
} else {
|
||||
std::cout << "**** warning: no rock compressibility data found in deck (ROCK or ROCKTAB)." << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
bool RockCompressibility::isActive() const
|
||||
{
|
||||
return !p_.empty() || (rock_comp_ != 0.0);
|
||||
|
||||
Reference in New Issue
Block a user