Skip to content

Commit f7dfc71

Browse files
committed
Record THP limit re-specification in SimulatorUpdate
The new thp_respec_wells set carries the WELL_THP_UPDATE information through ACTIONX processing, where report-step events do not reach the simulator.
1 parent 3862533 commit f7dfc71

5 files changed

Lines changed: 31 additions & 0 deletions

File tree

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

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ struct SimulatorUpdate
4444
simulatorUpdate.well_structure_changed = true;
4545
simulatorUpdate.affected_wells = {"test"};
4646
simulatorUpdate.welpi_wells.insert("I-45");
47+
simulatorUpdate.thp_respec_wells.insert("P-3");
4748
simulatorUpdate.new_frac_wconns.assign({
4849
std::pair { "I-45"s, std::vector { std::size_t{11}, std::size_t{22}, std::size_t{33} } },
4950
std::pair { "RA-MAN"s, std::vector { std::size_t{1}, std::size_t{7}, std::size_t{29} } },
@@ -57,6 +58,7 @@ struct SimulatorUpdate
5758
{
5859
serializer(affected_wells);
5960
serializer(welpi_wells);
61+
serializer(thp_respec_wells);
6062
serializer(new_frac_wconns);
6163
serializer(tran_update);
6264
serializer(well_structure_changed);
@@ -70,6 +72,15 @@ struct SimulatorUpdate
7072
/// its internal notion of the connection transmissibility factors.
7173
std::unordered_set<std::string> welpi_wells{};
7274

75+
/// 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.
82+
std::unordered_set<std::string> thp_respec_wells{};
83+
7384
/// New well connections created as a result of a geomechanical
7485
/// fracturing process.
7586
///
@@ -116,6 +127,9 @@ struct SimulatorUpdate
116127
this->welpi_wells.insert(otherSimUpdate.welpi_wells.begin(),
117128
otherSimUpdate.welpi_wells.end());
118129

130+
this->thp_respec_wells.insert(otherSimUpdate.thp_respec_wells.begin(),
131+
otherSimUpdate.thp_respec_wells.end());
132+
119133
this->new_frac_wconns.insert(this->new_frac_wconns.end(),
120134
otherSimUpdate.new_frac_wconns.begin(),
121135
otherSimUpdate.new_frac_wconns.end());
@@ -128,6 +142,7 @@ struct SimulatorUpdate
128142
this->well_structure_changed = false;
129143
this->affected_wells.clear();
130144
this->welpi_wells.clear();
145+
this->thp_respec_wells.clear();
131146
this->new_frac_wconns.clear();
132147
}
133148

@@ -137,6 +152,7 @@ struct SimulatorUpdate
137152
&& (this->well_structure_changed == that.well_structure_changed)
138153
&& (this->affected_wells == that.affected_wells)
139154
&& (this->welpi_wells == that.welpi_wells)
155+
&& (this->thp_respec_wells == that.thp_respec_wells)
140156
&& (this->new_frac_wconns == that.new_frac_wconns)
141157
;
142158
}

opm/input/eclipse/Schedule/HandlerContext.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ void HandlerContext::affected_well(const std::string& well_name)
4848
}
4949
}
5050

51+
void HandlerContext::thp_respec_well(const std::string& well_name)
52+
{
53+
if (sim_update != nullptr) {
54+
sim_update->thp_respec_wells.insert(well_name);
55+
}
56+
}
57+
5158
void HandlerContext::welpi_well(const std::string& well_name)
5259
{
5360
if (sim_update != nullptr) {

opm/input/eclipse/Schedule/HandlerContext.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,10 @@ class HandlerContext
107107
//! \brief Mark that a well is affected by WELPI.
108108
void welpi_well(const std::string& well_name);
109109

110+
//! \brief Mark that the THP limit and/or VFP table of a well has been
111+
//! (re)specified, also when the entered values are unchanged.
112+
void thp_respec_well(const std::string& well_name);
113+
110114
//! \brief Mark that transmissibilities must be recalculated.
111115
void record_tran_change();
112116

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,7 @@ void handleWCONHIST(HandlerContext& handlerContext)
192192
// whether or not any value changed.
193193
handlerContext.state().events().addEvent( ScheduleEvents::WELL_THP_UPDATE );
194194
handlerContext.state().wellgroup_events().addEvent( well2.name(), ScheduleEvents::WELL_THP_UPDATE);
195+
handlerContext.thp_respec_well(well2.name());
195196

196197
if (update_well) {
197198
handlerContext.state().events().addEvent( ScheduleEvents::PRODUCTION_UPDATE );
@@ -446,6 +447,7 @@ void handleWCONPROD(HandlerContext& handlerContext)
446447
// by every WCONPROD, whether or not any value changed.
447448
handlerContext.state().events().addEvent( ScheduleEvents::WELL_THP_UPDATE );
448449
handlerContext.state().wellgroup_events().addEvent( well2.name(), ScheduleEvents::WELL_THP_UPDATE);
450+
handlerContext.thp_respec_well(well2.name());
449451

450452
if (update_well) {
451453
handlerContext.state().events().addEvent( ScheduleEvents::PRODUCTION_UPDATE );
@@ -851,6 +853,7 @@ void handleWELTARG(HandlerContext& handlerContext)
851853
{
852854
handlerContext.state().events().addEvent( ScheduleEvents::WELL_THP_UPDATE );
853855
handlerContext.state().wellgroup_events().addEvent( well_name, ScheduleEvents::WELL_THP_UPDATE);
856+
handlerContext.thp_respec_well(well_name);
854857
}
855858

856859
if (update) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -642,6 +642,7 @@ void handleWTMULT(HandlerContext& handlerContext)
642642
handlerContext.state().wellgroup_events()
643643
.addEvent(well_name, ScheduleEvents::WELL_THP_UPDATE);
644644

645+
handlerContext.thp_respec_well(well_name);
645646
}
646647

647648
if (update_well) {

0 commit comments

Comments
 (0)