Fixup: THPRESPR -> THRESHPR

This commit is contained in:
Joakim Hove
2018-09-05 14:28:01 +02:00
parent 6b93051616
commit 3e95d3f42b
2 changed files with 10 additions and 10 deletions

View File

@@ -58,12 +58,12 @@ namespace {
The RestartValue structure has an 'extra' container which can be used to
add extra fields to the restart file. The extra field is used both to add
OPM specific fields like 'OPMEXTRA', and eclipse standard fields like
THPRESPR. In the case of e.g. THPRESPR this should - if present - be added
THRESHPR. In the case of e.g. THRESHPR this should - if present - be added
in the SOLUTION section of the restart file. The std::set extra_solution
just enumerates the keys which should be in the solution section.
*/
static const std::set<std::string> extra_solution = {"THPRESPR"};
static const std::set<std::string> extra_solution = {"THRESHPR"};
@@ -580,13 +580,13 @@ void checkSaveArguments(const EclipseState& es,
// If the the THPRES option is active the restart_value should have a
// THPRES field. This is not enforced here because not all the opm
// simulators have been updated to include the THPRES values.
if (!restart_value.hasExtra("THPRESPR")) {
if (!restart_value.hasExtra("THRESHPR")) {
OpmLog::warning("This model has THPRES active - should have THPRES as part of restart data.");
return;
}
size_t num_regions = es.getTableManager().getEqldims().getNumEquilRegions();
const auto& thpres = restart_value.getExtra("THPRESPR");
const auto& thpres = restart_value.getExtra("THRESHPR");
if (thpres.size() != num_regions * num_regions)
throw std::runtime_error("THPRES vector has invalid size - should have num_region * num_regions.");
}

View File

@@ -593,7 +593,7 @@ BOOST_AUTO_TEST_CASE(STORE_THPRES) {
setup.schedule), std::runtime_error);
*/
restart_value.addExtra("THPRESPR", UnitSystem::measure::pressure, {0,1});
restart_value.addExtra("THRESHPR", UnitSystem::measure::pressure, {0,1});
/* THPRES data has wrong size in extra container. */
BOOST_CHECK_THROW( RestartIO::save("FILE.UNRST", 1 ,
100,
@@ -604,7 +604,7 @@ BOOST_AUTO_TEST_CASE(STORE_THPRES) {
int num_regions = setup.es.getTableManager().getEqldims().getNumEquilRegions();
std::vector<double> thpres(num_regions * num_regions, 78);
restart_value2.addExtra("THPRESPR", UnitSystem::measure::pressure, thpres);
restart_value2.addExtra("THRESHPR", UnitSystem::measure::pressure, thpres);
restart_value2.addExtra("EXTRA", UnitSystem::measure::pressure, thpres);
RestartIO::save("FILE2.UNRST", 1,
@@ -620,13 +620,13 @@ BOOST_AUTO_TEST_CASE(STORE_THPRES) {
for (int i=0; i < ecl_file_get_size(rst_file); i++)
kw_pos[ ecl_file_iget_header(rst_file, i ) ] = i;
BOOST_CHECK( kw_pos["STARTSOL"] < kw_pos["THPRESPR"] );
BOOST_CHECK( kw_pos["THPRESPR"] < kw_pos["ENDSOL"] );
BOOST_CHECK( kw_pos["STARTSOL"] < kw_pos["THRESHPR"] );
BOOST_CHECK( kw_pos["THRESHPR"] < kw_pos["ENDSOL"] );
BOOST_CHECK( kw_pos["ENDSOL"] < kw_pos["EXTRA"] );
BOOST_CHECK_EQUAL( ecl_file_get_num_named_kw(rst_file, "THPRESPR"), 1);
BOOST_CHECK_EQUAL( ecl_file_get_num_named_kw(rst_file, "THRESHPR"), 1);
BOOST_CHECK_EQUAL( ecl_file_get_num_named_kw(rst_file, "EXTRA"), 1);
BOOST_CHECK_EQUAL( ecl_kw_get_type(ecl_file_iget_named_kw(rst_file, "THPRESPR", 0)), ECL_DOUBLE_TYPE);
BOOST_CHECK_EQUAL( ecl_kw_get_type(ecl_file_iget_named_kw(rst_file, "THRESHPR", 0)), ECL_DOUBLE_TYPE);
ecl_file_close(rst_file);
}