Remove unused argument sim_time from Schedule::applyAction()

This commit is contained in:
Joakim Hove 2022-01-20 08:12:10 +01:00
parent c680443251
commit b62b5be44f
4 changed files with 11 additions and 14 deletions

View File

@ -86,7 +86,7 @@ void msim::post_step(Schedule& schedule, SummaryState& st, data::Solution& /* so
for (const auto& action : actions.pending(this->action_state, std::chrono::system_clock::to_time_t(sim_time))) {
auto result = action->eval(context);
if (result)
schedule.applyAction(report_step, sim_time, *action, result, {});
schedule.applyAction(report_step, *action, result, {});
}
for (const auto& pyaction : actions.pending_python())

View File

@ -279,7 +279,7 @@ namespace Opm
bool write_rst_file(std::size_t report_step) const;
const std::map< std::string, int >& rst_keywords( size_t timestep ) const;
SimulatorUpdate applyAction(std::size_t reportStep, const time_point& sim_time, const Action::ActionX& action, const Action::Result& result, const std::unordered_map<std::string, double>& wellpi);
SimulatorUpdate applyAction(std::size_t reportStep, const Action::ActionX& action, const Action::Result& result, const std::unordered_map<std::string, double>& wellpi);
void applyWellProdIndexScaling(const std::string& well_name, const std::size_t reportStep, const double scalingFactor);

View File

@ -1290,7 +1290,7 @@ File {} line {}.)", pattern, location.keyword, location.filename, location.linen
}
SimulatorUpdate Schedule::applyAction(std::size_t reportStep, const time_point&, const Action::ActionX& action, const Action::Result& result, const std::unordered_map<std::string, double>& target_wellpi) {
SimulatorUpdate Schedule::applyAction(std::size_t reportStep, const Action::ActionX& action, const Action::Result& result, const std::unordered_map<std::string, double>& target_wellpi) {
const std::string prefix = "| ";
ParseContext parseContext;
ErrorGuard errors;

View File

@ -157,9 +157,8 @@ TSTEP
BOOST_CHECK( sched.hasWell("W2"));
Action::Result action_result(true);
auto sim_time = TimeService::now();
const auto& action1 = sched[0].actions.get()["ACTION"];
auto sim_update = sched.applyAction(0, sim_time, action1, action_result, {});
auto sim_update = sched.applyAction(0, action1, action_result, {});
const auto& affected_wells = sim_update.affected_wells;
std::vector<std::string> expected_wells{"W0", "W1", "W3"};
BOOST_CHECK( std::is_permutation(affected_wells.begin(), affected_wells.end(),
@ -224,9 +223,8 @@ COMPDAT
Schedule sched = make_schedule(TRAILING_COMPDAT);
Action::Result action_result(true);
auto sim_time = TimeService::now();
const auto& action1 = sched[0].actions.get()["ACTION"];
BOOST_CHECK_NO_THROW( sched.applyAction(0, sim_time, action1, Action::Result{true}, {}));
BOOST_CHECK_NO_THROW( sched.applyAction(0, action1, Action::Result{true}, {}));
}
@ -1139,8 +1137,7 @@ TSTEP
Action::Result action_result(true);
auto sim_time = TimeService::now();
sched.applyAction(0, sim_time, action1, action_result, {});
sched.applyAction(0, action1, action_result, {});
{
const auto& group = sched.getGroup("G1", 1);
@ -1255,7 +1252,7 @@ TSTEP
Action::Result action_result(true);
const auto& sim_update = sched.applyAction(0, TimeService::now(), action1, action_result, {});
const auto& sim_update = sched.applyAction(0, action1, action_result, {});
BOOST_CHECK( sim_update.affected_wells.empty() );
{
const auto& glo = sched.glo(0);
@ -1329,7 +1326,7 @@ TSTEP
BOOST_CHECK(!sched.hasWell("PROD1"));
Action::Result action_result(true);
sched.applyAction(0, TimeService::now(), action1, action_result, {});
sched.applyAction(0, action1, action_result, {});
const auto& well = sched.getWell("PROD1", 1);
const auto& connections = well.getConnections();
@ -1391,10 +1388,10 @@ TSTEP
Action::Result action_result(true);
BOOST_CHECK_THROW( sched.applyAction(0, TimeService::now(), action1, action_result, {}), std::exception);
BOOST_CHECK_THROW( sched.applyAction(0, action1, action_result, {}), std::exception);
{
const auto& well = sched.getWell("PROD1", 0);
const auto& sim_update = sched.applyAction(0, TimeService::now(), action1, action_result, {{"PROD1", well.convertDeckPI(500)}});
const auto& sim_update = sched.applyAction(0, action1, action_result, {{"PROD1", well.convertDeckPI(500)}});
BOOST_CHECK_EQUAL( sim_update.affected_wells.count("PROD1"), 1);
BOOST_CHECK_EQUAL( sim_update.affected_wells.size(), 1);
}
@ -1464,7 +1461,7 @@ TSTEP
BOOST_CHECK(sched[0].geo_keywords().empty());
Action::Result action_result(true);
auto sim_update = sched.applyAction(0, TimeService::now(), action1, action_result, {});
auto sim_update = sched.applyAction(0, action1, action_result, {});
BOOST_CHECK( sim_update.tran_update );
BOOST_CHECK_EQUAL(sched[0].geo_keywords().size(), 3);
}