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