2013-10-25 17:28:56 +02:00
|
|
|
/*
|
|
|
|
|
Copyright 2013 Statoil ASA.
|
|
|
|
|
|
|
|
|
|
This file is part of the Open Porous Media project (OPM).
|
|
|
|
|
|
|
|
|
|
OPM is free software: you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
|
|
OPM is distributed in the hope that it will be useful,
|
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
|
along with OPM. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*/
|
|
|
|
|
#ifndef SCHEDULE_HPP
|
|
|
|
|
#define SCHEDULE_HPP
|
|
|
|
|
|
2016-01-15 08:42:57 +01:00
|
|
|
#include <map>
|
2013-12-02 13:07:01 +01:00
|
|
|
#include <memory>
|
2013-10-25 17:28:56 +02:00
|
|
|
|
2016-01-15 08:42:57 +01:00
|
|
|
#include <boost/date_time/posix_time/posix_time_types.hpp>
|
|
|
|
|
|
2016-10-05 10:04:22 +02:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicState.hpp>
|
2016-10-05 10:12:46 +02:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/DynamicVector.hpp>
|
2016-10-05 10:09:45 +02:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/Events.hpp>
|
2016-10-05 14:39:01 +02:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/Group.hpp>
|
2016-10-05 10:34:58 +02:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/GroupTree.hpp>
|
2016-10-05 12:43:36 +02:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/OilVaporizationProperties.hpp>
|
2016-01-15 08:42:57 +01:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/ScheduleEnums.hpp>
|
2016-10-05 10:04:22 +02:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/Tuning.hpp>
|
2016-01-15 08:42:57 +01:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Util/OrderedMap.hpp>
|
2016-10-17 10:41:17 +08:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Schedule/MessageLimits.hpp>
|
2016-11-02 13:29:00 +01:00
|
|
|
#include <opm/parser/eclipse/EclipseState/Runspec.hpp>
|
2016-04-14 09:39:28 +08:00
|
|
|
#include <opm/parser/eclipse/Parser/MessageContainer.hpp>
|
2013-10-25 17:28:56 +02:00
|
|
|
|
2014-12-08 16:34:28 +01:00
|
|
|
namespace Opm
|
2013-10-25 17:28:56 +02:00
|
|
|
{
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2016-01-24 21:49:39 +01:00
|
|
|
class Deck;
|
|
|
|
|
class DeckKeyword;
|
|
|
|
|
class DeckRecord;
|
2016-01-15 08:42:57 +01:00
|
|
|
class EclipseGrid;
|
2016-03-16 17:15:09 +08:00
|
|
|
class ParseContext;
|
2016-01-15 08:42:57 +01:00
|
|
|
class SCHEDULESection;
|
|
|
|
|
class TimeMap;
|
2016-01-24 21:49:39 +01:00
|
|
|
class UnitSystem;
|
2016-01-15 08:42:57 +01:00
|
|
|
class Well;
|
|
|
|
|
|
2013-10-25 17:28:56 +02:00
|
|
|
class Schedule {
|
|
|
|
|
public:
|
2016-09-08 19:42:45 +02:00
|
|
|
Schedule(const ParseContext& parseContext, const EclipseGrid& grid,
|
2016-11-02 15:50:39 +01:00
|
|
|
const Deck& deck, const Phases &phases );
|
2016-09-08 19:42:45 +02:00
|
|
|
|
2016-05-19 12:39:22 +02:00
|
|
|
/*
|
|
|
|
|
* If the input deck does not specify a start time, Eclipse's 1. Jan
|
|
|
|
|
* 1983 is defaulted
|
|
|
|
|
*/
|
2016-01-15 08:42:57 +01:00
|
|
|
boost::posix_time::ptime getStartTime() const;
|
2016-05-19 12:10:40 +02:00
|
|
|
time_t posixStartTime() const;
|
2016-09-12 14:28:19 +02:00
|
|
|
time_t posixEndTime() const;
|
|
|
|
|
|
2016-05-19 12:10:40 +02:00
|
|
|
|
2016-10-12 12:26:14 +02:00
|
|
|
const TimeMap& getTimeMap() const;
|
2013-11-05 15:25:47 +01:00
|
|
|
|
|
|
|
|
size_t numWells() const;
|
2015-02-12 12:54:57 +01:00
|
|
|
size_t numWells(size_t timestep) const;
|
|
|
|
|
size_t getMaxNumCompletionsForWells(size_t timestep) const;
|
2013-11-05 15:25:47 +01:00
|
|
|
bool hasWell(const std::string& wellName) const;
|
2016-06-16 08:37:10 +02:00
|
|
|
const Well* getWell(const std::string& wellName) const;
|
|
|
|
|
std::vector< const Well* > getOpenWells(size_t timeStep) const;
|
|
|
|
|
std::vector< const Well* > getWells() const;
|
|
|
|
|
std::vector< const Well* > getWells(size_t timeStep) const;
|
|
|
|
|
std::vector< const Well* > getWellsMatching( const std::string& ) const;
|
2016-10-05 12:43:36 +02:00
|
|
|
const OilVaporizationProperties& getOilVaporizationProperties(size_t timestep);
|
2016-01-15 08:42:57 +01:00
|
|
|
|
2016-10-05 10:34:58 +02:00
|
|
|
const GroupTree& getGroupTree(size_t t) const;
|
2013-11-18 13:11:49 +01:00
|
|
|
size_t numGroups() const;
|
|
|
|
|
bool hasGroup(const std::string& groupName) const;
|
2016-10-05 14:39:01 +02:00
|
|
|
const Group& getGroup(const std::string& groupName) const;
|
2016-02-01 14:16:07 +01:00
|
|
|
std::vector< const Group* > getGroups() const;
|
2016-10-05 10:04:22 +02:00
|
|
|
const Tuning& getTuning() const;
|
2016-10-17 10:41:17 +08:00
|
|
|
const MessageLimits& getMessageLimits() const;
|
2015-04-17 18:51:42 +02:00
|
|
|
|
2015-06-23 14:20:31 +02:00
|
|
|
const Events& getEvents() const;
|
2015-10-02 10:49:23 +02:00
|
|
|
bool hasOilVaporizationProperties();
|
2015-10-30 15:33:53 +01:00
|
|
|
std::shared_ptr<const Deck> getModifierDeck(size_t timeStep) const;
|
2016-04-14 09:39:28 +08:00
|
|
|
const MessageContainer& getMessageContainer() const;
|
|
|
|
|
MessageContainer& getMessageContainer();
|
2015-10-02 10:49:23 +02:00
|
|
|
|
2014-12-08 16:34:28 +01:00
|
|
|
|
2013-10-25 17:28:56 +02:00
|
|
|
private:
|
2016-01-15 08:42:57 +01:00
|
|
|
std::shared_ptr< TimeMap > m_timeMap;
|
|
|
|
|
OrderedMap<std::shared_ptr< Well >> m_wells;
|
2016-10-05 14:39:01 +02:00
|
|
|
std::map<std::string, Group > m_groups;
|
2016-10-05 10:34:58 +02:00
|
|
|
DynamicState< GroupTree > m_rootGroupTree;
|
2016-10-05 12:43:36 +02:00
|
|
|
DynamicState< OilVaporizationProperties > m_oilvaporizationproperties;
|
2016-10-05 10:09:45 +02:00
|
|
|
Events m_events;
|
2016-10-05 10:12:46 +02:00
|
|
|
DynamicVector<std::shared_ptr<Deck> > m_modifierDeck;
|
2016-10-05 10:04:22 +02:00
|
|
|
Tuning m_tuning;
|
2016-10-17 10:41:17 +08:00
|
|
|
MessageLimits m_messageLimits;
|
2016-11-02 13:29:00 +01:00
|
|
|
Phases m_phases;
|
2016-10-31 16:47:59 +01:00
|
|
|
|
2016-04-14 09:39:28 +08:00
|
|
|
MessageContainer m_messages;
|
2016-09-22 09:28:43 +02:00
|
|
|
WellProducer::ControlModeEnum m_controlModeWHISTCTL;
|
2015-10-02 10:49:23 +02:00
|
|
|
|
2016-06-16 08:37:10 +02:00
|
|
|
std::vector< Well* > getWells(const std::string& wellNamePattern);
|
2016-06-15 14:34:28 +02:00
|
|
|
void updateWellStatus( Well& well, size_t reportStep , WellCommon::StatusEnum status);
|
2016-06-16 08:37:10 +02:00
|
|
|
void addWellToGroup( Group& newGroup , Well& well , size_t timeStep);
|
2016-09-08 19:42:45 +02:00
|
|
|
void iterateScheduleSection(const ParseContext& parseContext , const SCHEDULESection& , const EclipseGrid& grid);
|
2016-10-05 10:34:58 +02:00
|
|
|
bool handleGroupFromWELSPECS(const std::string& groupName, GroupTree& newTree) const;
|
2013-11-25 16:31:44 +01:00
|
|
|
void addGroup(const std::string& groupName , size_t timeStep);
|
2016-02-09 12:09:40 +01:00
|
|
|
void addWell(const std::string& wellName, const DeckRecord& record, size_t timeStep, WellCompletion::CompletionOrderEnum wellCompletionOrder);
|
2016-03-16 17:15:09 +08:00
|
|
|
void handleCOMPORD(const ParseContext& parseContext, const DeckKeyword& compordKeyword, size_t currentStep);
|
2016-08-05 15:28:29 +02:00
|
|
|
void handleWELSPECS( const SCHEDULESection&, size_t, size_t );
|
2016-02-09 12:09:40 +01:00
|
|
|
void handleWCONProducer( const DeckKeyword& keyword, size_t currentStep, bool isPredictionMode);
|
|
|
|
|
void handleWCONHIST( const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleWCONPROD( const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleWGRUPCON( const DeckKeyword& keyword, size_t currentStep);
|
2016-09-08 19:42:45 +02:00
|
|
|
void handleCOMPDAT( const DeckKeyword& keyword, size_t currentStep, const EclipseGrid& grid);
|
2016-02-09 12:09:40 +01:00
|
|
|
void handleWELSEGS( const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleCOMPSEGS( const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleWCONINJE( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleWPOLYMER( const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleWSOLVENT( const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleWCONINJH( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleWELOPEN( const DeckKeyword& keyword, size_t currentStep, bool hascomplump);
|
|
|
|
|
void handleWELTARG( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleGCONINJE( const SCHEDULESection&, const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleGCONPROD( const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleGEFAC( const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleTUNING( const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleGRUPTREE( const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleWRFT( const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleWRFTPLT( const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleWPIMULT( const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleDRSDT( const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleDRVDT( const DeckKeyword& keyword, size_t currentStep);
|
|
|
|
|
void handleVAPPARS( const DeckKeyword& keyword, size_t currentStep);
|
2016-06-23 13:44:03 +02:00
|
|
|
void handleWECON( const DeckKeyword& keyword, size_t currentStep);
|
2016-09-22 09:28:43 +02:00
|
|
|
void handleWHISTCTL(const ParseContext& parseContext, const DeckKeyword& keyword);
|
2016-10-14 10:06:35 +08:00
|
|
|
void handleMESSAGES(const DeckKeyword& keyword, size_t currentStep);
|
2016-02-09 12:09:40 +01:00
|
|
|
|
|
|
|
|
void checkUnhandledKeywords( const SCHEDULESection& ) const;
|
2014-02-19 15:43:42 +01:00
|
|
|
|
2015-01-28 09:30:07 +01:00
|
|
|
static double convertInjectionRateToSI(double rawRate, WellInjector::TypeEnum wellType, const Opm::UnitSystem &unitSystem);
|
2016-10-31 16:47:59 +01:00
|
|
|
static double convertInjectionRateToSI(double rawRate, Phase wellPhase, const Opm::UnitSystem &unitSystem);
|
2014-02-19 15:43:42 +01:00
|
|
|
static bool convertEclipseStringToBool(const std::string& eclipseString);
|
2015-01-14 11:41:13 +01:00
|
|
|
|
2013-10-25 17:28:56 +02:00
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|