My Project
Well.hpp
1 /*
2  Copyright 2019 Equinor ASA.
3 
4  This file is part of the Open Porous Media project (OPM).
5 
6  OPM is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  OPM is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with OPM. If not, see <http://www.gnu.org/licenses/>.
18 */
19 
20 
21 #ifndef WELL2_HPP
22 #define WELL2_HPP
23 
24 #include <cstddef>
25 #include <iosfwd>
26 #include <map>
27 #include <memory>
28 #include <optional>
29 #include <string>
30 #include <utility>
31 #include <vector>
32 
33 #include <stddef.h>
34 
35 #include <opm/input/eclipse/Deck/UDAValue.hpp>
36 #include <opm/input/eclipse/EclipseState/Runspec.hpp>
37 #include <opm/input/eclipse/Schedule/Well/WellConnections.hpp>
38 #include <opm/input/eclipse/Schedule/MSW/WellSegments.hpp>
39 #include <opm/input/eclipse/Schedule/ScheduleTypes.hpp>
40 #include <opm/input/eclipse/Schedule/Well/PAvg.hpp>
41 #include <opm/input/eclipse/Schedule/Well/PAvgCalculator.hpp>
42 #include <opm/input/eclipse/Schedule/Well/ProductionControls.hpp>
43 #include <opm/input/eclipse/Schedule/Well/InjectionControls.hpp>
44 #include <opm/input/eclipse/Schedule/Well/WellFoamProperties.hpp>
45 #include <opm/input/eclipse/Schedule/Well/WellBrineProperties.hpp>
46 #include <opm/input/eclipse/Schedule/Well/WellTracerProperties.hpp>
47 #include <opm/input/eclipse/Schedule/Well/WellPolymerProperties.hpp>
48 #include <opm/input/eclipse/Schedule/Well/WellMICPProperties.hpp>
49 #include <opm/input/eclipse/Schedule/Well/WellEconProductionLimits.hpp>
50 #include <opm/input/eclipse/Schedule/Well/WVFPEXP.hpp>
51 #include <opm/input/eclipse/Schedule/VFPProdTable.hpp>
52 #include <opm/input/eclipse/Units/Units.hpp>
53 #include <opm/input/eclipse/Units/UnitSystem.hpp>
54 
55 #include <opm/common/utility/ActiveGridCells.hpp>
56 
57 namespace Opm {
58 
59 class ActiveGridCells;
60 class AutoICD;
61 class DeckKeyword;
62 class DeckRecord;
63 class ErrorGuard;
64 class EclipseGrid;
65 class ParseContext;
66 class ScheduleGrid;
67 class SICD;
68 class SummaryState;
69 class UDQActive;
70 class UDQConfig;
71 class TracerConfig;
72 
73 namespace RestartIO {
74 struct RstWell;
75 }
76 
77 
78 class Well {
79 public:
80 
81  enum class Status {
82  OPEN = 1,
83  STOP = 2,
84  SHUT = 3,
85  AUTO = 4
86  };
87  static std::string Status2String(Status enumValue);
88  static Status StatusFromString(const std::string& stringValue);
89 
90 
91 
92  /*
93  The elements in this enum are used as bitmasks to keep track
94  of which controls are present, i.e. the 2^n structure must
95  be intact.
96  */
97  enum class InjectorCMode : int{
98  RATE = 1 ,
99  RESV = 2 ,
100  BHP = 4 ,
101  THP = 8 ,
102  GRUP = 16 ,
103  CMODE_UNDEFINED = 512
104  };
105  static const std::string InjectorCMode2String( InjectorCMode enumValue );
106  static InjectorCMode InjectorCModeFromString( const std::string& stringValue );
107 
108 
109  /*
110  The items BHP, THP and GRUP only apply in prediction mode:
111  WCONPROD. The elements in this enum are used as bitmasks to
112  keep track of which controls are present, i.e. the 2^n
113  structure must be intact.The NONE item is only used in WHISTCTL
114  to cancel its effect.
115 
116  The properties are initialized with the CMODE_UNDEFINED
117  value, but the undefined value is never assigned apart from
118  that; and it is not part of the string conversion routines.
119  */
120  enum class ProducerCMode : int {
121  NONE = 0,
122  ORAT = 1,
123  WRAT = 2,
124  GRAT = 4,
125  LRAT = 8,
126  CRAT = 16,
127  RESV = 32,
128  BHP = 64,
129  THP = 128,
130  GRUP = 256,
131  CMODE_UNDEFINED = 1024
132  };
133  static const std::string ProducerCMode2String( ProducerCMode enumValue );
134  static ProducerCMode ProducerCModeFromString( const std::string& stringValue );
135 
136 
137 
138  enum class WELTARGCMode {
139  ORAT = 1,
140  WRAT = 2,
141  GRAT = 3,
142  LRAT = 4,
143  CRAT = 5, // Not supported
144  RESV = 6,
145  BHP = 7,
146  THP = 8,
147  VFP = 9,
148  LIFT = 10, // Not supported
149  GUID = 11
150  };
151 
152  static WELTARGCMode WELTARGCModeFromString(const std::string& stringValue);
153 
154 
155  enum class GuideRateTarget {
156  OIL = 0,
157  WAT = 1,
158  GAS = 2,
159  LIQ = 3,
160  COMB = 4,
161  WGA = 5,
162  CVAL = 6,
163  RAT = 7,
164  RES = 8,
165  UNDEFINED = 9
166  };
167  static const std::string GuideRateTarget2String( GuideRateTarget enumValue );
168  static GuideRateTarget GuideRateTargetFromString( const std::string& stringValue );
169 
170 
171  enum class GasInflowEquation {
172  STD = 0,
173  R_G = 1,
174  P_P = 2,
175  GPP = 3
176  };
177  static const std::string GasInflowEquation2String(GasInflowEquation enumValue);
178  static GasInflowEquation GasInflowEquationFromString(const std::string& stringValue);
179 
180 
181 
182  struct WellGuideRate {
183  bool available;
184  double guide_rate;
185  GuideRateTarget guide_phase;
186  double scale_factor;
187 
188  static WellGuideRate serializeObject()
189  {
190  WellGuideRate result;
191  result.available = true;
192  result.guide_rate = 1.0;
193  result.guide_phase = GuideRateTarget::COMB;
194  result.scale_factor = 2.0;
195 
196  return result;
197  }
198 
199  bool operator==(const WellGuideRate& data) const {
200  return available == data.available &&
201  guide_rate == data.guide_rate &&
202  guide_phase == data.guide_phase &&
203  scale_factor == data.scale_factor;
204  }
205 
206  template<class Serializer>
207  void serializeOp(Serializer& serializer)
208  {
209  serializer(available);
210  serializer(guide_rate);
211  serializer(guide_phase);
212  serializer(scale_factor);
213  }
214  };
215 
216 
218  public:
219  InjectionControls(int controls_arg) :
220  controls(controls_arg)
221  {}
222 
223  double bhp_limit;
224  double thp_limit;
225 
226 
227  InjectorType injector_type;
228  InjectorCMode cmode = InjectorCMode::CMODE_UNDEFINED;
229  double surface_rate;
230  double reservoir_rate;
231  double temperature;
232  int vfp_table_number;
233  bool prediction_mode;
234 
235  bool hasControl(InjectorCMode cmode_arg) const {
236  return (this->controls & static_cast<int>(cmode_arg)) != 0;
237  }
238 
239  private:
240  int controls;
241  };
242 
243 
244 
246  std::string name;
247  UDAValue surfaceInjectionRate;
248  UDAValue reservoirInjectionRate;
249  UDAValue BHPTarget;
250  UDAValue THPTarget;
251 
252  double bhp_hist_limit = 0.0;
253  double thp_hist_limit = 0.0;
254 
255  double temperature;
256  double BHPH;
257  double THPH;
258  int VFPTableNumber;
259  bool predictionMode;
260  int injectionControls;
261  InjectorType injectorType;
262  InjectorCMode controlMode;
263 
264  bool operator==(const WellInjectionProperties& other) const;
265  bool operator!=(const WellInjectionProperties& other) const;
266 
268  WellInjectionProperties(const UnitSystem& units, const std::string& wname);
269 
270  static WellInjectionProperties serializeObject();
271 
272  void handleWELTARG(WELTARGCMode cmode, const UDAValue& new_arg, double SIFactorP);
273  void handleWCONINJE(const DeckRecord& record, bool availableForGroupControl, const std::string& well_name);
274  void handleWCONINJH(const DeckRecord& record, bool is_producer, const std::string& well_name);
275  bool hasInjectionControl(InjectorCMode controlModeArg) const {
276  if (injectionControls & static_cast<int>(controlModeArg))
277  return true;
278  else
279  return false;
280  }
281 
282  void dropInjectionControl(InjectorCMode controlModeArg) {
283  auto int_arg = static_cast<int>(controlModeArg);
284  if ((injectionControls & int_arg) != 0)
285  injectionControls -= int_arg;
286  }
287 
288  void addInjectionControl(InjectorCMode controlModeArg) {
289  auto int_arg = static_cast<int>(controlModeArg);
290  if ((injectionControls & int_arg) == 0)
291  injectionControls += int_arg;
292  }
293 
294  void clearControls();
295 
296  void resetDefaultHistoricalBHPLimit();
297  void resetBHPLimit();
298  void setBHPLimit(const double limit);
299  InjectionControls controls(const UnitSystem& unit_system, const SummaryState& st, double udq_default) const;
300  bool updateUDQActive(const UDQConfig& udq_config, UDQActive& active) const;
301  void update_uda(const UDQConfig& udq_config, UDQActive& udq_active, UDAControl control, const UDAValue& value);
302  void handleWTMULT(Well::WELTARGCMode cmode, double factor);
303 
304  template<class Serializer>
305  void serializeOp(Serializer& serializer)
306  {
307  serializer(name);
308  surfaceInjectionRate.serializeOp(serializer);
309  reservoirInjectionRate.serializeOp(serializer);
310  BHPTarget.serializeOp(serializer);
311  THPTarget.serializeOp(serializer);
312  serializer(bhp_hist_limit);
313  serializer(thp_hist_limit);
314  serializer(temperature);
315  serializer(BHPH);
316  serializer(THPH);
317  serializer(VFPTableNumber);
318  serializer(predictionMode);
319  serializer(injectionControls);
320  serializer(injectorType);
321  serializer(controlMode);
322  }
323  };
324 
326  public:
327  ProductionControls(int controls_arg) :
328  controls(controls_arg)
329  {
330  }
331 
332  ProducerCMode cmode = ProducerCMode::NONE;
333  double oil_rate{0};
334  double water_rate{0};
335  double gas_rate{0};
336  double liquid_rate{0};
337  double resv_rate{0};
338  double bhp_history{0};
339  double thp_history{0};
340  double bhp_limit{0};
341  double thp_limit{0};
342  double alq_value{0};
343  int vfp_table_number{0};
344  bool prediction_mode{0};
345 
346  bool hasControl(ProducerCMode cmode_arg) const {
347  return (this->controls & static_cast<int>(cmode_arg)) != 0;
348  }
349 
350  bool operator==(const ProductionControls& other) const {
351  return this->cmode == other.cmode &&
352  this->oil_rate == other.oil_rate &&
353  this->water_rate == other.water_rate &&
354  this->gas_rate == other.gas_rate &&
355  this->liquid_rate == other.liquid_rate &&
356  this->resv_rate == other.resv_rate &&
357  this->bhp_history == other.bhp_history &&
358  this->thp_history == other.thp_history &&
359  this->bhp_limit == other.bhp_limit &&
360  this->thp_limit == other.thp_limit &&
361  this->alq_value == other.alq_value &&
362  this->vfp_table_number == other.vfp_table_number &&
363  this->prediction_mode == other.prediction_mode;
364  }
365 
366 
367  private:
368  int controls;
369  };
370 
371 
373  public:
374  // the rates serve as limits under prediction mode
375  // while they are observed rates under historical mode
376  std::string name;
377  UDAValue OilRate;
378  UDAValue WaterRate;
379  UDAValue GasRate;
380  UDAValue LiquidRate;
381  UDAValue ResVRate;
382  UDAValue BHPTarget;
383  UDAValue THPTarget;
384  UDAValue ALQValue;
385 
386  // BHP and THP limit
387  double bhp_hist_limit = 0.0;
388  double thp_hist_limit = 0.0;
389 
390  // historical BHP and THP under historical mode
391  double BHPH = 0.0;
392  double THPH = 0.0;
393  int VFPTableNumber = 0;
394  bool predictionMode = false;
395  ProducerCMode controlMode = ProducerCMode::CMODE_UNDEFINED;
396  ProducerCMode whistctl_cmode = ProducerCMode::CMODE_UNDEFINED;
397 
398  bool operator==(const WellProductionProperties& other) const;
399  bool operator!=(const WellProductionProperties& other) const;
400 
402  WellProductionProperties(const UnitSystem& units, const std::string& name_arg);
403 
404  static WellProductionProperties serializeObject();
405 
406  bool hasProductionControl(ProducerCMode controlModeArg) const {
407  return (m_productionControls & static_cast<int>(controlModeArg)) != 0;
408  }
409 
410  void dropProductionControl(ProducerCMode controlModeArg) {
411  if (hasProductionControl(controlModeArg))
412  m_productionControls -= static_cast<int>(controlModeArg);
413  }
414 
415  void addProductionControl(ProducerCMode controlModeArg) {
416  if (! hasProductionControl(controlModeArg))
417  m_productionControls += static_cast<int>(controlModeArg);
418  }
419 
420  // this is used to check whether the specified control mode is an effective history matching production mode
421  static bool effectiveHistoryProductionControl(ProducerCMode cmode);
422  void handleWCONPROD( const std::optional<VFPProdTable::ALQ_TYPE>& alq_type, const UnitSystem& unit_system, const std::string& well, const DeckRecord& record);
423  void handleWCONHIST( const std::optional<VFPProdTable::ALQ_TYPE>& alq_type, const UnitSystem& unit_system, const DeckRecord& record);
424  void handleWELTARG( WELTARGCMode cmode, const UDAValue& new_arg, double SiFactorP);
425  void resetDefaultBHPLimit();
426  void clearControls();
427  ProductionControls controls(const SummaryState& st, double udq_default) const;
428  bool updateUDQActive(const UDQConfig& udq_config, UDQActive& active) const;
429  void update_uda(const UDQConfig& udq_config, UDQActive& udq_active, UDAControl control, const UDAValue& value);
430 
431  void setBHPLimit(const double limit);
432  int productionControls() const { return this->m_productionControls; }
433  void handleWTMULT(Well::WELTARGCMode cmode, double factor);
434 
435  template<class Serializer>
436  void serializeOp(Serializer& serializer)
437  {
438  serializer(name);
439  OilRate.serializeOp(serializer);
440  WaterRate.serializeOp(serializer);
441  GasRate.serializeOp(serializer);
442  LiquidRate.serializeOp(serializer);
443  ResVRate.serializeOp(serializer);
444  BHPTarget.serializeOp(serializer);
445  THPTarget.serializeOp(serializer);
446  ALQValue.serializeOp(serializer);
447  serializer(bhp_hist_limit);
448  serializer(thp_hist_limit);
449  serializer(BHPH);
450  serializer(THPH);
451  serializer(VFPTableNumber);
452  serializer(predictionMode);
453  serializer(controlMode);
454  serializer(whistctl_cmode);
455  serializer(m_productionControls);
456  }
457 
458  private:
459  int m_productionControls = 0;
460  void init_rates( const DeckRecord& record );
461 
462  void init_history(const DeckRecord& record);
463  void init_vfp(const std::optional<VFPProdTable::ALQ_TYPE>& alq_type, const UnitSystem& unit_system, const DeckRecord& record);
464 
465  WellProductionProperties(const DeckRecord& record);
466 
467  double getBHPLimit() const;
468  };
469 
470  static int eclipseControlMode(const Well::InjectorCMode imode,
471  const InjectorType itype);
472 
473  static int eclipseControlMode(const Well::ProducerCMode pmode);
474 
475  static int eclipseControlMode(const Well& well,
476  const SummaryState& st);
477 
478 
479  Well() = default;
480  Well(const std::string& wname,
481  const std::string& gname,
482  std::size_t init_step,
483  std::size_t insert_index,
484  int headI,
485  int headJ,
486  const std::optional<double>& ref_depth,
487  const WellType& wtype_arg,
488  ProducerCMode whistctl_cmode,
489  Connection::Order ordering,
490  const UnitSystem& unit_system,
491  double udq_undefined,
492  double dr,
493  bool allow_xflow,
494  bool auto_shutin,
495  int pvt_table,
496  GasInflowEquation inflow_eq);
497 
498  Well(const RestartIO::RstWell& rst_well,
499  int report_step,
500  const TracerConfig& tracer_config,
501  const UnitSystem& unit_system,
502  double udq_undefined);
503 
504  static Well serializeObject();
505 
506  bool isMultiSegment() const;
507  bool isAvailableForGroupControl() const;
508  double getGuideRate() const;
509  GuideRateTarget getGuideRatePhase() const;
510  double getGuideRateScalingFactor() const;
511 
512  bool hasBeenDefined(size_t timeStep) const;
513  std::size_t firstTimeStep() const;
514  const WellType& wellType() const;
515  bool predictionMode() const;
516  bool canOpen() const;
517  bool isProducer() const;
518  bool isInjector() const;
519  InjectorCMode injection_cmode() const;
520  ProducerCMode production_cmode() const;
521  InjectorType injectorType() const;
522  size_t seqIndex() const;
523  bool getAutomaticShutIn() const;
524  bool getAllowCrossFlow() const;
525  const std::string& name() const;
526  const std::vector<std::string>& wListNames() const;
527  int getHeadI() const;
528  int getHeadJ() const;
529  double getWPaveRefDepth() const;
530  bool hasRefDepth() const;
531  double getRefDepth() const;
532  double getDrainageRadius() const;
533  double getEfficiencyFactor() const;
534  double getSolventFraction() const;
535  Status getStatus() const;
536  const std::string& groupName() const;
537  Phase getPreferredPhase() const;
538 
539  const std::vector<const Connection *> getConnections(int completion) const;
540  const WellConnections& getConnections() const;
541  const WellSegments& getSegments() const;
542 
543  const WellProductionProperties& getProductionProperties() const;
544  const WellInjectionProperties& getInjectionProperties() const;
545  const WellEconProductionLimits& getEconLimits() const;
546  const WellFoamProperties& getFoamProperties() const;
547  const WellPolymerProperties& getPolymerProperties() const;
548  const WellMICPProperties& getMICPProperties() const;
549  const WellBrineProperties& getBrineProperties() const;
550  const WellTracerProperties& getTracerProperties() const;
551  const WVFPEXP& getWVFPEXP() const;
552  /* The rate of a given phase under the following assumptions:
553  * * Returns zero if production is requested for an injector (and vice
554  * versa)
555  * * If this is an injector and something else than the
556  * requested phase is injected, returns 0, i.e.
557  * water_injector.injection_rate( gas ) == 0
558  * * Mixed injection is not supported and always returns 0.
559  */
560  double production_rate( const SummaryState& st, Phase phase) const;
561  double injection_rate( const SummaryState& st, Phase phase) const;
562  static bool wellNameInWellNamePattern(const std::string& wellName, const std::string& wellNamePattern);
563 
564  /*
565  The getCompletions() function will return a map:
566 
567  {
568  1 : [Connection, Connection],
569  2 : [Connection, Connection, Connecton],
570  3 : [Connection],
571  4 : [Connection]
572  }
573 
574  The integer ID's correspond to the COMPLETION id given by the COMPLUMP
575  keyword.
576  */
577  std::map<int, std::vector<Connection>> getCompletions() const;
578  /*
579  For hasCompletion(int completion) and getConnections(int completion) the
580  completion argument is an integer ID used to denote a collection of
581  connections. The integer ID is assigned with the COMPLUMP keyword.
582  */
583  bool hasCompletion(int completion) const;
584  bool updatePrediction(bool prediction_mode);
585  bool updateAutoShutin(bool auto_shutin);
586  bool updateCrossFlow(bool allow_cross_flow);
587  bool updatePVTTable(int pvt_table);
588  bool updateHead(int I, int J);
589  void updateRefDepth();
590  bool updateRefDepth(const std::optional<double>& ref_dpeth);
591  bool updateDrainageRadius(double drainage_radius);
592  void updateSegments(std::shared_ptr<WellSegments> segments_arg);
593  bool updateConnections(std::shared_ptr<WellConnections> connections, bool force);
594  bool updateConnections(std::shared_ptr<WellConnections> connections, const ScheduleGrid& grid);
595  bool updateStatus(Status status);
596  bool updateGroup(const std::string& group);
597  bool updateWellGuideRate(bool available, double guide_rate, GuideRateTarget guide_phase, double scale_factor);
598  bool updateWellGuideRate(double guide_rate);
599  bool updateEfficiencyFactor(double efficiency_factor);
600  bool updateSolventFraction(double solvent_fraction);
601  bool updateTracer(std::shared_ptr<WellTracerProperties> tracer_properties);
602  bool updateFoamProperties(std::shared_ptr<WellFoamProperties> foam_properties);
603  bool updatePolymerProperties(std::shared_ptr<WellPolymerProperties> polymer_properties);
604  bool updateMICPProperties(std::shared_ptr<WellMICPProperties> micp_properties);
605  bool updateBrineProperties(std::shared_ptr<WellBrineProperties> brine_properties);
606  bool updateEconLimits(std::shared_ptr<WellEconProductionLimits> econ_limits);
607  bool updateProduction(std::shared_ptr<WellProductionProperties> production);
608  bool updateInjection(std::shared_ptr<WellInjectionProperties> injection);
609  bool updateWellProductivityIndex();
610  bool updateWSEGSICD(const std::vector<std::pair<int, SICD> >& sicd_pairs);
611  bool updateWSEGVALV(const std::vector<std::pair<int, Valve> >& valve_pairs);
612  bool updateWSEGAICD(const std::vector<std::pair<int, AutoICD> >& aicd_pairs, const KeywordLocation& location);
613  bool updateWPAVE(const PAvg& pavg);
614  void updateWPaveRefDepth(double ref_depth);
615  bool updateWVFPEXP(std::shared_ptr<WVFPEXP> wvfpexp);
616 
617  bool handleWELSEGS(const DeckKeyword& keyword);
618  bool handleCOMPSEGS(const DeckKeyword& keyword, const ScheduleGrid& grid, const ParseContext& parseContext, ErrorGuard& errors);
619  bool handleWELOPENConnections(const DeckRecord& record, Connection::State status);
620  bool handleCOMPLUMP(const DeckRecord& record);
621  bool handleWPIMULT(const DeckRecord& record);
622 
623  void filterConnections(const ActiveGridCells& grid);
624  ProductionControls productionControls(const SummaryState& st) const;
625  InjectionControls injectionControls(const SummaryState& st) const;
626  int vfp_table_number() const;
627  int pvt_table_number() const;
628  int fip_region_number() const;
629  GasInflowEquation gas_inflow_equation() const;
630  bool segmented_density_calculation() const { return true; }
631  double alq_value() const;
632  double temperature() const;
633  bool hasInjected( ) const;
634  bool hasProduced( ) const;
635  bool updateHasInjected( );
636  bool updateHasProduced();
637  bool cmp_structure(const Well& other) const;
638  bool operator==(const Well& data) const;
639  bool hasSameConnectionsPointers(const Well& other) const;
640  void setInsertIndex(std::size_t index);
641  double convertDeckPI(double deckPI) const;
642  void applyWellProdIndexScaling(const double scalingFactor,
643  std::vector<bool>& scalingApplicable);
644  const PAvg& pavg() const;
645  PAvgCalculator pavg_calculator(const EclipseGrid& grid, const std::vector<double>& porv) const;
646 
647  template<class Serializer>
648  void serializeOp(Serializer& serializer)
649  {
650  serializer(wname);
651  serializer(group_name);
652  serializer(init_step);
653  serializer(insert_index);
654  serializer(headI);
655  serializer(headJ);
656  serializer(ref_depth);
657  serializer(wpave_ref_depth);
658  unit_system.serializeOp(serializer);
659  serializer(udq_undefined);
660  serializer(status);
661  serializer(drainage_radius);
662  serializer(allow_cross_flow);
663  serializer(automatic_shutin);
664  serializer(pvt_table);
665  serializer(gas_inflow);
666  wtype.serializeOp(serializer);
667  guide_rate.serializeOp(serializer);
668  serializer(efficiency_factor);
669  serializer(solvent_fraction);
670  serializer(has_produced);
671  serializer(has_injected);
672  serializer(prediction_mode);
673  serializer(econ_limits);
674  serializer(foam_properties);
675  serializer(polymer_properties);
676  serializer(micp_properties);
677  serializer(brine_properties);
678  serializer(tracer_properties);
679  serializer(connections);
680  serializer(production);
681  serializer(injection);
682  serializer(segments);
683  serializer(wvfpexp);
684  m_pavg.serializeOp(serializer);
685  }
686 
687 private:
688  void switchToInjector();
689  void switchToProducer();
690 
691  std::string wname;
692  std::string group_name;
693  std::size_t init_step;
694  std::size_t insert_index;
695  int headI;
696  int headJ;
697  std::optional<double> ref_depth;
698  std::optional<double> wpave_ref_depth;
699  double drainage_radius;
700  bool allow_cross_flow;
701  bool automatic_shutin;
702  int pvt_table;
703  GasInflowEquation gas_inflow = GasInflowEquation::STD; // Will NOT be loaded/assigned from restart file
704  UnitSystem unit_system;
705  double udq_undefined;
706  WellType wtype;
707  WellGuideRate guide_rate;
708  double efficiency_factor;
709  double solvent_fraction;
710  bool has_produced = false;
711  bool has_injected = false;
712  bool prediction_mode = true;
713 
714  std::shared_ptr<WellEconProductionLimits> econ_limits;
715  std::shared_ptr<WellFoamProperties> foam_properties;
716  std::shared_ptr<WellPolymerProperties> polymer_properties;
717  std::shared_ptr<WellMICPProperties> micp_properties;
718  std::shared_ptr<WellBrineProperties> brine_properties;
719  std::shared_ptr<WellTracerProperties> tracer_properties;
720  std::shared_ptr<WellConnections> connections; // The WellConnections object cannot be const because of WELPI and the filterConnections method
721  std::shared_ptr<WellProductionProperties> production;
722  std::shared_ptr<WellInjectionProperties> injection;
723  std::shared_ptr<WellSegments> segments;
724  std::shared_ptr<WVFPEXP> wvfpexp;
725  Status status;
726  PAvg m_pavg;
727 };
728 
729 std::ostream& operator<<( std::ostream&, const Well::WellInjectionProperties& );
730 std::ostream& operator<<( std::ostream&, const Well::WellProductionProperties& );
731 
732 
733 std::ostream& operator<<(std::ostream& os, const Well::Status& st);
734 std::ostream& operator<<(std::ostream& os, const Well::ProducerCMode& cm);
735 std::ostream& operator<<(std::ostream& os, const Well::InjectorCMode& cm);
736 
737 }
738 #endif
Simple class capturing active cells of a grid.
Definition: ActiveGridCells.hpp:35
Definition: DeckKeyword.hpp:36
Definition: DeckRecord.hpp:32
About cell information and dimension: The actual grid information is held in a pointer to an ERT ecl_...
Definition: EclipseGrid.hpp:54
Definition: ErrorGuard.hpp:29
Definition: KeywordLocation.hpp:27
Definition: PAvgCalculator.hpp:37
Definition: PAvg.hpp:28
Definition: ParseContext.hpp:88
Definition: ScheduleGrid.hpp:29
Definition: Serializer.hpp:38
Definition: SummaryState.hpp:69
Definition: TracerConfig.hpp:31
Definition: UDAValue.hpp:32
Definition: UDQActive.hpp:43
Definition: UDQConfig.hpp:51
Definition: UnitSystem.hpp:34
Definition: WVFPEXP.hpp:28
Definition: WellConnections.hpp:40
Definition: WellEconProductionLimits.hpp:29
Definition: WellSegments.hpp:41
Definition: WellTracerProperties.hpp:28
Definition: ScheduleTypes.hpp:38
Definition: Well.hpp:372
Definition: Well.hpp:78
This class implements a small container which holds the transmissibility mulitpliers for all the face...
Definition: Exceptions.hpp:29
Definition: well.hpp:39
Definition: WellBrineProperties.hpp:29
Definition: WellFoamProperties.hpp:29
Definition: WellMICPProperties.hpp:29
Definition: WellPolymerProperties.hpp:28
Definition: Well.hpp:217
Definition: Well.hpp:325
Definition: Well.hpp:182
Definition: Well.hpp:245