Skip to content

Commit

Permalink
Add support for GRUPSLAV keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
hakonhagland committed Sep 8, 2024
1 parent 3933ade commit d4a6597
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 13 deletions.
2 changes: 1 addition & 1 deletion opm/simulators/flow/FlowGenericVanguard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ void FlowGenericVanguard::readDeck(const std::string& filename)
modelParams_.actionState_,
modelParams_.wtestState_,
modelParams_.eclSummaryConfig_,
nullptr, "normal", "normal", "100", false, false, {});
nullptr, "normal", "normal", "100", false, false, {}, /*slaveMode=*/false);
modelParams_.setupTime_ = setupTimer.stop();
}

Expand Down
5 changes: 4 additions & 1 deletion opm/simulators/flow/FlowMain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ namespace Opm::Parameters {

// Do not merge parallel output files or warn about them
struct EnableLoggingFalloutWarning { static constexpr bool value = false; };

struct OutputInterval { static constexpr int value = 1; };
struct Slave { static constexpr bool value = false; };

} // namespace Opm::Parameters

Expand Down Expand Up @@ -102,6 +102,9 @@ namespace Opm {
"In that case it will be appended to the *.DBG or *.PRT files");

ThreadManager::registerParameters();
Parameters::Register<Parameters::Slave>
("Specify if the simulation is a slave simulation in a master-slave simulation");
Parameters::Hide<Parameters::Slave>();
Simulator::registerParameters();

// register the base parameters
Expand Down
4 changes: 3 additions & 1 deletion opm/simulators/flow/Main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ void Main::readDeck(const std::string& deckFilename,
const std::string& inputSkipMode,
const std::size_t numThreads,
const int output_param,
const bool slaveMode,
const std::string& parameters,
std::string_view moduleVersion,
std::string_view compileTimestamp)
Expand Down Expand Up @@ -238,7 +239,8 @@ void Main::readDeck(const std::string& deckFilename,
inputSkipMode,
init_from_restart_file,
outputCout_,
outputInterval);
outputInterval,
slaveMode);

verifyValidCellGeometry(FlowGenericVanguard::comm(), *this->eclipseState_);

Expand Down
12 changes: 12 additions & 0 deletions opm/simulators/flow/Main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,7 @@ class Main
try {
this->readDeck(deckFilename,
outputDir,
<<<<<<< HEAD
Parameters::Get<Parameters::OutputMode>(),
!Parameters::Get<Parameters::SchedRestart>(),
Parameters::Get<Parameters::EnableLoggingFalloutWarning>(),
Expand All @@ -425,6 +426,16 @@ class Main
Parameters::Get<Parameters::InputSkipMode>(),
getNumThreads(),
Parameters::Get<Parameters::EclOutputInterval>(),
=======
Parameters::get<PreTypeTag, Properties::OutputMode>(),
!Parameters::get<PreTypeTag, Properties::SchedRestart>(),
Parameters::get<PreTypeTag, Properties::EnableLoggingFalloutWarning>(),
Parameters::get<PreTypeTag, Properties::ParsingStrictness>(),
Parameters::get<PreTypeTag, Properties::InputSkipMode>(),
getNumThreads<PreTypeTag>(),
Parameters::get<PreTypeTag, Properties::EclOutputInterval>(),
Parameters::get<PreTypeTag, Properties::Slave>(),
>>>>>>> f322d7f66 (Add support for GRUPSLAV keyword)
cmdline_params,
Opm::moduleVersion(),
Opm::compileTimestamp());
Expand Down Expand Up @@ -701,6 +712,7 @@ class Main
const std::string& inputSkipMode,
const std::size_t numThreads,
const int output_param,
const bool slaveMode,
const std::string& parameters,
std::string_view moduleVersion,
std::string_view compileTimestamp);
Expand Down
1 change: 0 additions & 1 deletion opm/simulators/utils/UnsupportedFlowKeywords.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,6 @@ const KeywordValidation::UnsupportedKeywords& unsupportedKeywords()
{"GRAVDRM", {true, std::nullopt}},
{"GRDREACH", {true, std::nullopt}},
{"GRUPRIG", {true, std::nullopt}},
{"GRUPSLAV", {true, std::nullopt}},
{"GRUPTARG", {true, std::nullopt}},
{"GSATINJE", {true, std::nullopt}},
{"GSEPCOND", {true, std::nullopt}},
Expand Down
18 changes: 10 additions & 8 deletions opm/simulators/utils/readDeck.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ namespace {
if (schedule == nullptr) {
schedule = std::make_shared<Opm::Schedule>
(deck, eclipseState, parseContext, errorGuard,
std::move(python), lowActionParsingStrictness, outputInterval, init_state);
std::move(python), lowActionParsingStrictness, /*slaveMode=*/false, outputInterval, init_state);
}

// Read network pressures from restart
Expand All @@ -179,14 +179,14 @@ namespace {
std::unique_ptr<Opm::UDQState>& udqState,
std::unique_ptr<Opm::Action::State>& actionState,
std::unique_ptr<Opm::WellTestState>& wtestState,
Opm::ErrorGuard& errorGuard)
Opm::ErrorGuard& errorGuard,
const bool slaveMode)
{
if (schedule == nullptr) {
schedule = std::make_shared<Opm::Schedule>
(deck, eclipseState, parseContext,
errorGuard, std::move(python), lowActionParsingStrictness);
errorGuard, std::move(python), lowActionParsingStrictness, slaveMode);
}

udqState = std::make_unique<Opm::UDQState>
((*schedule)[0].udq().params().undefinedValue());

Expand Down Expand Up @@ -247,7 +247,8 @@ namespace {
const bool treatCriticalAsNonCritical,
const bool lowActionParsingStrictness,
const std::optional<int>& outputInterval,
Opm::ErrorGuard& errorGuard)
Opm::ErrorGuard& errorGuard,
const bool slaveMode)
{
OPM_TIMEBLOCK(readDeck);
if (((schedule == nullptr) || (summaryConfig == nullptr)) &&
Expand Down Expand Up @@ -279,7 +280,7 @@ namespace {
createNonRestartDynamicObjects(deck, *eclipseState, *parseContext,
lowActionParsingStrictness, std::move(python),
schedule, udqState, actionState, wtestState,
errorGuard);
errorGuard, slaveMode);
}

eclipseState->appendAqufluxSchedule(schedule->getAquiferFluxSchedule());
Expand Down Expand Up @@ -543,7 +544,8 @@ void Opm::readDeck(Opm::Parallel::Communication comm,
const std::string& inputSkipMode,
const bool initFromRestart,
const bool checkDeck,
const std::optional<int>& outputInterval)
const std::optional<int>& outputInterval,
const bool slaveMode)
{
auto errorGuard = std::make_unique<ErrorGuard>();

Expand Down Expand Up @@ -577,7 +579,7 @@ void Opm::readDeck(Opm::Parallel::Communication comm,
eclipseState, schedule, udqState, actionState, wtestState,
summaryConfig, std::move(python), initFromRestart,
checkDeck, treatCriticalAsNonCritical, lowActionParsingStrictness,
outputInterval, *errorGuard);
outputInterval, *errorGuard, slaveMode);

// Update schedule so that re-parsing after actions use same strictness
assert(schedule);
Expand Down
3 changes: 2 additions & 1 deletion opm/simulators/utils/readDeck.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ void readDeck(Parallel::Communication comm,
const std::string& inputSkipMode,
bool initFromRestart,
bool checkDeck,
const std::optional<int>& outputInterval);
const std::optional<int>& outputInterval,
bool slaveMode);

void verifyValidCellGeometry(Parallel::Communication comm,
const EclipseState& eclipseState);
Expand Down

0 comments on commit d4a6597

Please sign in to comment.