Merge remote-tracking branch 'upstream/master' into timestepcontrol
This commit is contained in:
commit
2fcb3c6638
@ -411,6 +411,11 @@ namespace Opm
|
|||||||
OPM_THROW(std::runtime_error, "Currently we do not support well status " << WellCommon::Status2String(well->getStatus( timeStep )));
|
OPM_THROW(std::runtime_error, "Currently we do not support well status " << WellCommon::Status2String(well->getStatus( timeStep )));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (well->getStatus(timeStep) == WellCommon::SHUT) {
|
||||||
|
well_controls_shut_well( w_->ctrls[well_index] );
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
if (well->isInjector(timeStep)) {
|
if (well->isInjector(timeStep)) {
|
||||||
const WellInjectionProperties& injectionProperties = well->getInjectionProperties(timeStep);
|
const WellInjectionProperties& injectionProperties = well->getInjectionProperties(timeStep);
|
||||||
int ok = 1;
|
int ok = 1;
|
||||||
@ -484,10 +489,6 @@ namespace Opm
|
|||||||
OPM_THROW(std::runtime_error, "Control not specified in well " << well_names[well_index]);
|
OPM_THROW(std::runtime_error, "Control not specified in well " << well_names[well_index]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// We need to check if the well is shut or not
|
|
||||||
if (well->getStatus( timeStep ) == WellCommon::SHUT) {
|
|
||||||
well_controls_shut_well( w_->ctrls[well_index] );
|
|
||||||
}
|
|
||||||
set_current_control(well_index, cpos, w_);
|
set_current_control(well_index, cpos, w_);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -619,13 +620,12 @@ namespace Opm
|
|||||||
if (cpos == -1 && mode != WellsManagerDetail::ProductionControl::GRUP) {
|
if (cpos == -1 && mode != WellsManagerDetail::ProductionControl::GRUP) {
|
||||||
OPM_THROW(std::runtime_error, "Control mode type " << mode << " not present in well " << well_names[well_index]);
|
OPM_THROW(std::runtime_error, "Control mode type " << mode << " not present in well " << well_names[well_index]);
|
||||||
}
|
}
|
||||||
// If it's shut, we complement the cpos
|
if (cpos == -1 && mode != WellsManagerDetail::ProductionControl::GRUP) {
|
||||||
if (well->getStatus(timeStep) == WellCommon::SHUT) {
|
|
||||||
well_controls_shut_well( w_->ctrls[well_index] );
|
|
||||||
} else if (cpos == -1 && mode != WellsManagerDetail::ProductionControl::GRUP) {
|
|
||||||
OPM_THROW(std::runtime_error, "Control mode type " << mode << " not present in well " << well_names[well_index]);
|
OPM_THROW(std::runtime_error, "Control mode type " << mode << " not present in well " << well_names[well_index]);
|
||||||
}
|
}
|
||||||
set_current_control(well_index, cpos, w_);
|
else {
|
||||||
|
set_current_control(well_index, cpos, w_);
|
||||||
|
}
|
||||||
|
|
||||||
// Set well component fraction to match preferred phase for the well.
|
// Set well component fraction to match preferred phase for the well.
|
||||||
double cf[3] = { 0.0, 0.0, 0.0 };
|
double cf[3] = { 0.0, 0.0, 0.0 };
|
||||||
|
@ -236,6 +236,19 @@ BOOST_AUTO_TEST_CASE(ControlsEqual) {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BOOST_AUTO_TEST_CASE(WellShutOK) {
|
||||||
|
const std::string filename = "wells_manager_data.data";
|
||||||
|
Opm::ParserPtr parser(new Opm::Parser());
|
||||||
|
Opm::DeckConstPtr deck(parser->parseFile(filename));
|
||||||
|
|
||||||
|
Opm::EclipseStateConstPtr eclipseState(new Opm::EclipseState(deck));
|
||||||
|
Opm::GridManager gridManager(deck);
|
||||||
|
|
||||||
|
BOOST_CHECK_NO_THROW( Opm::WellsManager wellsManager2(eclipseState , 2 , *gridManager.c_grid(), NULL));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BOOST_AUTO_TEST_CASE(WellHasSTOP_ExceptionIsThrown) {
|
BOOST_AUTO_TEST_CASE(WellHasSTOP_ExceptionIsThrown) {
|
||||||
const std::string filename = "wells_manager_data_wellSTOP.data";
|
const std::string filename = "wells_manager_data_wellSTOP.data";
|
||||||
Opm::ParserPtr parser(new Opm::Parser());
|
Opm::ParserPtr parser(new Opm::Parser());
|
||||||
|
@ -55,26 +55,16 @@ WCONINJE
|
|||||||
'INJ1' 'WATER' 'OPEN' 'RESV' 10 20 40 /
|
'INJ1' 'WATER' 'OPEN' 'RESV' 10 20 40 /
|
||||||
/
|
/
|
||||||
|
|
||||||
END
|
|
||||||
|
|
||||||
TSTEP
|
DATES
|
||||||
14.0 /
|
1 'MAR' 2000 /
|
||||||
/
|
/
|
||||||
|
|
||||||
|
|
||||||
WELSPECS
|
WCONPROD
|
||||||
'TEST1' 'G1' 1 1 8335 'GAS' /
|
'PROD1' 'SHUT' 15* /
|
||||||
'TEST2' 'G2' 10 10 8400 'OIL' /
|
|
||||||
/
|
|
||||||
|
|
||||||
GRUPTREE
|
|
||||||
'G1' 'SHIP' /
|
|
||||||
'G2' 'SHIP' /
|
|
||||||
/
|
|
||||||
|
|
||||||
TSTEP
|
|
||||||
3 /
|
|
||||||
/
|
/
|
||||||
|
|
||||||
|
|
||||||
END
|
END
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user