mirror of
https://github.com/OPM/opm-simulators.git
synced 2026-08-09 00:48:04 -05:00
Merge remote-tracking branch 'upstream/opm-parser-integrate' into wellsmanager-rates
Conflicts: opm/core/wells/WellsManager.cpp
This commit is contained in:
+60
-28
@@ -61,7 +61,7 @@ void wells_static_check(const Wells* wells) {
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
/*
|
||||
The number of controls is determined by looking at which elements
|
||||
have been given explicit - non-default - values in the WCONxxxx
|
||||
keyword. Is that at all interesting?
|
||||
@@ -71,7 +71,7 @@ void wells_static_check(const Wells* wells) {
|
||||
void check_controls_epoch0( struct WellControls ** ctrls) {
|
||||
// The injector
|
||||
{
|
||||
const struct WellControls * ctrls0 = ctrls[0];
|
||||
const struct WellControls * ctrls0 = ctrls[0];
|
||||
BOOST_CHECK_EQUAL( 3 , well_controls_get_num(ctrls0)); // The number of controls for the injector == 3??
|
||||
|
||||
BOOST_CHECK_EQUAL( SURFACE_RATE , well_controls_iget_type(ctrls0 , 0) );
|
||||
@@ -87,7 +87,7 @@ void check_controls_epoch0( struct WellControls ** ctrls) {
|
||||
BOOST_CHECK_EQUAL( 0 , well_controls_get_current(ctrls0) );
|
||||
|
||||
// The phase distribution in the active target
|
||||
{
|
||||
{
|
||||
const double * distr = well_controls_iget_distr( ctrls0 , 0 );
|
||||
BOOST_CHECK_EQUAL( 0 , distr[0] ); // Water
|
||||
BOOST_CHECK_EQUAL( 0 , distr[1] ); // Oil
|
||||
@@ -110,7 +110,7 @@ void check_controls_epoch0( struct WellControls ** ctrls) {
|
||||
BOOST_CHECK_EQUAL( 0 , well_controls_get_current(ctrls1));
|
||||
|
||||
// The phase distribution in the active target
|
||||
{
|
||||
{
|
||||
const double * distr = well_controls_iget_distr( ctrls1 , 0 );
|
||||
BOOST_CHECK_EQUAL( 0 , distr[0] ); // Water
|
||||
BOOST_CHECK_EQUAL( 1 , distr[1] ); // Oil
|
||||
@@ -125,7 +125,7 @@ void check_controls_epoch0( struct WellControls ** ctrls) {
|
||||
void check_controls_epoch1( struct WellControls ** ctrls) {
|
||||
// The injector
|
||||
{
|
||||
const struct WellControls * ctrls0 = ctrls[0];
|
||||
const struct WellControls * ctrls0 = ctrls[0];
|
||||
BOOST_CHECK_EQUAL( 3 , well_controls_get_num(ctrls0)); // The number of controls for the injector == 3??
|
||||
|
||||
BOOST_CHECK_EQUAL( SURFACE_RATE , well_controls_iget_type(ctrls0 , 0 ));
|
||||
@@ -140,7 +140,7 @@ void check_controls_epoch1( struct WellControls ** ctrls) {
|
||||
// Which control is active
|
||||
BOOST_CHECK_EQUAL( 1 , well_controls_get_current(ctrls0));
|
||||
|
||||
{
|
||||
{
|
||||
const double * distr = well_controls_iget_distr( ctrls0 , 1 );
|
||||
BOOST_CHECK_EQUAL( 1 , distr[0] ); // Water
|
||||
BOOST_CHECK_EQUAL( 0 , distr[1] ); // Oil
|
||||
@@ -164,7 +164,7 @@ void check_controls_epoch1( struct WellControls ** ctrls) {
|
||||
// Which control is active
|
||||
BOOST_CHECK_EQUAL( 1 , well_controls_get_current(ctrls1) );
|
||||
|
||||
{
|
||||
{
|
||||
const double * distr = well_controls_iget_distr( ctrls1 , 1 );
|
||||
BOOST_CHECK_EQUAL( 1 , distr[0] ); // Water
|
||||
BOOST_CHECK_EQUAL( 1 , distr[1] ); // Oil
|
||||
@@ -174,8 +174,6 @@ void check_controls_epoch1( struct WellControls ** ctrls) {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(Constructor_Works) {
|
||||
Opm::EclipseGridParser Deck("wells_manager_data.data");
|
||||
Opm::GridManager gridManager(Deck);
|
||||
@@ -194,7 +192,7 @@ BOOST_AUTO_TEST_CASE(Constructor_Works) {
|
||||
Opm::WellsManager wellsManager(Deck, *gridManager.c_grid(), NULL);
|
||||
const Wells* wells = wellsManager.c_wells();
|
||||
|
||||
wells_static_check( wells );
|
||||
wells_static_check( wells );
|
||||
check_controls_epoch1( wells->ctrls );
|
||||
}
|
||||
}
|
||||
@@ -212,11 +210,15 @@ BOOST_AUTO_TEST_CASE(New_Constructor_Works) {
|
||||
Opm::WellsManager wellsManager(eclipseState, 0, Deck, *gridManager.c_grid(), NULL);
|
||||
Opm::WellsManager oldWellsManager(Deck, *gridManager.c_grid(), NULL);
|
||||
|
||||
const Wells* wells = wellsManager.c_wells();
|
||||
wells_static_check( wells );
|
||||
check_controls_epoch0( wells->ctrls );
|
||||
std::cout << "Checking new well structure, epoch 0" << std::endl;
|
||||
wells_static_check( wellsManager.c_wells() );
|
||||
|
||||
BOOST_CHECK(wells_equal(wells, oldWellsManager.c_wells()));
|
||||
std::cout << "Checking old well structure, epoch 0" << std::endl;
|
||||
wells_static_check( oldWellsManager.c_wells() );
|
||||
|
||||
check_controls_epoch0( wellsManager.c_wells()->ctrls );
|
||||
|
||||
BOOST_CHECK(wells_equal(wellsManager.c_wells(), oldWellsManager.c_wells() , false));
|
||||
}
|
||||
|
||||
Deck.setCurrentEpoch(1);
|
||||
@@ -224,11 +226,41 @@ BOOST_AUTO_TEST_CASE(New_Constructor_Works) {
|
||||
Opm::WellsManager wellsManager(eclipseState, 1,Deck, *gridManager.c_grid(), NULL);
|
||||
Opm::WellsManager oldWellsManager(Deck, *gridManager.c_grid(), NULL);
|
||||
|
||||
const Wells* wells = wellsManager.c_wells();
|
||||
wells_static_check( wells );
|
||||
check_controls_epoch1( wells->ctrls );
|
||||
std::cout << "Checking new well structure, epoch 1" << std::endl;
|
||||
wells_static_check( wellsManager.c_wells() );
|
||||
|
||||
BOOST_CHECK(wells_equal(wells, oldWellsManager.c_wells()));
|
||||
std::cout << "Checking old well structure, epoch 1" << std::endl;
|
||||
wells_static_check( oldWellsManager.c_wells() );
|
||||
|
||||
check_controls_epoch1( wellsManager.c_wells()->ctrls );
|
||||
|
||||
BOOST_CHECK(wells_equal( wellsManager.c_wells(), oldWellsManager.c_wells(),false));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(New_Constructor_Works_ExpandedData) {
|
||||
|
||||
Opm::ParserPtr parser(new Opm::Parser());
|
||||
Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(parser->parseFile("wells_manager_data_expanded.data")));
|
||||
|
||||
Opm::EclipseGridParser Deck("wells_manager_data_expanded.data");
|
||||
Opm::GridManager gridManager(Deck);
|
||||
|
||||
Deck.setCurrentEpoch(0);
|
||||
{
|
||||
Opm::WellsManager wellsManager(eclipseState, 0, Deck, *gridManager.c_grid(), NULL);
|
||||
Opm::WellsManager oldWellsManager(Deck, *gridManager.c_grid(), NULL);
|
||||
|
||||
BOOST_CHECK(wells_equal(wellsManager.c_wells(), oldWellsManager.c_wells(),false));
|
||||
}
|
||||
|
||||
Deck.setCurrentEpoch(1);
|
||||
{
|
||||
Opm::WellsManager wellsManager(eclipseState, 1,Deck, *gridManager.c_grid(), NULL);
|
||||
Opm::WellsManager oldWellsManager(Deck, *gridManager.c_grid(), NULL);
|
||||
|
||||
BOOST_CHECK(wells_equal( wellsManager.c_wells(), oldWellsManager.c_wells(), true));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,8 +276,8 @@ BOOST_AUTO_TEST_CASE(WellsEqual) {
|
||||
Deck.setCurrentEpoch(1);
|
||||
Opm::WellsManager wellsManager1(Deck, *gridManager.c_grid(), NULL);
|
||||
|
||||
BOOST_CHECK( wells_equal( wellsManager0.c_wells() , wellsManager0.c_wells()) );
|
||||
BOOST_CHECK( !wells_equal( wellsManager0.c_wells() , wellsManager1.c_wells()) );
|
||||
BOOST_CHECK( wells_equal( wellsManager0.c_wells() , wellsManager0.c_wells(),false) );
|
||||
BOOST_CHECK( !wells_equal( wellsManager0.c_wells() , wellsManager1.c_wells(),false) );
|
||||
}
|
||||
|
||||
|
||||
@@ -259,15 +291,15 @@ BOOST_AUTO_TEST_CASE(ControlsEqual) {
|
||||
Deck.setCurrentEpoch(1);
|
||||
Opm::WellsManager wellsManager1(Deck, *gridManager.c_grid(), NULL);
|
||||
|
||||
BOOST_CHECK( well_controls_equal( wellsManager0.c_wells()->ctrls[0] , wellsManager0.c_wells()->ctrls[0]));
|
||||
BOOST_CHECK( well_controls_equal( wellsManager0.c_wells()->ctrls[1] , wellsManager0.c_wells()->ctrls[1]));
|
||||
BOOST_CHECK( well_controls_equal( wellsManager1.c_wells()->ctrls[0] , wellsManager1.c_wells()->ctrls[0]));
|
||||
BOOST_CHECK( well_controls_equal( wellsManager1.c_wells()->ctrls[1] , wellsManager1.c_wells()->ctrls[1]));
|
||||
BOOST_CHECK( well_controls_equal( wellsManager0.c_wells()->ctrls[0] , wellsManager0.c_wells()->ctrls[0] , false));
|
||||
BOOST_CHECK( well_controls_equal( wellsManager0.c_wells()->ctrls[1] , wellsManager0.c_wells()->ctrls[1] , false));
|
||||
BOOST_CHECK( well_controls_equal( wellsManager1.c_wells()->ctrls[0] , wellsManager1.c_wells()->ctrls[0] , false));
|
||||
BOOST_CHECK( well_controls_equal( wellsManager1.c_wells()->ctrls[1] , wellsManager1.c_wells()->ctrls[1] , false));
|
||||
|
||||
BOOST_CHECK( !well_controls_equal( wellsManager0.c_wells()->ctrls[0] , wellsManager0.c_wells()->ctrls[1]));
|
||||
BOOST_CHECK( !well_controls_equal( wellsManager0.c_wells()->ctrls[1] , wellsManager0.c_wells()->ctrls[0]));
|
||||
BOOST_CHECK( !well_controls_equal( wellsManager1.c_wells()->ctrls[0] , wellsManager0.c_wells()->ctrls[0]));
|
||||
BOOST_CHECK( !well_controls_equal( wellsManager1.c_wells()->ctrls[1] , wellsManager0.c_wells()->ctrls[1]));
|
||||
BOOST_CHECK( !well_controls_equal( wellsManager0.c_wells()->ctrls[0] , wellsManager0.c_wells()->ctrls[1] , false));
|
||||
BOOST_CHECK( !well_controls_equal( wellsManager0.c_wells()->ctrls[1] , wellsManager0.c_wells()->ctrls[0] , false));
|
||||
BOOST_CHECK( !well_controls_equal( wellsManager1.c_wells()->ctrls[0] , wellsManager0.c_wells()->ctrls[0] , false));
|
||||
BOOST_CHECK( !well_controls_equal( wellsManager1.c_wells()->ctrls[1] , wellsManager0.c_wells()->ctrls[1] , false));
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user