Maintain whether a well has ever injected

This commit is contained in:
Joakim Hove 2020-10-14 00:39:48 +02:00
parent e1698f7be8
commit dd34f2d831
3 changed files with 25 additions and 0 deletions

View File

@ -565,7 +565,9 @@ public:
bool segmented_density_calculation() const { return true; } bool segmented_density_calculation() const { return true; }
double alq_value() const; double alq_value() const;
double temperature() const; double temperature() const;
bool hasInjected( ) const;
bool hasProduced( ) const; bool hasProduced( ) const;
bool updateHasInjected( );
bool updateHasProduced(); bool updateHasProduced();
bool cmp_structure(const Well& other) const; bool cmp_structure(const Well& other) const;
bool operator==(const Well& data) const; bool operator==(const Well& data) const;
@ -595,6 +597,7 @@ public:
serializer(efficiency_factor); serializer(efficiency_factor);
serializer(solvent_fraction); serializer(solvent_fraction);
serializer(has_produced); serializer(has_produced);
serializer(has_injected);
serializer(prediction_mode); serializer(prediction_mode);
serializer(productivity_index); serializer(productivity_index);
serializer(econ_limits); serializer(econ_limits);
@ -632,6 +635,7 @@ private:
double efficiency_factor; double efficiency_factor;
double solvent_fraction; double solvent_fraction;
bool has_produced = false; bool has_produced = false;
bool has_injected = false;
bool prediction_mode = true; bool prediction_mode = true;
std::optional<double> productivity_index{ std::nullopt }; std::optional<double> productivity_index{ std::nullopt };

View File

@ -953,6 +953,9 @@ namespace {
if (well2->updatePrediction(true)) if (well2->updatePrediction(true))
update_well = true; update_well = true;
if (well2->updateHasInjected())
update_well = true;
if (update_well) { if (update_well) {
this->updateWell(well2, handlerContext.currentStep); this->updateWell(well2, handlerContext.currentStep);
m_events.addEvent( ScheduleEvents::INJECTION_UPDATE , handlerContext.currentStep ); m_events.addEvent( ScheduleEvents::INJECTION_UPDATE , handlerContext.currentStep );
@ -1012,6 +1015,9 @@ namespace {
if (well2->updatePrediction(false)) if (well2->updatePrediction(false))
update_well = true; update_well = true;
if (well2->updateHasInjected())
update_well = true;
if (update_well) { if (update_well) {
this->updateWell(well2, handlerContext.currentStep); this->updateWell(well2, handlerContext.currentStep);
m_events.addEvent( ScheduleEvents::INJECTION_UPDATE , handlerContext.currentStep ); m_events.addEvent( ScheduleEvents::INJECTION_UPDATE , handlerContext.currentStep );

View File

@ -510,6 +510,17 @@ bool Well::updateHasProduced() {
return false; return false;
} }
bool Well::updateHasInjected() {
if (this->wtype.injector() && this->status == Status::OPEN) {
if (this->has_injected)
return false;
this->has_injected= true;
return true;
}
return false;
}
bool Well::updateProduction(std::shared_ptr<WellProductionProperties> production_arg) { bool Well::updateProduction(std::shared_ptr<WellProductionProperties> production_arg) {
if (!this->wtype.producer()) if (!this->wtype.producer())
this->switchToProducer( ); this->switchToProducer( );
@ -1142,6 +1153,10 @@ bool Well::hasProduced( ) const {
return this->has_produced; return this->has_produced;
} }
bool Well::hasInjected( ) const {
return this->has_injected;
}
bool Well::updatePrediction(bool prediction_mode_arg) { bool Well::updatePrediction(bool prediction_mode_arg) {
if (this->prediction_mode != prediction_mode_arg) { if (this->prediction_mode != prediction_mode_arg) {