Changes to Well status implementation

o The status of a well is maintened as a small object which is managed by a new
   std::shared_ptr member in the well objects. The consequence of this is that
   several well objects can share the same underlying status object. The
   advantage of this is that runtime (i.e. ACTIONX) updates of well status will
   affect the correct set of wells.

 o The general Schedule::updateWell() will use the DynamicState::upadte_equal()
This commit is contained in:
Joakim Hove
2020-12-08 09:36:45 +01:00
parent 85e2c641d3
commit 2e832f0fbe
9 changed files with 316 additions and 74 deletions
+110 -3
View File
@@ -3233,9 +3233,8 @@ BOOST_AUTO_TEST_CASE(WELL_STATIC) {
BOOST_CHECK(ws.updateRefDepth(1.0));
BOOST_CHECK(!ws.updateRefDepth(1.0));
ws.updateStatus(Well::Status::OPEN, false);
BOOST_CHECK(!ws.updateStatus(Well::Status::OPEN, false));
BOOST_CHECK(ws.updateStatus(Well::Status::SHUT, false));
ws.updateStatus(Well::Status::OPEN, false, false);
ws.updateStatus(Well::Status::SHUT, false, false);
const auto& connections = ws.getConnections();
BOOST_CHECK_EQUAL(connections.size(), 0U);
@@ -4353,3 +4352,111 @@ END
}
BOOST_AUTO_TEST_CASE(WELL_STATUS) {
const std::string deck_string = R"(
START
7 OCT 2020 /
DIMENS
10 10 3 /
GRID
DXV
10*100.0 /
DYV
10*100.0 /
DZV
3*10.0 /
DEPTHZ
121*2000.0 /
PORO
300*0.3 /
SCHEDULE
WELSPECS -- 0
'P1' 'G' 10 10 2005 'LIQ' /
/
COMPDAT
'P1' 9 9 1 1 'OPEN' 1* 32.948 0.311 3047.839 1* 1* 'X' 22.100 /
/
WCONPROD
'P1' 'OPEN' 'ORAT' 123.4 4* 50.0 /
/
TSTEP -- 1
10 /
WELPI
'P1' 200.0 /
/
TSTEP -- 2
10 /
WELOPEN
'P1' SHUT /
/
TSTEP -- 3,4,5
10 10 10 /
WELOPEN
'P1' OPEN /
/
TSTEP -- 6,7,8
10 10 10/
END
END
)";
const auto deck = Parser{}.parseString(deck_string);
const auto es = EclipseState{ deck };
auto sched = Schedule{ deck, es };
{
const auto& well = sched.getWell("P1", 0);
BOOST_CHECK( well.getStatus() == Well::Status::OPEN);
}
{
const auto& well = sched.getWell("P1", 1);
BOOST_CHECK( well.getStatus() == Well::Status::OPEN);
}
{
const auto& well = sched.getWell("P1", 2);
BOOST_CHECK( well.getStatus() == Well::Status::SHUT);
}
{
const auto& well = sched.getWell("P1", 5);
BOOST_CHECK( well.getStatus() == Well::Status::OPEN);
}
sched.shut_well("P1", 0);
{
const auto& well = sched.getWell("P1", 0);
BOOST_CHECK( well.getStatus() == Well::Status::SHUT);
}
{
const auto& well = sched.getWell("P1", 1);
BOOST_CHECK( well.getStatus() == Well::Status::SHUT);
}
{
const auto& well = sched.getWell("P1", 2);
BOOST_CHECK( well.getStatus() == Well::Status::SHUT);
}
{
const auto& well = sched.getWell("P1", 5);
BOOST_CHECK( well.getStatus() == Well::Status::OPEN);
}
//sched.open_well("P1", 2);
}