mirror of
https://github.com/OPM/opm-simulators.git
synced 2025-02-25 18:55:30 -06:00
Add Events member to SingleWellState
This commit is contained in:
@@ -612,7 +612,7 @@ namespace Opm {
|
|||||||
if (this->wellTestState_.hasWellClosed(well_name)) {
|
if (this->wellTestState_.hasWellClosed(well_name)) {
|
||||||
// TODO: more checking here, to make sure this standard more specific and complete
|
// TODO: more checking here, to make sure this standard more specific and complete
|
||||||
// maybe there is some WCON keywords will not open the well
|
// maybe there is some WCON keywords will not open the well
|
||||||
auto& events = this->wellState().events(w);
|
auto& events = this->wellState().well(w).events;
|
||||||
if (events.hasEvent(WellState::event_mask)) {
|
if (events.hasEvent(WellState::event_mask)) {
|
||||||
if (wellTestState_.lastTestTime(well_name) == ebosSimulator_.time()) {
|
if (wellTestState_.lastTestTime(well_name) == ebosSimulator_.time()) {
|
||||||
// The well was shut this timestep, we are most likely retrying
|
// The well was shut this timestep, we are most likely retrying
|
||||||
@@ -1424,7 +1424,7 @@ namespace Opm {
|
|||||||
|
|
||||||
if (!well->isOperable() ) continue;
|
if (!well->isOperable() ) continue;
|
||||||
|
|
||||||
auto& events = this->wellState().events(well->indexOfWell());
|
auto& events = this->wellState().well(well->indexOfWell()).events;
|
||||||
if (events.hasEvent(WellState::event_mask)) {
|
if (events.hasEvent(WellState::event_mask)) {
|
||||||
well->updateWellStateWithTarget(ebosSimulator_, this->groupState(), this->wellState(), deferred_logger);
|
well->updateWellStateWithTarget(ebosSimulator_, this->groupState(), this->wellState(), deferred_logger);
|
||||||
// There is no new well control change input within a report step,
|
// There is no new well control change input within a report step,
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#define OPM_SINGLE_WELL_STATE_HEADER_INCLUDED
|
#define OPM_SINGLE_WELL_STATE_HEADER_INCLUDED
|
||||||
|
|
||||||
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
#include <opm/parser/eclipse/EclipseState/Schedule/Well/Well.hpp>
|
||||||
|
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
|
||||||
|
|
||||||
namespace Opm {
|
namespace Opm {
|
||||||
|
|
||||||
@@ -33,6 +34,7 @@ public:
|
|||||||
double bhp{0};
|
double bhp{0};
|
||||||
double thp{0};
|
double thp{0};
|
||||||
double temperature{};
|
double temperature{};
|
||||||
|
Events events;
|
||||||
|
|
||||||
void init_timestep(const SingleWellState& other);
|
void init_timestep(const SingleWellState& other);
|
||||||
void shut();
|
void shut();
|
||||||
|
|||||||
@@ -257,15 +257,12 @@ void WellState::init(const std::vector<double>& cellPressures,
|
|||||||
well_dissolved_gas_rates_.clear();
|
well_dissolved_gas_rates_.clear();
|
||||||
well_vaporized_oil_rates_.clear();
|
well_vaporized_oil_rates_.clear();
|
||||||
|
|
||||||
this->events_.clear();
|
|
||||||
{
|
{
|
||||||
const auto& wg_events = schedule[report_step].wellgroup_events();
|
const auto& wg_events = schedule[report_step].wellgroup_events();
|
||||||
for (const auto& ecl_well : wells_ecl) {
|
for (const auto& ecl_well : wells_ecl) {
|
||||||
const auto& wname = ecl_well.name();
|
const auto& wname = ecl_well.name();
|
||||||
if (wg_events.has(wname))
|
if (wg_events.has(wname))
|
||||||
this->events_.add( wname, wg_events.at(wname) );
|
this->well(wname).events = wg_events.at(wname);
|
||||||
else
|
|
||||||
this->events_.add( wname, Events() );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -363,7 +360,7 @@ void WellState::init(const std::vector<double>& cellPressures,
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
// If new target is set using WCONPROD, WCONINJE etc. we use the new control
|
// If new target is set using WCONPROD, WCONINJE etc. we use the new control
|
||||||
if (!this->events_[w].hasEvent(WellState::event_mask)) {
|
if (!new_well.events.hasEvent(WellState::event_mask)) {
|
||||||
current_injection_controls_[ newIndex ] = prevState->currentInjectionControl(oldIndex);
|
current_injection_controls_[ newIndex ] = prevState->currentInjectionControl(oldIndex);
|
||||||
current_production_controls_[ newIndex ] = prevState->currentProductionControl(oldIndex);
|
current_production_controls_[ newIndex ] = prevState->currentProductionControl(oldIndex);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -148,10 +148,6 @@ public:
|
|||||||
static void calculateSegmentRates(const std::vector<std::vector<int>>& segment_inlets, const std::vector<std::vector<int>>&segment_perforations,
|
static void calculateSegmentRates(const std::vector<std::vector<int>>& segment_inlets, const std::vector<std::vector<int>>&segment_perforations,
|
||||||
const std::vector<double>& perforation_rates, const int np, const int segment, std::vector<double>& segment_rates);
|
const std::vector<double>& perforation_rates, const int np, const int segment, std::vector<double>& segment_rates);
|
||||||
|
|
||||||
Events& events(std::size_t well_index) {
|
|
||||||
return this->events_[well_index];
|
|
||||||
}
|
|
||||||
|
|
||||||
/// One rate pr well
|
/// One rate pr well
|
||||||
double solventWellRate(const int w) const;
|
double solventWellRate(const int w) const;
|
||||||
|
|
||||||
@@ -393,11 +389,6 @@ private:
|
|||||||
// should be zero for injection wells
|
// should be zero for injection wells
|
||||||
WellContainer<double> well_vaporized_oil_rates_;
|
WellContainer<double> well_vaporized_oil_rates_;
|
||||||
|
|
||||||
// some events happens to the well, like this well is a new well
|
|
||||||
// or new well control keywords happens
|
|
||||||
// \Note: for now, only WCON* keywords, and well status change is considered
|
|
||||||
WellContainer<Events> events_;
|
|
||||||
|
|
||||||
WellContainer<SegmentState> segment_state;
|
WellContainer<SegmentState> segment_state;
|
||||||
|
|
||||||
// Productivity Index
|
// Productivity Index
|
||||||
|
|||||||
Reference in New Issue
Block a user