IWEL: Identify Items for Active and Requested Well Controls

This commit refines our understanding of IWEL items relating to well
constraints.  In particular Item 8 is the well's active control mode
as determined by the simulator from dynamic state variables.  On the
other hand, Item 16 is the constraint that is requested in the
simulation run input for prediction wells (keywords WCONINJE,
WCONPROD) while Item 50 is the requested constraint for wells
controlled by observed rates (WCONINJH, WCONHIST).

Special Note: This commit outputs the requested control mode to Item
8 and will need an update later once the simulator becomes aware of
the distinction.
This commit is contained in:
Bård Skaflestad
2019-01-22 20:11:43 +01:00
parent e685eccdc9
commit 849eb80e41
3 changed files with 35 additions and 7 deletions

View File

@@ -33,19 +33,24 @@ namespace Opm { namespace RestartIO { namespace Helpers { namespace VectorItems
NConn = 4, // Number of active cells connected to well NConn = 4, // Number of active cells connected to well
Group = 5, // Index (one-based) of well's current group Group = 5, // Index (one-based) of well's current group
WType = 6, // Well type WType = 6, // Well type
WCtrl = 7, // Well control ActWCtrl = 7, // Well's active target control mode (constraint).
item9 = 8, // Unknown item9 = 8, // Unknown
item11 = 10, // Unknown item11 = 10, // Unknown
VFPTab = 11, // ID (one-based) of well's current VFP table VFPTab = 11, // ID (one-based) of well's current VFP table
PredReqWCtrl = 15, // Well's requested control mode from
// simulation deck (WCONINJE, WCONPROD).
item18 = 17, // Unknown item18 = 17, // Unknown
XFlow = 22, XFlow = 22,
item25 = 24, // Unknown item25 = 24, // Unknown
item32 = 31, // Unknown item32 = 31, // Unknown
item48 = 47, // Unknown item48 = 47, // Unknown
item50 = 49, // Unknown
HistReqWCtrl = 49, // Well's requested control mode from
// simulation deck (WCONHIST, WCONINJH)
MsWID = 70, // Multisegment well ID MsWID = 70, // Multisegment well ID
// Value 0 for regular wells // Value 0 for regular wells

View File

@@ -337,7 +337,6 @@ namespace {
GroupMapNameInd); GroupMapNameInd);
iWell[Ix::WType] = wellType (well, sim_step); iWell[Ix::WType] = wellType (well, sim_step);
iWell[Ix::WCtrl] = ctrlMode (well, sim_step);
iWell[Ix::VFPTab] = wellVFPTab(well, sim_step); iWell[Ix::VFPTab] = wellVFPTab(well, sim_step);
iWell[Ix::XFlow] = well.getAllowCrossFlow() ? 1 : 0; iWell[Ix::XFlow] = well.getAllowCrossFlow() ? 1 : 0;
@@ -348,7 +347,31 @@ namespace {
iWell[Ix::item32] = 7; iWell[Ix::item32] = 7;
iWell[Ix::item48] = - 1; iWell[Ix::item48] = - 1;
iWell[Ix::item50] = iWell[Ix::WCtrl]; // Deliberate misrepresentation. Function 'ctrlMode()' returns
// the target control mode requested in the simulation deck.
// This item is supposed to be the well's actual, active target
// control mode in the simulator.
iWell[Ix::ActWCtrl] = ctrlMode(well, sim_step);
const auto isPred =
(well.isProducer(sim_step) &&
well.getProductionProperties(sim_step).predictionMode)
||
(well.isInjector(sim_step) &&
well.getInjectionProperties(sim_step).predictionMode);
if (isPred) {
// Well in prediction mode (WCONPROD, WCONINJE). Assign
// requested control mode for prediction.
iWell[Ix::PredReqWCtrl] = iWell[Ix::ActWCtrl];
iWell[Ix::HistReqWCtrl] = 0;
}
else {
// Well controlled by observed rates/BHP (WCONHIST,
// WCONINJH). Assign requested control mode for history.
iWell[Ix::PredReqWCtrl] = 0; // Possibly =1 instead.
iWell[Ix::HistReqWCtrl] = iWell[Ix::ActWCtrl];
}
// Multi-segmented well information // Multi-segmented well information
iWell[Ix::MsWID] = 0; // MS Well ID (0 or 1..#MS wells) iWell[Ix::MsWID] = 0; // MS Well ID (0 or 1..#MS wells)
@@ -386,7 +409,7 @@ namespace {
}); });
iWell[Ix::item9] = any_flowing_conn iWell[Ix::item9] = any_flowing_conn
? iWell[Ix::WCtrl] : -1; ? iWell[Ix::ActWCtrl] : -1;
iWell[Ix::item11] = 1; iWell[Ix::item11] = 1;
} }

View File

@@ -548,7 +548,7 @@ BOOST_AUTO_TEST_CASE (Dynamic_Well_Data_Step1)
const auto& iwell = awd.getIWell(); const auto& iwell = awd.getIWell();
BOOST_CHECK_EQUAL(iwell[i0 + Ix::item9 ], iwell[i0 + Ix::WCtrl]); BOOST_CHECK_EQUAL(iwell[i0 + Ix::item9 ], iwell[i0 + Ix::ActWCtrl]);
BOOST_CHECK_EQUAL(iwell[i0 + Ix::item11], 1); BOOST_CHECK_EQUAL(iwell[i0 + Ix::item11], 1);
} }
@@ -668,7 +668,7 @@ BOOST_AUTO_TEST_CASE (Dynamic_Well_Data_Step2)
const auto& iwell = awd.getIWell(); const auto& iwell = awd.getIWell();
BOOST_CHECK_EQUAL(iwell[i1 + Ix::item9], BOOST_CHECK_EQUAL(iwell[i1 + Ix::item9],
iwell[i1 + Ix::WCtrl]); iwell[i1 + Ix::ActWCtrl]);
BOOST_CHECK_EQUAL(iwell[i1 + Ix::item11], 1); BOOST_CHECK_EQUAL(iwell[i1 + Ix::item11], 1);
} }