mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Merge pull request #2343 from joakim-hove/move-rstconfig
RestartConfig has moved from EclipseState to Schedule
This commit is contained in:
commit
d3bfa83c7c
@ -327,7 +327,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!externalEclState_) {
|
if (!externalEclState_) {
|
||||||
internalEclState_.reset(new Opm::EclipseState(*deck_, *parseContext_, *errorGuard_));
|
internalEclState_.reset(new Opm::EclipseState(*deck_));
|
||||||
eclState_ = internalEclState_.get();
|
eclState_ = internalEclState_.get();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -375,7 +375,7 @@ public:
|
|||||||
// written to disk (every N report step)
|
// written to disk (every N report step)
|
||||||
int outputInterval = EWOMS_GET_PARAM(TypeTag, int, EclOutputInterval);
|
int outputInterval = EWOMS_GET_PARAM(TypeTag, int, EclOutputInterval);
|
||||||
if (outputInterval >= 0)
|
if (outputInterval >= 0)
|
||||||
eclState_->getRestartConfig().overrideRestartWriteInterval(outputInterval);
|
schedule().restart().overrideRestartWriteInterval(outputInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
@ -219,7 +219,7 @@ public:
|
|||||||
const Opm::SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig();
|
const Opm::SummaryConfig summaryConfig = simulator_.vanguard().summaryConfig();
|
||||||
|
|
||||||
// Only output RESTART_AUXILIARY asked for by the user.
|
// Only output RESTART_AUXILIARY asked for by the user.
|
||||||
const Opm::RestartConfig& restartConfig = simulator_.vanguard().eclState().getRestartConfig();
|
const Opm::RestartConfig& restartConfig = simulator_.vanguard().schedule().restart();
|
||||||
std::map<std::string, int> rstKeywords = restartConfig.getRestartKeywords(reportStepNum);
|
std::map<std::string, int> rstKeywords = restartConfig.getRestartKeywords(reportStepNum);
|
||||||
for (auto& keyValue: rstKeywords) {
|
for (auto& keyValue: rstKeywords) {
|
||||||
keyValue.second = restartConfig.getKeyword(keyValue.first, reportStepNum);
|
keyValue.second = restartConfig.getKeyword(keyValue.first, reportStepNum);
|
||||||
|
@ -350,7 +350,7 @@ int main(int argc, char** argv)
|
|||||||
if ( outputCout )
|
if ( outputCout )
|
||||||
Opm::checkDeck(*deck, parser, parseContext, errorGuard);
|
Opm::checkDeck(*deck, parser, parseContext, errorGuard);
|
||||||
|
|
||||||
eclipseState.reset( new Opm::EclipseState(*deck, parseContext, errorGuard ));
|
eclipseState.reset( new Opm::EclipseState(*deck));
|
||||||
if (mpiRank == 0) {
|
if (mpiRank == 0) {
|
||||||
schedule.reset(new Opm::Schedule(*deck, *eclipseState, parseContext, errorGuard));
|
schedule.reset(new Opm::Schedule(*deck, *eclipseState, parseContext, errorGuard));
|
||||||
setupMessageLimiter(schedule->getMessageLimits(), "STDOUT_LOGGER");
|
setupMessageLimiter(schedule->getMessageLimits(), "STDOUT_LOGGER");
|
||||||
|
@ -376,7 +376,7 @@ int mainFlow(int argc, char** argv)
|
|||||||
if ( outputCout )
|
if ( outputCout )
|
||||||
Opm::checkDeck(*deck, parser, parseContext, errorGuard);
|
Opm::checkDeck(*deck, parser, parseContext, errorGuard);
|
||||||
|
|
||||||
eclipseState.reset( new Opm::EclipseState(*deck, parseContext, errorGuard ));
|
eclipseState.reset( new Opm::EclipseState(*deck ));
|
||||||
schedule.reset(new Opm::Schedule(*deck, *eclipseState, parseContext, errorGuard));
|
schedule.reset(new Opm::Schedule(*deck, *eclipseState, parseContext, errorGuard));
|
||||||
summaryConfig.reset( new Opm::SummaryConfig(*deck, *schedule, eclipseState->getTableManager(), parseContext, errorGuard));
|
summaryConfig.reset( new Opm::SummaryConfig(*deck, *schedule, eclipseState->getTableManager(), parseContext, errorGuard));
|
||||||
setupMessageLimiter(schedule->getMessageLimits(), "STDOUT_LOGGER");
|
setupMessageLimiter(schedule->getMessageLimits(), "STDOUT_LOGGER");
|
||||||
|
@ -697,8 +697,7 @@ std::size_t packSize(const TimeMap& data, Dune::MPIHelper::MPICommunicator comm)
|
|||||||
|
|
||||||
std::size_t packSize(const RestartConfig& data, Dune::MPIHelper::MPICommunicator comm)
|
std::size_t packSize(const RestartConfig& data, Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
return packSize(data.ioConfig(), comm) +
|
return packSize(data.timeMap(), comm) +
|
||||||
packSize(data.timeMap(), comm) +
|
|
||||||
packSize(data.getFirstRestartStep(), comm) +
|
packSize(data.getFirstRestartStep(), comm) +
|
||||||
packSize(data.writeInitialRst(), comm) +
|
packSize(data.writeInitialRst(), comm) +
|
||||||
packSize(data.restartSchedule(), comm) +
|
packSize(data.restartSchedule(), comm) +
|
||||||
@ -1822,6 +1821,7 @@ std::size_t packSize(const Schedule& data,
|
|||||||
packSizeDynState(data.getActions(), comm) +
|
packSizeDynState(data.getActions(), comm) +
|
||||||
packSize(data.rftConfig(), comm) +
|
packSize(data.rftConfig(), comm) +
|
||||||
packSize(data.getNupCol(), comm) +
|
packSize(data.getNupCol(), comm) +
|
||||||
|
packSize(data.restart(), comm) +
|
||||||
packSize(data.getWellGroupEvents(), comm);
|
packSize(data.getWellGroupEvents(), comm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1981,7 +1981,7 @@ std::size_t packSize(const EclipseConfig& data,
|
|||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
return packSize(data.init(), comm) +
|
return packSize(data.init(), comm) +
|
||||||
packSize(data.restart(), comm);
|
packSize(data.io(), comm);
|
||||||
}
|
}
|
||||||
|
|
||||||
std::size_t packSize(const TransMult& data,
|
std::size_t packSize(const TransMult& data,
|
||||||
@ -2510,7 +2510,6 @@ void pack(const TimeMap& data, std::vector<char>& buffer, int& position,
|
|||||||
void pack(const RestartConfig& data, std::vector<char>& buffer, int& position,
|
void pack(const RestartConfig& data, std::vector<char>& buffer, int& position,
|
||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
pack(data.ioConfig(), buffer, position, comm);
|
|
||||||
pack(data.timeMap(), buffer, position, comm);
|
pack(data.timeMap(), buffer, position, comm);
|
||||||
pack(data.getFirstRestartStep(), buffer, position, comm);
|
pack(data.getFirstRestartStep(), buffer, position, comm);
|
||||||
pack(data.writeInitialRst(), buffer, position, comm);
|
pack(data.writeInitialRst(), buffer, position, comm);
|
||||||
@ -3668,6 +3667,7 @@ void pack(const Schedule& data,
|
|||||||
packDynState(data.getActions(), buffer, position, comm);
|
packDynState(data.getActions(), buffer, position, comm);
|
||||||
pack(data.rftConfig(), buffer, position, comm);
|
pack(data.rftConfig(), buffer, position, comm);
|
||||||
pack(data.getNupCol(), buffer, position, comm);
|
pack(data.getNupCol(), buffer, position, comm);
|
||||||
|
pack(data.restart(), buffer, position, comm);
|
||||||
pack(data.getWellGroupEvents(), buffer, position, comm);
|
pack(data.getWellGroupEvents(), buffer, position, comm);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -3844,7 +3844,7 @@ void pack(const EclipseConfig& data,
|
|||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
pack(data.init(), buffer, position, comm);
|
pack(data.init(), buffer, position, comm);
|
||||||
pack(data.restart(), buffer, position, comm);
|
pack(data.io(), buffer, position, comm);
|
||||||
}
|
}
|
||||||
|
|
||||||
void pack(const TransMult& data,
|
void pack(const TransMult& data,
|
||||||
@ -4557,21 +4557,19 @@ void unpack(TimeMap& data, std::vector<char>& buffer, int& position,
|
|||||||
void unpack(RestartConfig& data, std::vector<char>& buffer, int& position,
|
void unpack(RestartConfig& data, std::vector<char>& buffer, int& position,
|
||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
IOConfig ioConfig;
|
|
||||||
TimeMap timemap;
|
TimeMap timemap;
|
||||||
int firstRstStep;
|
int firstRstStep;
|
||||||
bool writeInitialRst;
|
bool writeInitialRst;
|
||||||
DynamicState<RestartSchedule> restart_sched;
|
DynamicState<RestartSchedule> restart_sched;
|
||||||
DynamicState<std::map<std::string,int>> restart_keyw;
|
DynamicState<std::map<std::string,int>> restart_keyw;
|
||||||
std::vector<bool> save_keyw;
|
std::vector<bool> save_keyw;
|
||||||
unpack(ioConfig, buffer, position, comm);
|
|
||||||
unpack(timemap, buffer, position, comm);
|
unpack(timemap, buffer, position, comm);
|
||||||
unpack(firstRstStep, buffer, position, comm);
|
unpack(firstRstStep, buffer, position, comm);
|
||||||
unpack(writeInitialRst, buffer, position, comm);
|
unpack(writeInitialRst, buffer, position, comm);
|
||||||
unpack(restart_sched, buffer, position, comm);
|
unpack(restart_sched, buffer, position, comm);
|
||||||
unpack(restart_keyw, buffer, position, comm);
|
unpack(restart_keyw, buffer, position, comm);
|
||||||
unpack(save_keyw, buffer, position, comm);
|
unpack(save_keyw, buffer, position, comm);
|
||||||
data = RestartConfig(ioConfig, timemap, firstRstStep, writeInitialRst, restart_sched,
|
data = RestartConfig(timemap, firstRstStep, writeInitialRst, restart_sched,
|
||||||
restart_keyw, save_keyw);
|
restart_keyw, save_keyw);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -6306,6 +6304,7 @@ void unpack(Schedule& data, std::vector<char>& buffer, int& position,
|
|||||||
DynamicState<std::shared_ptr<Action::Actions>> actions;
|
DynamicState<std::shared_ptr<Action::Actions>> actions;
|
||||||
RFTConfig rftConfig;
|
RFTConfig rftConfig;
|
||||||
DynamicState<int> nupCol;
|
DynamicState<int> nupCol;
|
||||||
|
RestartConfig restartConfig;
|
||||||
std::map<std::string,Events> wellGroupEvents;
|
std::map<std::string,Events> wellGroupEvents;
|
||||||
|
|
||||||
unpack(timeMap, buffer, position, comm);
|
unpack(timeMap, buffer, position, comm);
|
||||||
@ -6331,13 +6330,14 @@ void unpack(Schedule& data, std::vector<char>& buffer, int& position,
|
|||||||
|
|
||||||
unpack(rftConfig, buffer, position, comm);
|
unpack(rftConfig, buffer, position, comm);
|
||||||
unpack(nupCol, buffer, position, comm);
|
unpack(nupCol, buffer, position, comm);
|
||||||
|
unpack(restartConfig, buffer, position, comm);
|
||||||
unpack(wellGroupEvents, buffer, position, comm);
|
unpack(wellGroupEvents, buffer, position, comm);
|
||||||
data = Schedule(timeMap, staticWells, groups, oilVapProps, events,
|
data = Schedule(timeMap, staticWells, groups, oilVapProps, events,
|
||||||
modifierDeck, tuning, messageLimits, runspec,
|
modifierDeck, tuning, messageLimits, runspec,
|
||||||
vfpProdTables, vfpInjTables, wellTestConfig,
|
vfpProdTables, vfpInjTables, wellTestConfig,
|
||||||
wListManager, udqConfig, udqActive, guideRateConfig,
|
wListManager, udqConfig, udqActive, guideRateConfig,
|
||||||
gconSale, gconSump, globalWhistCtlMode, actions,
|
gconSale, gconSump, globalWhistCtlMode, actions,
|
||||||
rftConfig, nupCol, wellGroupEvents);
|
rftConfig, nupCol, restartConfig, wellGroupEvents);
|
||||||
}
|
}
|
||||||
|
|
||||||
void unpack(BrineDensityTable& data, std::vector<char>& buffer, int& position,
|
void unpack(BrineDensityTable& data, std::vector<char>& buffer, int& position,
|
||||||
@ -6576,11 +6576,11 @@ void unpack(EclipseConfig& data,
|
|||||||
Dune::MPIHelper::MPICommunicator comm)
|
Dune::MPIHelper::MPICommunicator comm)
|
||||||
{
|
{
|
||||||
InitConfig init;
|
InitConfig init;
|
||||||
RestartConfig restart;
|
IOConfig io;
|
||||||
|
|
||||||
unpack(init, buffer, position, comm);
|
unpack(init, buffer, position, comm);
|
||||||
unpack(restart, buffer, position, comm);
|
unpack(io, buffer, position, comm);
|
||||||
data = EclipseConfig(init, restart);
|
data = EclipseConfig(init, io);
|
||||||
}
|
}
|
||||||
|
|
||||||
void unpack(TransMult& data,
|
void unpack(TransMult& data,
|
||||||
|
@ -1251,7 +1251,7 @@ namespace Opm {
|
|||||||
computeAverageFormationFactor(B_avg);
|
computeAverageFormationFactor(B_avg);
|
||||||
|
|
||||||
const Opm::SummaryConfig& summaryConfig = ebosSimulator_.vanguard().summaryConfig();
|
const Opm::SummaryConfig& summaryConfig = ebosSimulator_.vanguard().summaryConfig();
|
||||||
const bool write_restart_file = ebosSimulator_.vanguard().eclState().getRestartConfig().getWriteRestartFile(reportStepIdx);
|
const bool write_restart_file = ebosSimulator_.vanguard().schedule().restart().getWriteRestartFile(reportStepIdx);
|
||||||
int exception_thrown = 0;
|
int exception_thrown = 0;
|
||||||
try {
|
try {
|
||||||
for (const auto& well : well_container_) {
|
for (const auto& well : well_container_) {
|
||||||
|
@ -254,6 +254,17 @@ Opm::TimeMap getTimeMap()
|
|||||||
return Opm::TimeMap({123});
|
return Opm::TimeMap({123});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Opm::RestartConfig getRestartConfig()
|
||||||
|
{
|
||||||
|
Opm::DynamicState<Opm::RestartSchedule> rsched({Opm::RestartSchedule(1, 2, 3)}, 2);
|
||||||
|
Opm::DynamicState<std::map<std::string,int>> rkw({{{"test",3}}}, 3);
|
||||||
|
Opm::IOConfig io(true, false, true, false, false, true, "test1", true,
|
||||||
|
"test2", true, "test3", false);
|
||||||
|
return Opm::RestartConfig(getTimeMap(), 1, true, rsched, rkw, {false, true});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Opm::PvtgTable getPvtgTable()
|
Opm::PvtgTable getPvtgTable()
|
||||||
{
|
{
|
||||||
return Opm::PvtgTable(Opm::ColumnSchema("test1", Opm::Table::INCREASING,
|
return Opm::PvtgTable(Opm::ColumnSchema("test1", Opm::Table::INCREASING,
|
||||||
@ -840,7 +851,7 @@ BOOST_AUTO_TEST_CASE(RestartConfig)
|
|||||||
Opm::DynamicState<std::map<std::string,int>> rkw({{{"test",3}}}, 3);
|
Opm::DynamicState<std::map<std::string,int>> rkw({{{"test",3}}}, 3);
|
||||||
Opm::IOConfig io(true, false, true, false, false, true, "test1", true,
|
Opm::IOConfig io(true, false, true, false, false, true, "test1", true,
|
||||||
"test2", true, "test3", false);
|
"test2", true, "test3", false);
|
||||||
Opm::RestartConfig val1(io, getTimeMap(), 1, true, rsched, rkw, {false, true});
|
Opm::RestartConfig val1(getTimeMap(), 1, true, rsched, rkw, {false, true});
|
||||||
auto val2 = PackUnpack(val1);
|
auto val2 = PackUnpack(val1);
|
||||||
DO_CHECKS(RestartConfig)
|
DO_CHECKS(RestartConfig)
|
||||||
#endif
|
#endif
|
||||||
@ -2282,6 +2293,7 @@ BOOST_AUTO_TEST_CASE(Schedule)
|
|||||||
{{std::make_shared<Opm::Action::Actions>(acnts)}, 1},
|
{{std::make_shared<Opm::Action::Actions>(acnts)}, 1},
|
||||||
rftc,
|
rftc,
|
||||||
{std::vector<int>{1}, 1},
|
{std::vector<int>{1}, 1},
|
||||||
|
getRestartConfig(),
|
||||||
{{"test", events}});
|
{{"test", events}});
|
||||||
|
|
||||||
auto val2 = PackUnpack(val1);
|
auto val2 = PackUnpack(val1);
|
||||||
@ -2388,10 +2400,7 @@ BOOST_AUTO_TEST_CASE(EclipseConfig)
|
|||||||
Opm::InitConfig init(Opm::Equil({getEquilRecord(), getEquilRecord()}),
|
Opm::InitConfig init(Opm::Equil({getEquilRecord(), getEquilRecord()}),
|
||||||
Opm::FoamConfig({getFoamData(), getFoamData()}),
|
Opm::FoamConfig({getFoamData(), getFoamData()}),
|
||||||
true, true, true, 20, "test1");
|
true, true, true, 20, "test1");
|
||||||
Opm::DynamicState<Opm::RestartSchedule> rsched({Opm::RestartSchedule(1, 2, 3)}, 2);
|
Opm::EclipseConfig val1{init, io};
|
||||||
Opm::DynamicState<std::map<std::string,int>> rkw({{{"test",3}}}, 3);
|
|
||||||
Opm::RestartConfig restart(io, getTimeMap(), 1, true, rsched, rkw, {false, true});
|
|
||||||
Opm::EclipseConfig val1{init, restart};
|
|
||||||
|
|
||||||
auto val2 = PackUnpack(val1);
|
auto val2 = PackUnpack(val1);
|
||||||
DO_CHECKS(EclipseConfig)
|
DO_CHECKS(EclipseConfig)
|
||||||
|
@ -279,7 +279,7 @@ BOOST_AUTO_TEST_CASE( Test_Norne_PVT) {
|
|||||||
|
|
||||||
auto deck = parser.parseFile("norne_pvt.data", parseContext, errorGuard);
|
auto deck = parser.parseFile("norne_pvt.data", parseContext, errorGuard);
|
||||||
|
|
||||||
Opm::EclipseState eclState(deck, parseContext, errorGuard);
|
Opm::EclipseState eclState(deck);
|
||||||
|
|
||||||
verify_norne_oil_pvt_region1( deck, eclState );
|
verify_norne_oil_pvt_region1( deck, eclState );
|
||||||
verify_norne_oil_pvt_region2( deck, eclState );
|
verify_norne_oil_pvt_region2( deck, eclState );
|
||||||
|
@ -35,11 +35,9 @@
|
|||||||
#include <opm/common/utility/platform_dependent/reenable_warnings.h>
|
#include <opm/common/utility/platform_dependent/reenable_warnings.h>
|
||||||
|
|
||||||
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
#include <opm/parser/eclipse/Parser/Parser.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/checkDeck.hpp>
|
#include <opm/parser/eclipse/Parser/ParseContext.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/EclipseState.hpp>
|
#include <opm/parser/eclipse/Parser/ErrorGuard.hpp>
|
||||||
#include <opm/parser/eclipse/EclipseState/Schedule/VFPProdTable.hpp>
|
|
||||||
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
|
#include <opm/parser/eclipse/Units/UnitSystem.hpp>
|
||||||
|
|
||||||
#include <opm/simulators/wells/VFPHelpers.hpp>
|
#include <opm/simulators/wells/VFPHelpers.hpp>
|
||||||
#include <opm/simulators/wells/VFPProdProperties.hpp>
|
#include <opm/simulators/wells/VFPProdProperties.hpp>
|
||||||
|
|
||||||
@ -593,12 +591,7 @@ VFPPROD \n\
|
|||||||
auto units = Opm::UnitSystem::newFIELD();
|
auto units = Opm::UnitSystem::newFIELD();
|
||||||
Opm::Parser parser;
|
Opm::Parser parser;
|
||||||
auto deck = parser.parseString(table_str);
|
auto deck = parser.parseString(table_str);
|
||||||
|
|
||||||
BOOST_REQUIRE(deck.hasKeyword("VFPPROD"));
|
|
||||||
BOOST_CHECK_EQUAL(deck.count("VFPPROD"), 1);
|
|
||||||
|
|
||||||
Opm::VFPProdTable table(deck.getKeyword("VFPPROD", 0), units);
|
Opm::VFPProdTable table(deck.getKeyword("VFPPROD", 0), units);
|
||||||
|
|
||||||
Opm::VFPProdProperties properties(&table);
|
Opm::VFPProdProperties properties(&table);
|
||||||
|
|
||||||
const int n = 5; //Number of points to check per axis
|
const int n = 5; //Number of points to check per axis
|
||||||
@ -655,7 +648,6 @@ BOOST_AUTO_TEST_CASE(ParseInterpolateRealisticVFPPROD)
|
|||||||
Opm::filesystem::path file("VFPPROD2");
|
Opm::filesystem::path file("VFPPROD2");
|
||||||
|
|
||||||
auto deck = parser.parseFile(file.string());
|
auto deck = parser.parseFile(file.string());
|
||||||
Opm::checkDeck(deck, parser, parseContext, errorGuard);
|
|
||||||
|
|
||||||
BOOST_REQUIRE(deck.hasKeyword("VFPPROD"));
|
BOOST_REQUIRE(deck.hasKeyword("VFPPROD"));
|
||||||
BOOST_CHECK_EQUAL(deck.count("VFPPROD"), 1);
|
BOOST_CHECK_EQUAL(deck.count("VFPPROD"), 1);
|
||||||
|
Loading…
Reference in New Issue
Block a user