diff --git a/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp b/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp index d7f5bc01a..f78893c1c 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Schedule.cpp @@ -1317,7 +1317,14 @@ namespace Opm { if (allowCrossFlowStr == "NO") allowCrossFlow = false; - auto well = std::make_shared(wellName, m_grid , headI, headJ, refDepth, preferredPhase, m_timeMap , timeStep, wellCompletionOrder, allowCrossFlow); + bool automaticShutIn = true; + const std::string& automaticShutInStr = record.getItem().getTrimmedString(0); + if (automaticShutInStr == "STOP") { + automaticShutIn = false; + } + + auto well = std::make_shared(wellName, m_grid , headI, headJ, refDepth, preferredPhase, m_timeMap , timeStep, + wellCompletionOrder, allowCrossFlow, automaticShutIn); m_wells.insert( wellName , well); m_events->addEvent( ScheduleEvents::NEW_WELL , timeStep ); } diff --git a/opm/parser/eclipse/EclipseState/Schedule/Well.cpp b/opm/parser/eclipse/EclipseState/Schedule/Well.cpp index d6e00d1a2..d859511b9 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Well.cpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Well.cpp @@ -34,7 +34,7 @@ namespace Opm { Well::Well(const std::string& name_, std::shared_ptr grid , int headI, int headJ, Value refDepth , Phase::PhaseEnum preferredPhase, - TimeMapConstPtr timeMap, size_t creationTimeStep, WellCompletion::CompletionOrderEnum completionOrdering, bool allowCrossFlow) + TimeMapConstPtr timeMap, size_t creationTimeStep, WellCompletion::CompletionOrderEnum completionOrdering, bool allowCrossFlow, bool automaticShutIn) : m_status(new DynamicState(timeMap, WellCommon::SHUT)), m_isAvailableForGroupControl(new DynamicState(timeMap, true)), m_guideRate(new DynamicState(timeMap, -1.0)), @@ -58,6 +58,7 @@ namespace Opm { m_grid( grid ), m_comporder(completionOrdering), m_allowCrossFlow(allowCrossFlow), + m_automaticShutIn(automaticShutIn), m_segmentset(new DynamicState(timeMap, SegmentSetPtr(new SegmentSet()))) { m_name = name_; @@ -399,6 +400,10 @@ namespace Opm { return m_allowCrossFlow; } + bool Well::getAutomaticShutIn() const { + return m_automaticShutIn; + } + bool Well::canOpen(size_t currentStep) const { bool canOpen = true; if (!getAllowCrossFlow()) { diff --git a/opm/parser/eclipse/EclipseState/Schedule/Well.hpp b/opm/parser/eclipse/EclipseState/Schedule/Well.hpp index bc8d2b3c1..a466315bb 100644 --- a/opm/parser/eclipse/EclipseState/Schedule/Well.hpp +++ b/opm/parser/eclipse/EclipseState/Schedule/Well.hpp @@ -46,7 +46,8 @@ namespace Opm { class Well { public: Well(const std::string& name, std::shared_ptr grid , int headI, int headJ, Value refDepth , Phase::PhaseEnum preferredPhase, - std::shared_ptr< const TimeMap > timeMap, size_t creationTimeStep, WellCompletion::CompletionOrderEnum completionOrdering = WellCompletion::TRACK, bool allowCrossFlow = true); + std::shared_ptr< const TimeMap > timeMap, size_t creationTimeStep, WellCompletion::CompletionOrderEnum completionOrdering = WellCompletion::TRACK, + bool allowCrossFlow = true, bool automaticShutIn = true); const std::string& name() const; bool hasBeenDefined(size_t timeStep) const; @@ -122,6 +123,7 @@ namespace Opm { WellCompletion::CompletionOrderEnum getWellCompletionOrdering() const; bool getAllowCrossFlow() const; + bool getAutomaticShutIn() const; bool canOpen(size_t time_step) const; @@ -166,6 +168,7 @@ namespace Opm { WellCompletion::CompletionOrderEnum m_comporder; bool m_allowCrossFlow; + bool m_automaticShutIn; MessageContainer m_messages; // WELSEGS DATA - for mutli-segment wells // flag indicating if the well is a multi-segment well