Implement and use Runspec::nupcol().

This commit is contained in:
Atgeirr Flø Rasmussen
2020-06-10 14:55:20 +02:00
parent 80f6a5d1ed
commit 0c6d1c31d7
3 changed files with 27 additions and 3 deletions

View File

@@ -278,6 +278,7 @@ public:
const EclHysterConfig& hysterPar() const noexcept;
const Actdims& actdims() const noexcept;
const SatFuncControls& saturationFunctionControls() const noexcept;
int nupcol() const noexcept;
bool operator==(const Runspec& data) const;
@@ -305,6 +306,7 @@ private:
EclHysterConfig hystpar;
Actdims m_actdims;
SatFuncControls m_sfuncctrl;
int m_nupcol;
};

View File

@@ -20,10 +20,13 @@
#include <type_traits>
#include <opm/parser/eclipse/Deck/Deck.hpp>
#include <opm/parser/eclipse/Deck/DeckSection.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/N.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/S.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/T.hpp>
#include <opm/parser/eclipse/Parser/ParserKeywords/W.hpp>
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
#include <opm/common/OpmLog/OpmLog.hpp>
namespace Opm {
@@ -311,8 +314,22 @@ Runspec::Runspec( const Deck& deck ) :
udq_params( deck ),
hystpar( deck ),
m_actdims( deck ),
m_sfuncctrl( deck )
{}
m_sfuncctrl( deck ),
m_nupcol( ParserKeywords::NUPCOL::NUM_ITER::defaultValue )
{
if (DeckSection::hasRUNSPEC(deck)) {
const RUNSPECSection runspecSection{deck};
if (runspecSection.hasKeyword("NUPCOL")) {
using NC = ParserKeywords::NUPCOL;
const auto& item = runspecSection.getKeyword<NC>().getRecord(0).getItem<NC::NUM_ITER>();
m_nupcol = item.get<int>(0);
if (item.defaultApplied(0)) {
std::string msg = "OPM Flow uses 12 as default NUPCOL value";
OpmLog::note(msg);
}
}
}
}
Runspec Runspec::serializeObject()
{
@@ -366,6 +383,11 @@ const SatFuncControls& Runspec::saturationFunctionControls() const noexcept
return this->m_sfuncctrl;
}
int Runspec::nupcol() const noexcept
{
return this->m_nupcol;
}
/*
Returns an integer in the range 0...7 which can be used to indicate
available phases in Eclipse restart and init files.

View File

@@ -150,7 +150,7 @@ std::pair<std::time_t, std::size_t> restart_info(const RestartIO::RstState * rst
m_network(this->m_timeMap, std::make_shared<Network::ExtNetwork>()),
m_glo(this->m_timeMap, std::make_shared<GasLiftOpt>()),
rft_config(this->m_timeMap),
m_nupcol(this->m_timeMap, ParserKeywords::NUPCOL::NUM_ITER::defaultValue),
m_nupcol(this->m_timeMap, runspec.nupcol()),
restart_config(m_timeMap, deck, parseContext, errors),
rpt_config(this->m_timeMap, std::make_shared<RPTConfig>())
{