Skip to content

Commit

Permalink
Add TUNING_CHANGE event for TUNING
Browse files Browse the repository at this point in the history
  • Loading branch information
totto82 committed Nov 23, 2017
1 parent bce1f98 commit 1ee7cb7
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
2 changes: 2 additions & 0 deletions lib/eclipse/EclipseState/Schedule/Schedule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1202,6 +1202,8 @@ namespace Opm {
this->m_tuning.setXXXDPR(currentStep, XXXDPR);
}
}
m_events.addEvent( ScheduleEvents::TUNING_CHANGE , currentStep);

}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,12 @@ namespace Opm
/*
Geology modifier.
*/
GEO_MODIFIER = 1024
GEO_MODIFIER = 1024,

/*
TUNING has changed
*/
TUNING_CHANGE = 2048
};
}

Expand Down
9 changes: 7 additions & 2 deletions lib/eclipse/tests/TuningTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,15 @@ BOOST_AUTO_TEST_CASE(TuningTest) {
Eclipse3DProperties eclipseProperties ( deck , table, grid);
Schedule schedule( deck, grid , eclipseProperties, Phases(true, true, true) , ParseContext());
auto tuning = schedule.getTuning();

auto event = schedule.getEvents();

const double diff = 1.0e-14;

/*** TIMESTEP 4***/
/********* Record 1 ***********/
size_t timestep = 4;
BOOST_CHECK(!event.hasEvent(ScheduleEvents::TUNING_CHANGE, timestep));

double TSINIT_default = tuning.getTSINIT(timestep);
BOOST_CHECK_CLOSE(TSINIT_default, 1 * Metric::Time, diff);

Expand Down Expand Up @@ -197,6 +199,7 @@ BOOST_AUTO_TEST_CASE(TuningTest) {
/*** TIMESTEP 5***/
/********* Record 1 ***********/
timestep = 5;
BOOST_CHECK(event.hasEvent(ScheduleEvents::TUNING_CHANGE, timestep));
double TSINIT = tuning.getTSINIT(timestep);
BOOST_CHECK_CLOSE(TSINIT, 2 * Metric::Time, diff);

Expand Down Expand Up @@ -305,11 +308,13 @@ BOOST_AUTO_TEST_CASE(TuningTest) {
BOOST_CHECK_CLOSE(XXXDPR, 1.0 * Metric::Pressure, diff);



/*** TIMESTEP 7 ***/
BOOST_CHECK(!event.hasEvent(ScheduleEvents::TUNING_CHANGE, 7));

/*** TIMESTEP 10 ***/
/********* Record 1 ***********/
timestep = 10;
BOOST_CHECK(event.hasEvent(ScheduleEvents::TUNING_CHANGE, timestep));
TMAXWC_has_value = tuning.getTMAXWChasValue(timestep);
TMAXWC_default = tuning.getTMAXWC(timestep);
BOOST_CHECK_EQUAL(true, TMAXWC_has_value);
Expand Down

0 comments on commit 1ee7cb7

Please sign in to comment.