2019-03-23 16:11:37 +01:00
/*
Copyright 2019 Equinor 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 WELL2_HPP
# define WELL2_HPP
# include <string>
2020-03-30 12:05:23 +02:00
# include <iosfwd>
2019-03-23 16:11:37 +01:00
# include <opm/parser/eclipse/EclipseState/Runspec.hpp>
2019-05-09 17:03:29 +02:00
# include <opm/parser/eclipse/EclipseState/Schedule/SummaryState.hpp>
2019-03-23 16:11:37 +01:00
# include <opm/parser/eclipse/EclipseState/Schedule/Well/WellConnections.hpp>
# include <opm/parser/eclipse/EclipseState/Schedule/MSW/WellSegments.hpp>
2020-02-27 14:29:01 +01:00
# include <opm/parser/eclipse/EclipseState/Schedule/ScheduleTypes.hpp>
2019-05-09 17:03:29 +02:00
# include <opm/parser/eclipse/EclipseState/Schedule/Well/ProductionControls.hpp>
# include <opm/parser/eclipse/EclipseState/Schedule/Well/InjectionControls.hpp>
2019-07-03 10:04:20 +02:00
# include <opm/parser/eclipse/EclipseState/Schedule/Well/WellFoamProperties.hpp>
2019-11-27 13:26:28 +01:00
# include <opm/parser/eclipse/EclipseState/Schedule/Well/WellBrineProperties.hpp>
2019-03-23 16:11:37 +01:00
# include <opm/parser/eclipse/EclipseState/Schedule/Well/WellTracerProperties.hpp>
# include <opm/parser/eclipse/EclipseState/Schedule/Well/WellPolymerProperties.hpp>
# include <opm/parser/eclipse/EclipseState/Schedule/Well/WellEconProductionLimits.hpp>
2019-06-08 12:25:29 +02:00
# include <opm/parser/eclipse/Units/Units.hpp>
2019-03-23 16:11:37 +01:00
2019-12-10 11:46:49 +01:00
# include <opm/common/utility/ActiveGridCells.hpp>
2019-03-23 16:11:37 +01:00
namespace Opm {
class DeckRecord ;
class EclipseGrid ;
class DeckKeyword ;
2019-06-14 16:05:21 +02:00
struct WellInjectionProperties ;
2019-05-19 15:39:03 +02:00
class WellProductionProperties ;
2019-06-19 13:40:27 +02:00
class UDQActive ;
2019-08-23 18:29:07 +02:00
class UDQConfig ;
2020-03-12 18:01:37 +01:00
namespace RestartIO {
2020-03-13 13:49:03 +01:00
struct RstWell ;
2020-03-12 18:01:37 +01:00
}
2019-03-23 16:11:37 +01:00
2019-11-12 08:29:28 +01:00
class Well {
2019-03-23 16:11:37 +01:00
public :
2019-08-31 08:10:44 +02:00
2019-08-23 13:58:39 +02:00
enum class Status {
OPEN = 1 ,
STOP = 2 ,
SHUT = 3 ,
AUTO = 4
} ;
static std : : string Status2String ( Status enumValue ) ;
static Status StatusFromString ( const std : : string & stringValue ) ;
2019-08-23 18:29:07 +02:00
2019-08-26 13:11:15 +02:00
/*
The elements in this enum are used as bitmasks to keep track
of which controls are present , i . e . the 2 ^ n structure must
be intact .
*/
enum class InjectorCMode : int {
RATE = 1 ,
RESV = 2 ,
BHP = 4 ,
THP = 8 ,
GRUP = 16 ,
CMODE_UNDEFINED = 512
} ;
static const std : : string InjectorCMode2String ( InjectorCMode enumValue ) ;
static InjectorCMode InjectorCModeFromString ( const std : : string & stringValue ) ;
2019-08-29 17:05:00 +02:00
/*
The items BHP , THP and GRUP only apply in prediction mode :
WCONPROD . The elements in this enum are used as bitmasks to
keep track of which controls are present , i . e . the 2 ^ n
structure must be intact . The NONE item is only used in WHISTCTL
to cancel its effect .
The properties are initialized with the CMODE_UNDEFINED
value , but the undefined value is never assigned apart from
that ; and it is not part of the string conversion routines .
*/
enum class ProducerCMode : int {
NONE = 0 ,
ORAT = 1 ,
WRAT = 2 ,
GRAT = 4 ,
LRAT = 8 ,
CRAT = 16 ,
RESV = 32 ,
BHP = 64 ,
THP = 128 ,
GRUP = 256 ,
CMODE_UNDEFINED = 1024
} ;
static const std : : string ProducerCMode2String ( ProducerCMode enumValue ) ;
static ProducerCMode ProducerCModeFromString ( const std : : string & stringValue ) ;
enum class WELTARGCMode {
ORAT = 1 ,
WRAT = 2 ,
GRAT = 3 ,
LRAT = 4 ,
CRAT = 5 , // Not supported
RESV = 6 ,
BHP = 7 ,
THP = 8 ,
VFP = 9 ,
LIFT = 10 , // Not supported
GUID = 11
} ;
static WELTARGCMode WELTARGCModeFromString ( const std : : string & stringValue ) ;
2019-08-26 13:11:15 +02:00
2019-09-02 13:44:46 +02:00
enum class GuideRateTarget {
OIL = 0 ,
WAT = 1 ,
GAS = 2 ,
LIQ = 3 ,
COMB = 4 ,
WGA = 5 ,
CVAL = 6 ,
RAT = 7 ,
RES = 8 ,
UNDEFINED = 9
} ;
static const std : : string GuideRateTarget2String ( GuideRateTarget enumValue ) ;
static GuideRateTarget GuideRateTargetFromString ( const std : : string & stringValue ) ;
struct WellGuideRate {
bool available ;
double guide_rate ;
GuideRateTarget guide_phase ;
double scale_factor ;
2019-12-10 14:05:01 +01:00
2020-03-19 15:21:20 +01:00
static WellGuideRate serializeObject ( )
{
WellGuideRate result ;
result . available = true ;
result . guide_rate = 1.0 ;
result . guide_phase = GuideRateTarget : : COMB ;
result . scale_factor = 2.0 ;
return result ;
}
2019-12-10 14:05:01 +01:00
bool operator = = ( const WellGuideRate & data ) const {
return available = = data . available & &
guide_rate = = data . guide_rate & &
guide_phase = = data . guide_phase & &
scale_factor = = data . scale_factor ;
}
2020-03-18 11:57:30 +01:00
template < class Serializer >
void serializeOp ( Serializer & serializer )
{
serializer ( available ) ;
serializer ( guide_rate ) ;
serializer ( guide_phase ) ;
serializer ( scale_factor ) ;
}
2019-09-02 13:44:46 +02:00
} ;
2019-09-24 18:02:22 +02:00
2019-08-23 18:29:07 +02:00
struct InjectionControls {
public :
InjectionControls ( int controls_arg ) :
controls ( controls_arg )
{ }
double bhp_limit ;
double thp_limit ;
InjectorType injector_type ;
2020-02-11 10:51:18 +01:00
InjectorCMode cmode = InjectorCMode : : CMODE_UNDEFINED ;
2019-08-23 18:29:07 +02:00
double surface_rate ;
double reservoir_rate ;
double temperature ;
int vfp_table_number ;
bool prediction_mode ;
2019-08-26 13:11:15 +02:00
bool hasControl ( InjectorCMode cmode_arg ) const {
return ( this - > controls & static_cast < int > ( cmode_arg ) ) ! = 0 ;
2019-08-23 18:29:07 +02:00
}
2019-08-26 13:11:15 +02:00
2019-08-23 18:29:07 +02:00
private :
int controls ;
} ;
struct WellInjectionProperties {
std : : string name ;
UDAValue surfaceInjectionRate ;
UDAValue reservoirInjectionRate ;
2020-01-03 20:31:22 +01:00
UDAValue BHPTarget ;
UDAValue THPTarget ;
2020-01-08 15:12:23 +01:00
double bhp_hist_limit = 0.0 ;
double thp_hist_limit = 0.0 ;
2020-01-03 20:31:22 +01:00
2019-08-23 18:29:07 +02:00
double temperature ;
double BHPH ;
double THPH ;
int VFPTableNumber ;
bool predictionMode ;
int injectionControls ;
2020-02-27 14:29:01 +01:00
InjectorType injectorType ;
2019-08-26 13:11:15 +02:00
InjectorCMode controlMode ;
2019-08-23 18:29:07 +02:00
bool operator = = ( const WellInjectionProperties & other ) const ;
bool operator ! = ( const WellInjectionProperties & other ) const ;
2019-12-10 14:05:39 +01:00
WellInjectionProperties ( ) ;
2020-03-05 09:03:54 +01:00
WellInjectionProperties ( const UnitSystem & units , const std : : string & wname ) ;
2020-03-19 15:21:20 +01:00
static WellInjectionProperties serializeObject ( ) ;
2019-12-10 14:05:39 +01:00
2020-01-03 20:31:22 +01:00
void handleWELTARG ( WELTARGCMode cmode , double newValue , double SIFactorP ) ;
2019-08-23 18:29:07 +02:00
void handleWCONINJE ( const DeckRecord & record , bool availableForGroupControl , const std : : string & well_name ) ;
void handleWCONINJH ( const DeckRecord & record , bool is_producer , const std : : string & well_name ) ;
2019-08-26 13:11:15 +02:00
bool hasInjectionControl ( InjectorCMode controlModeArg ) const {
if ( injectionControls & static_cast < int > ( controlModeArg ) )
2019-08-23 18:29:07 +02:00
return true ;
else
return false ;
}
2019-08-26 13:11:15 +02:00
void dropInjectionControl ( InjectorCMode controlModeArg ) {
auto int_arg = static_cast < int > ( controlModeArg ) ;
if ( ( injectionControls & int_arg ) ! = 0 )
injectionControls - = int_arg ;
2019-08-23 18:29:07 +02:00
}
2019-08-26 13:11:15 +02:00
void addInjectionControl ( InjectorCMode controlModeArg ) {
auto int_arg = static_cast < int > ( controlModeArg ) ;
if ( ( injectionControls & int_arg ) = = 0 )
injectionControls + = int_arg ;
2019-08-23 18:29:07 +02:00
}
void resetDefaultHistoricalBHPLimit ( ) ;
2020-01-03 20:31:22 +01:00
void resetBHPLimit ( ) ;
2019-08-23 18:29:07 +02:00
void setBHPLimit ( const double limit ) ;
InjectionControls controls ( const UnitSystem & unit_system , const SummaryState & st , double udq_default ) const ;
bool updateUDQActive ( const UDQConfig & udq_config , UDQActive & active ) const ;
2020-03-18 12:17:31 +01:00
template < class Serializer >
void serializeOp ( Serializer & serializer )
{
serializer ( name ) ;
surfaceInjectionRate . serializeOp ( serializer ) ;
reservoirInjectionRate . serializeOp ( serializer ) ;
BHPTarget . serializeOp ( serializer ) ;
THPTarget . serializeOp ( serializer ) ;
serializer ( bhp_hist_limit ) ;
serializer ( thp_hist_limit ) ;
serializer ( temperature ) ;
serializer ( BHPH ) ;
serializer ( THPH ) ;
serializer ( VFPTableNumber ) ;
serializer ( predictionMode ) ;
serializer ( injectionControls ) ;
serializer ( injectorType ) ;
serializer ( controlMode ) ;
}
2019-08-23 18:29:07 +02:00
} ;
2019-08-29 17:05:00 +02:00
struct ProductionControls {
public :
ProductionControls ( int controls_arg ) :
controls ( controls_arg )
{
}
2020-02-11 10:51:18 +01:00
ProducerCMode cmode = ProducerCMode : : NONE ;
2019-08-29 17:05:00 +02:00
double oil_rate ;
double water_rate ;
double gas_rate ;
double liquid_rate ;
double resv_rate ;
double bhp_history ;
double thp_history ;
double bhp_limit ;
double thp_limit ;
double alq_value ;
int vfp_table_number ;
bool prediction_mode ;
bool hasControl ( ProducerCMode cmode_arg ) const {
return ( this - > controls & static_cast < int > ( cmode_arg ) ) ! = 0 ;
}
private :
int controls ;
} ;
class WellProductionProperties {
public :
// the rates serve as limits under prediction mode
// while they are observed rates under historical mode
std : : string name ;
UDAValue OilRate ;
UDAValue WaterRate ;
UDAValue GasRate ;
UDAValue LiquidRate ;
UDAValue ResVRate ;
2020-01-03 20:31:22 +01:00
UDAValue BHPTarget ;
UDAValue THPTarget ;
2019-08-29 17:05:00 +02:00
// BHP and THP limit
2020-01-08 15:12:23 +01:00
double bhp_hist_limit = 0.0 ;
double thp_hist_limit = 0.0 ;
2020-01-03 20:31:22 +01:00
2019-08-29 17:05:00 +02:00
// historical BHP and THP under historical mode
double BHPH = 0.0 ;
double THPH = 0.0 ;
int VFPTableNumber = 0 ;
double ALQValue = 0.0 ;
bool predictionMode = false ;
ProducerCMode controlMode = ProducerCMode : : CMODE_UNDEFINED ;
ProducerCMode whistctl_cmode = ProducerCMode : : CMODE_UNDEFINED ;
bool operator = = ( const WellProductionProperties & other ) const ;
bool operator ! = ( const WellProductionProperties & other ) const ;
2019-12-10 14:05:39 +01:00
WellProductionProperties ( ) ;
2020-03-04 20:56:16 +01:00
WellProductionProperties ( const UnitSystem & units , const std : : string & name_arg ) ;
2020-03-19 15:21:20 +01:00
static WellProductionProperties serializeObject ( ) ;
2019-08-29 17:05:00 +02:00
bool hasProductionControl ( ProducerCMode controlModeArg ) const {
return ( m_productionControls & static_cast < int > ( controlModeArg ) ) ! = 0 ;
}
void dropProductionControl ( ProducerCMode controlModeArg ) {
if ( hasProductionControl ( controlModeArg ) )
m_productionControls - = static_cast < int > ( controlModeArg ) ;
}
void addProductionControl ( ProducerCMode controlModeArg ) {
if ( ! hasProductionControl ( controlModeArg ) )
m_productionControls + = static_cast < int > ( controlModeArg ) ;
}
// this is used to check whether the specified control mode is an effective history matching production mode
static bool effectiveHistoryProductionControl ( ProducerCMode cmode ) ;
void handleWCONPROD ( const std : : string & well , const DeckRecord & record ) ;
void handleWCONHIST ( const DeckRecord & record ) ;
2020-01-03 20:31:22 +01:00
void handleWELTARG ( WELTARGCMode cmode , double newValue , double SiFactorP ) ;
2019-08-29 17:05:00 +02:00
void resetDefaultBHPLimit ( ) ;
void clearControls ( ) ;
ProductionControls controls ( const SummaryState & st , double udq_default ) const ;
bool updateUDQActive ( const UDQConfig & udq_config , UDQActive & active ) const ;
2019-12-10 14:05:39 +01:00
2020-01-03 20:31:22 +01:00
void setBHPLimit ( const double limit ) ;
2020-03-12 17:40:15 +01:00
int productionControls ( ) const { return this - > m_productionControls ; }
2019-12-10 14:05:39 +01:00
2020-03-18 12:14:44 +01:00
template < class Serializer >
void serializeOp ( Serializer & serializer )
{
serializer ( name ) ;
OilRate . serializeOp ( serializer ) ;
WaterRate . serializeOp ( serializer ) ;
GasRate . serializeOp ( serializer ) ;
LiquidRate . serializeOp ( serializer ) ;
ResVRate . serializeOp ( serializer ) ;
BHPTarget . serializeOp ( serializer ) ;
THPTarget . serializeOp ( serializer ) ;
serializer ( bhp_hist_limit ) ;
serializer ( thp_hist_limit ) ;
serializer ( BHPH ) ;
serializer ( THPH ) ;
serializer ( VFPTableNumber ) ;
serializer ( ALQValue ) ;
serializer ( predictionMode ) ;
serializer ( controlMode ) ;
serializer ( whistctl_cmode ) ;
serializer ( m_productionControls ) ;
}
2019-08-29 17:05:00 +02:00
private :
int m_productionControls = 0 ;
void init_rates ( const DeckRecord & record ) ;
void init_history ( const DeckRecord & record ) ;
WellProductionProperties ( const DeckRecord & record ) ;
double getBHPLimit ( ) const ;
} ;
2019-08-23 18:29:07 +02:00
2020-04-15 10:45:32 +02:00
Well ( ) = default ;
2019-11-12 08:29:28 +01:00
Well ( const std : : string & wname ,
2020-02-14 14:18:22 +01:00
const std : : string & gname ,
std : : size_t init_step ,
std : : size_t insert_index ,
int headI ,
int headJ ,
double ref_depth ,
2020-03-03 10:52:08 +01:00
const WellType & wtype_arg ,
2020-02-14 14:18:22 +01:00
ProducerCMode whistctl_cmode ,
Connection : : Order ordering ,
const UnitSystem & unit_system ,
double udq_undefined ,
double dr ,
bool allow_xflow ,
2020-04-15 10:45:32 +02:00
bool auto_shutin ,
int pvt_table ) ;
2019-03-23 16:11:37 +01:00
2020-03-12 18:01:37 +01:00
Well ( const RestartIO : : RstWell & rst_well ,
int report_step ,
const UnitSystem & unit_system ,
double udq_undefined ) ;
2020-03-19 15:21:20 +01:00
static Well serializeObject ( ) ;
2019-12-10 14:01:46 +01:00
2019-03-23 16:11:37 +01:00
bool isMultiSegment ( ) const ;
bool isAvailableForGroupControl ( ) const ;
double getGuideRate ( ) const ;
2019-09-02 13:44:46 +02:00
GuideRateTarget getGuideRatePhase ( ) const ;
2019-03-23 16:11:37 +01:00
double getGuideRateScalingFactor ( ) const ;
2019-05-04 12:00:32 +02:00
bool hasBeenDefined ( size_t timeStep ) const ;
2019-03-23 16:11:37 +01:00
std : : size_t firstTimeStep ( ) const ;
2020-03-03 10:52:08 +01:00
const WellType & wellType ( ) const ;
2019-05-20 16:13:20 +02:00
bool predictionMode ( ) const ;
2019-03-23 16:11:37 +01:00
bool canOpen ( ) const ;
bool isProducer ( ) const ;
2019-05-04 12:00:32 +02:00
bool isInjector ( ) const ;
2019-08-23 18:29:07 +02:00
InjectorType injectorType ( ) const ;
2019-03-23 16:11:37 +01:00
size_t seqIndex ( ) const ;
bool getAutomaticShutIn ( ) const ;
bool getAllowCrossFlow ( ) const ;
const std : : string & name ( ) const ;
int getHeadI ( ) const ;
int getHeadJ ( ) const ;
double getRefDepth ( ) const ;
double getDrainageRadius ( ) const ;
double getEfficiencyFactor ( ) const ;
2020-03-12 17:34:54 +01:00
double getSolventFraction ( ) const ;
Status getStatus ( ) const ;
const std : : string & groupName ( ) const ;
Phase getPreferredPhase ( ) const ;
const WellConnections & getConnections ( ) const ;
const WellSegments & getSegments ( ) const ;
2019-03-23 16:11:37 +01:00
const WellProductionProperties & getProductionProperties ( ) const ;
const WellInjectionProperties & getInjectionProperties ( ) const ;
const WellEconProductionLimits & getEconLimits ( ) const ;
2019-07-03 10:04:20 +02:00
const WellFoamProperties & getFoamProperties ( ) const ;
2019-03-23 16:11:37 +01:00
const WellPolymerProperties & getPolymerProperties ( ) const ;
2019-11-27 13:26:28 +01:00
const WellBrineProperties & getBrineProperties ( ) const ;
2019-03-23 16:11:37 +01:00
const WellTracerProperties & getTracerProperties ( ) const ;
2019-05-04 12:00:32 +02:00
/* The rate of a given phase under the following assumptions:
* * Returns zero if production is requested for an injector ( and vice
* versa )
* * If this is an injector and something else than the
* requested phase is injected , returns 0 , i . e .
* water_injector . injection_rate ( gas ) = = 0
* * Mixed injection is not supported and always returns 0.
*/
2019-06-21 21:18:46 +02:00
double production_rate ( const SummaryState & st , Phase phase ) const ;
double injection_rate ( const SummaryState & st , Phase phase ) const ;
2019-05-04 12:00:32 +02:00
static bool wellNameInWellNamePattern ( const std : : string & wellName , const std : : string & wellNamePattern ) ;
2019-03-23 16:11:37 +01:00
/*
The getCompletions ( ) function will return a map :
{
1 : [ Connection , Connection ] ,
2 : [ Connection , Connection , Connecton ] ,
3 : [ Connection ] ,
4 : [ Connection ]
}
The integer ID ' s correspond to the COMPLETION id given by the COMPLUMP
keyword .
*/
std : : map < int , std : : vector < Connection > > getCompletions ( ) const ;
2019-05-20 16:13:20 +02:00
bool updatePrediction ( bool prediction_mode ) ;
2019-03-23 16:11:37 +01:00
bool updateAutoShutin ( bool auto_shutin ) ;
bool updateCrossFlow ( bool allow_cross_flow ) ;
2020-04-15 10:45:32 +02:00
bool updatePVTTable ( int pvt_table ) ;
2019-03-23 16:11:37 +01:00
bool updateHead ( int I , int J ) ;
bool updateRefDepth ( double ref_dpeth ) ;
bool updateDrainageRadius ( double drainage_radius ) ;
2020-03-12 17:58:24 +01:00
void updateSegments ( std : : shared_ptr < WellSegments > segments_arg ) ;
bool updateConnections ( std : : shared_ptr < WellConnections > connections ) ;
2020-04-15 10:45:32 +02:00
bool updateConnections ( std : : shared_ptr < WellConnections > connections , const EclipseGrid & grid , const std : : vector < int > & pvtnum ) ;
2020-01-08 10:18:31 +01:00
bool updateStatus ( Status status , bool update_connections ) ;
2019-03-23 16:11:37 +01:00
bool updateGroup ( const std : : string & group ) ;
2019-09-02 13:44:46 +02:00
bool updateWellGuideRate ( bool available , double guide_rate , GuideRateTarget guide_phase , double scale_factor ) ;
2019-03-23 16:11:37 +01:00
bool updateWellGuideRate ( double guide_rate ) ;
bool updateEfficiencyFactor ( double efficiency_factor ) ;
bool updateSolventFraction ( double solvent_fraction ) ;
bool updateTracer ( std : : shared_ptr < WellTracerProperties > tracer_properties ) ;
2019-07-03 10:04:20 +02:00
bool updateFoamProperties ( std : : shared_ptr < WellFoamProperties > foam_properties ) ;
2019-03-23 16:11:37 +01:00
bool updatePolymerProperties ( std : : shared_ptr < WellPolymerProperties > polymer_properties ) ;
2019-11-27 13:26:28 +01:00
bool updateBrineProperties ( std : : shared_ptr < WellBrineProperties > brine_properties ) ;
2019-03-23 16:11:37 +01:00
bool updateEconLimits ( std : : shared_ptr < WellEconProductionLimits > econ_limits ) ;
bool updateProduction ( std : : shared_ptr < WellProductionProperties > production ) ;
bool updateInjection ( std : : shared_ptr < WellInjectionProperties > injection ) ;
2019-11-22 23:23:48 +01:00
bool updateWSEGSICD ( const std : : vector < std : : pair < int , SpiralICD > > & sicd_pairs ) ;
2019-11-24 21:38:52 +01:00
bool updateWSEGVALV ( const std : : vector < std : : pair < int , Valve > > & valve_pairs ) ;
2019-03-23 16:11:37 +01:00
bool handleWELSEGS ( const DeckKeyword & keyword ) ;
2019-05-23 13:13:36 +02:00
bool handleCOMPSEGS ( const DeckKeyword & keyword , const EclipseGrid & grid , const ParseContext & parseContext , ErrorGuard & errors ) ;
2019-12-02 11:12:17 +01:00
bool handleWELOPEN ( const DeckRecord & record , Connection : : State status , bool action_mode ) ;
2019-03-23 16:11:37 +01:00
bool handleCOMPLUMP ( const DeckRecord & record ) ;
bool handleWPIMULT ( const DeckRecord & record ) ;
2019-12-10 11:46:49 +01:00
void filterConnections ( const ActiveGridCells & grid ) ;
2019-05-09 17:03:29 +02:00
ProductionControls productionControls ( const SummaryState & st ) const ;
InjectionControls injectionControls ( const SummaryState & st ) const ;
2019-06-17 07:39:23 +02:00
int vfp_table_number ( ) const ;
2020-04-15 10:45:32 +02:00
int pvt_table_number ( ) const ;
2020-04-15 11:48:12 +02:00
int fip_region_number ( ) const ;
bool segmented_density_calculation ( ) const { return true ; }
2019-06-17 07:39:23 +02:00
double alq_value ( ) const ;
double temperature ( ) const ;
2019-12-10 14:01:46 +01:00
bool operator = = ( const Well & data ) const ;
2020-02-14 14:18:22 +01:00
void setInsertIndex ( std : : size_t index ) ;
2020-03-18 12:41:22 +01:00
template < class Serializer >
void serializeOp ( Serializer & serializer )
{
serializer ( wname ) ;
serializer ( group_name ) ;
serializer ( init_step ) ;
serializer ( insert_index ) ;
serializer ( headI ) ;
serializer ( headJ ) ;
serializer ( ref_depth ) ;
unit_system . serializeOp ( serializer ) ;
serializer ( udq_undefined ) ;
serializer ( status ) ;
serializer ( drainage_radius ) ;
serializer ( allow_cross_flow ) ;
serializer ( automatic_shutin ) ;
2020-04-15 10:45:32 +02:00
serializer ( pvt_table ) ;
2020-03-18 12:41:22 +01:00
wtype . serializeOp ( serializer ) ;
guide_rate . serializeOp ( serializer ) ;
serializer ( efficiency_factor ) ;
serializer ( solvent_fraction ) ;
serializer ( prediction_mode ) ;
serializer ( econ_limits ) ;
serializer ( foam_properties ) ;
serializer ( polymer_properties ) ;
serializer ( brine_properties ) ;
serializer ( tracer_properties ) ;
serializer ( connections ) ;
serializer ( production ) ;
serializer ( injection ) ;
serializer ( segments ) ;
}
2019-03-23 16:11:37 +01:00
private :
2020-03-03 10:52:08 +01:00
void switchToInjector ( ) ;
void switchToProducer ( ) ;
2019-03-23 16:11:37 +01:00
std : : string wname ;
std : : string group_name ;
std : : size_t init_step ;
std : : size_t insert_index ;
int headI ;
int headJ ;
double ref_depth ;
double drainage_radius ;
bool allow_cross_flow ;
bool automatic_shutin ;
2020-04-15 10:45:32 +02:00
int pvt_table ;
UnitSystem unit_system ;
double udq_undefined ;
Status status ;
2020-03-03 10:52:08 +01:00
WellType wtype ;
2019-03-23 16:11:37 +01:00
WellGuideRate guide_rate ;
double efficiency_factor ;
double solvent_fraction ;
2019-05-20 16:13:20 +02:00
bool prediction_mode = true ;
2019-03-23 16:11:37 +01:00
2020-03-18 13:02:32 +01:00
std : : shared_ptr < WellEconProductionLimits > econ_limits ;
std : : shared_ptr < WellFoamProperties > foam_properties ;
std : : shared_ptr < WellPolymerProperties > polymer_properties ;
std : : shared_ptr < WellBrineProperties > brine_properties ;
std : : shared_ptr < WellTracerProperties > tracer_properties ;
2019-03-23 16:11:37 +01:00
std : : shared_ptr < WellConnections > connections ; // The WellConnections object can not be const because of the filterConnections method - would be beneficial to rewrite to enable const
2020-03-18 13:02:32 +01:00
std : : shared_ptr < WellProductionProperties > production ;
std : : shared_ptr < WellInjectionProperties > injection ;
std : : shared_ptr < WellSegments > segments ;
2019-03-23 16:11:37 +01:00
} ;
2019-11-12 08:29:28 +01:00
std : : ostream & operator < < ( std : : ostream & , const Well : : WellInjectionProperties & ) ;
2019-08-29 17:05:00 +02:00
std : : ostream & operator < < ( std : : ostream & , const WellProductionProperties & ) ;
2019-08-23 18:29:07 +02:00
2020-03-20 17:21:58 +01:00
int eclipseControlMode ( const Well : : InjectorCMode imode ,
const InjectorType itype ,
const Well : : Status wellStatus ) ;
2019-03-23 16:11:37 +01:00
2020-03-20 17:21:58 +01:00
int eclipseControlMode ( const Well : : ProducerCMode pmode ,
const Well : : Status wellStatus ) ;
int eclipseControlMode ( const Well & well ,
const SummaryState & st ) ;
2019-03-23 16:11:37 +01:00
2020-03-30 12:05:23 +02:00
std : : ostream & operator < < ( std : : ostream & os , const Well : : Status & st ) ;
2020-03-30 16:01:46 +02:00
std : : ostream & operator < < ( std : : ostream & os , const Well : : ProducerCMode & cm ) ;
std : : ostream & operator < < ( std : : ostream & os , const Well : : InjectorCMode & cm ) ;
2020-03-30 12:05:23 +02:00
}
2019-03-23 16:11:37 +01:00
# endif