Skip to content

Commit 33ea605

Browse files
committed
Raise WELL_THP_UPDATE also for injectors
WCONINJE and WCONINJH, and WELTARG THP/VFP and WTMULT THP on injectors, re-specify the injector THP limit and/or VFP table just like the producer variants. Consumers gate on the well type where it matters.
1 parent f7dfc71 commit 33ea605

5 files changed

Lines changed: 88 additions & 26 deletions

File tree

opm/input/eclipse/Schedule/Action/SimulatorUpdate.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,13 @@ struct SimulatorUpdate
7373
std::unordered_set<std::string> welpi_wells{};
7474

7575
/// Wells whose THP limit and/or VFP table has been (re)specified by
76-
/// WCONPROD or WCONHIST for the named wells, by WELTARG with THP or VFP
77-
/// control, or by WTMULT with THP control. Unlike affected_wells, this
78-
/// set also includes wells for which the entered values are unchanged,
79-
/// since re-specifying either input cancels a THP limit imposed
80-
/// dynamically by the simulator (e.g. by network balancing). See also
81-
/// the WELL_THP_UPDATE schedule event.
76+
/// WCONPROD, WCONHIST, WCONINJE or WCONINJH for the named wells, by
77+
/// WELTARG with THP or VFP control, or by WTMULT with THP control.
78+
/// Producers and injectors alike are included. Unlike affected_wells,
79+
/// this set also includes wells for which the entered values are
80+
/// unchanged, since re-specifying either input cancels a THP limit
81+
/// imposed dynamically by the simulator (e.g. by network balancing).
82+
/// See also the WELL_THP_UPDATE schedule event.
8283
std::unordered_set<std::string> thp_respec_wells{};
8384

8485
/// New well connections created as a result of a geomechanical

opm/input/eclipse/Schedule/Events.hpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,14 @@ namespace Opm
115115
REQUEST_OPEN_COMPLETION = (UINT64_C(1) << 24),
116116

117117
/// The well THP limit and/or VFP table has been (re)specified
118-
/// by WCONPROD or WCONHIST for the named wells, by WELTARG with
119-
/// THP or VFP control, or by WTMULT with THP control. Unlike
120-
/// PRODUCTION_UPDATE, the event is also triggered when the
121-
/// entered values are unchanged, since re-specifying either
122-
/// input cancels a THP limit imposed dynamically by the
123-
/// simulator (e.g. by network balancing).
118+
/// by WCONPROD, WCONHIST, WCONINJE or WCONINJH for the named
119+
/// wells, by WELTARG with THP or VFP control, or by WTMULT with
120+
/// THP control. The event applies to producers and injectors
121+
/// alike; consumers must check the well type where it matters.
122+
/// Unlike PRODUCTION_UPDATE and INJECTION_UPDATE, the event is
123+
/// also triggered when the entered values are unchanged, since
124+
/// re-specifying either input cancels a THP limit imposed
125+
/// dynamically by the simulator (e.g. by network balancing).
124126
WELL_THP_UPDATE = (UINT64_C(1) << 25),
125127
};
126128
} // namespace ScheduleEvents

opm/input/eclipse/Schedule/Well/WellKeywordHandlers.cpp

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,12 @@ void handleWCONINJE(HandlerContext& handlerContext)
267267
update_well = true;
268268
}
269269

270+
// The THP limit and VFP table (items 8 and 9) are re-specified
271+
// by every WCONINJE, whether or not any value changed.
272+
handlerContext.state().events().addEvent( ScheduleEvents::WELL_THP_UPDATE );
273+
handlerContext.state().wellgroup_events().addEvent( well_name, ScheduleEvents::WELL_THP_UPDATE);
274+
handlerContext.thp_respec_well(well_name);
275+
270276
if (update_well) {
271277
handlerContext.state().events().addEvent(ScheduleEvents::INJECTION_UPDATE);
272278
handlerContext.state().wellgroup_events().addEvent( well_name, ScheduleEvents::INJECTION_UPDATE);
@@ -342,6 +348,12 @@ void handleWCONINJH(HandlerContext& handlerContext)
342348
update_well = true;
343349
}
344350

351+
// The VFP table (item 7) is re-specified by every WCONINJH,
352+
// whether or not any value changed.
353+
handlerContext.state().events().addEvent( ScheduleEvents::WELL_THP_UPDATE );
354+
handlerContext.state().wellgroup_events().addEvent( well_name, ScheduleEvents::WELL_THP_UPDATE);
355+
handlerContext.thp_respec_well(well_name);
356+
345357
if (update_well) {
346358
handlerContext.state().events().addEvent( ScheduleEvents::INJECTION_UPDATE );
347359
handlerContext.state().wellgroup_events().addEvent( well_name, ScheduleEvents::INJECTION_UPDATE);
@@ -848,9 +860,7 @@ void handleWELTARG(HandlerContext& handlerContext)
848860

849861
// The THP limit or VFP table is re-specified, whether or not
850862
// the value changed.
851-
if (well2.isProducer() &&
852-
(cmode == Well::WELTARGCMode::THP || cmode == Well::WELTARGCMode::VFP))
853-
{
863+
if (cmode == Well::WELTARGCMode::THP || cmode == Well::WELTARGCMode::VFP) {
854864
handlerContext.state().events().addEvent( ScheduleEvents::WELL_THP_UPDATE );
855865
handlerContext.state().wellgroup_events().addEvent( well_name, ScheduleEvents::WELL_THP_UPDATE);
856866
handlerContext.thp_respec_well(well_name);

opm/input/eclipse/Schedule/Well/WellPropertiesKeywordHandlers.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,17 @@ void handleWTMULT(HandlerContext& handlerContext)
609609
for (const auto& well_name : well_names) {
610610
auto well = handlerContext.state().wells.get(well_name);
611611

612+
// The THP limit is re-specified (multiplied).
613+
if (cmode == Well::WELTARGCMode::THP) {
614+
handlerContext.state().events()
615+
.addEvent(ScheduleEvents::WELL_THP_UPDATE);
616+
617+
handlerContext.state().wellgroup_events()
618+
.addEvent(well_name, ScheduleEvents::WELL_THP_UPDATE);
619+
620+
handlerContext.thp_respec_well(well_name);
621+
}
622+
612623
if (well.isInjector()) {
613624
const bool update_well = true;
614625

@@ -634,17 +645,6 @@ void handleWTMULT(HandlerContext& handlerContext)
634645

635646
well.updateProduction(properties);
636647

637-
// The THP limit is re-specified (multiplied).
638-
if (cmode == Well::WELTARGCMode::THP) {
639-
handlerContext.state().events()
640-
.addEvent(ScheduleEvents::WELL_THP_UPDATE);
641-
642-
handlerContext.state().wellgroup_events()
643-
.addEvent(well_name, ScheduleEvents::WELL_THP_UPDATE);
644-
645-
handlerContext.thp_respec_well(well_name);
646-
}
647-
648648
if (update_well) {
649649
handlerContext.state().events()
650650
.addEvent(ScheduleEvents::PRODUCTION_UPDATE);

tests/parser/ScheduleTests.cpp

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7247,10 +7247,14 @@ SCHEDULE
72477247
72487248
WELSPECS
72497249
'P1' 'G1' 1 1 2500 'OIL' /
7250+
'I1' 'G1' 2 2 2500 'WAT' /
72507251
/
72517252
WCONPROD
72527253
'P1' 'OPEN' 'ORAT' 1000 4* 50.0 /
72537254
/
7255+
WCONINJE
7256+
'I1' 'WATER' 'OPEN' 'RATE' 1000 /
7257+
/
72547258
72557259
DATES -- 1
72567260
10 JUN 1998 /
@@ -7299,6 +7303,38 @@ DATES -- 6
72997303
WCONHIST
73007304
'P1' 'OPEN' 'ORAT' 100 0 0 /
73017305
/
7306+
7307+
DATES -- 7
7308+
10 DES 1998 /
7309+
/
7310+
7311+
WELTARG
7312+
'I1' 'THP' 30 /
7313+
/
7314+
7315+
DATES -- 8
7316+
10 JAN 1999 /
7317+
/
7318+
7319+
WELTARG
7320+
'I1' 'WRAT' 800 /
7321+
/
7322+
7323+
DATES -- 9
7324+
10 FEB 1999 /
7325+
/
7326+
7327+
WTMULT
7328+
'I1' 'THP' 2.0 /
7329+
/
7330+
7331+
DATES -- 10
7332+
10 MAR 1999 /
7333+
/
7334+
7335+
WCONINJH
7336+
'I1' 'WATER' 'OPEN' 100 /
7337+
/
73027338
)");
73037339

73047340
// Initial WCONPROD specifies the THP limit and VFP table
@@ -7319,4 +7355,17 @@ WCONHIST
73197355
BOOST_CHECK( schedule[5].wellgroup_events().hasEvent("P1", ScheduleEvents::WELL_THP_UPDATE));
73207356
// WCONHIST re-specifies the VFP table
73217357
BOOST_CHECK( schedule[6].wellgroup_events().hasEvent("P1", ScheduleEvents::WELL_THP_UPDATE));
7358+
7359+
// The event also applies to injectors:
7360+
// WCONINJE re-specifies the THP limit and VFP table
7361+
BOOST_CHECK( schedule[0].wellgroup_events().hasEvent("I1", ScheduleEvents::WELL_THP_UPDATE));
7362+
// WELTARG THP re-specifies the THP limit
7363+
BOOST_CHECK( schedule[7].wellgroup_events().hasEvent("I1", ScheduleEvents::WELL_THP_UPDATE));
7364+
// WELTARG WRAT does not touch the THP limit or VFP table
7365+
BOOST_CHECK(!schedule[8].wellgroup_events().hasEvent("I1", ScheduleEvents::WELL_THP_UPDATE));
7366+
BOOST_CHECK( schedule[8].wellgroup_events().hasEvent("I1", ScheduleEvents::INJECTION_UPDATE));
7367+
// WTMULT with THP control re-specifies (multiplies) the THP limit
7368+
BOOST_CHECK( schedule[9].wellgroup_events().hasEvent("I1", ScheduleEvents::WELL_THP_UPDATE));
7369+
// WCONINJH re-specifies the VFP table
7370+
BOOST_CHECK( schedule[10].wellgroup_events().hasEvent("I1", ScheduleEvents::WELL_THP_UPDATE));
73227371
}

0 commit comments

Comments
 (0)