RWIP support

This commit is contained in:
Jørgen Kvalsvik 2016-11-08 14:43:19 +01:00 committed by jokva
parent 7866e38c19
commit d16436913c
2 changed files with 10 additions and 0 deletions

View File

@ -371,6 +371,10 @@ quantity rgip(const fn_args& args) {
return region_sum( args , "GIP", measure::volume );
}
quantity rwip(const fn_args& args) {
return region_sum( args , "WIP", measure::volume );
}
quantity roipl(const fn_args& args) {
return region_sum( args , "OIPL", measure::volume );
}
@ -627,6 +631,7 @@ static const std::unordered_map< std::string, ofun > funs = {
{ "ROIPL" , roipl},
{ "ROIPG" , roipg},
{ "RGIP" , rgip},
{ "RWIP" , rwip},
{ "ROIR" , region_rate< rt::oil, injector > },
{ "RGIR" , region_rate< rt::gas, injector > },
{ "RWIR" , region_rate< rt::wat, injector > },

View File

@ -75,6 +75,7 @@ static data::Solution make_solution( const EclipseGrid& grid ) {
std::vector<double> roipl(numCells);
std::vector<double> roipg(numCells);
std::vector<double> rgip(numCells);
std::vector<double> rwip(numCells);
for (size_t k=0; k < grid.getNZ(); k++) {
for (size_t j=0; j < grid.getNY(); j++) {
@ -85,6 +86,7 @@ static data::Solution make_solution( const EclipseGrid& grid ) {
roipl[g] = roip[g] - 1;
roipg[g] = roip[g] + 1;
rgip[g] = 2.1*(k + 1);
rwip[g] = 2.2*(k + 1);
}
}
}
@ -94,6 +96,7 @@ static data::Solution make_solution( const EclipseGrid& grid ) {
sol.insert( "OIPL" , UnitSystem::measure::volume , roipl, data::TargetType::RESTART_AUXILLARY);
sol.insert( "OIPG" , UnitSystem::measure::volume , roipg, data::TargetType::RESTART_AUXILLARY);
sol.insert( "GIP" , UnitSystem::measure::volume , rgip , data::TargetType::RESTART_AUXILLARY);
sol.insert( "WIP" , UnitSystem::measure::volume , rwip , data::TargetType::RESTART_AUXILLARY);
}
return sol;
}
@ -660,6 +663,7 @@ BOOST_AUTO_TEST_CASE(region_vars) {
for (size_t r=1; r <= 10; r++) {
std::string rpr_key = "RPR:" + std::to_string( r );
std::string roip_key = "ROIP:" + std::to_string( r );
std::string rwip_key = "RWIP:" + std::to_string( r );
std::string rgip_key = "RGIP:" + std::to_string( r );
std::string roipl_key = "ROIPL:" + std::to_string( r );
std::string roipg_key = "ROIPG:" + std::to_string( r );
@ -671,6 +675,7 @@ BOOST_AUTO_TEST_CASE(region_vars) {
BOOST_CHECK_CLOSE( area * (2*r - 1) * 1.0 , units.to_si( UnitSystem::measure::volume , ecl_sum_get_general_var( resp, 1, roipl_key.c_str())) , 1e-5);
BOOST_CHECK_CLOSE( area * (2*r + 1 ) * 1.0 , units.to_si( UnitSystem::measure::volume , ecl_sum_get_general_var( resp, 1, roipg_key.c_str())) , 1e-5);
BOOST_CHECK_CLOSE( area * 2.1*r * 1.0 , units.to_si( UnitSystem::measure::volume , ecl_sum_get_general_var( resp, 1, rgip_key.c_str())) , 1e-5);
BOOST_CHECK_CLOSE( area * 2.2*r * 1.0 , units.to_si( UnitSystem::measure::volume , ecl_sum_get_general_var( resp, 1, rwip_key.c_str())) , 1e-5);
}
}