OpenCAEPoro  v0.5.0
A simulator for multicomponent porous media flow
WellOpt.hpp
Go to the documentation of this file.
1 
12 #ifndef __WELLOPT_HEADER__
13 #define __WELLOPT_HEADER__
14 
15 // Standard header files
16 #include <cmath>
17 
18 // OpenCAEPoro header files
19 #include "ParamWell.hpp"
20 
21 using namespace std;
22 
26 class WellOpt
27 {
28  friend class Well;
29  friend class AllWells;
30  friend class Out4RPT;
31 
32 public:
34  WellOpt() = default;
35 
37  WellOpt(const WellOptParam& Optparam);
38 
40  OCP_BOOL operator!=(const WellOpt& Opt) const;
41 
42  USI WellType() const { return type; }
43  USI OptMode() const { return optMode; }
44  string InjFluidType() const
45  {
46  if (type == INJ)
47  return fluidType;
48  else
49  OCP_ABORT("WRONG well type!");
50  }
51  void SetInjProdPhase(const USI& inPhase) { injProdPhase = inPhase; }
52  void SetInjZi(const vector<OCP_DBL>& inZi)
53  {
54  if (type == INJ)
55  injZi = inZi;
56  else
57  OCP_ABORT("WRONG well type!");
58  }
59  void SetInjFactor(const OCP_DBL& inFactor)
60  {
61  if (type == INJ)
62  factorINJ = inFactor;
63  else
64  OCP_ABORT("WRONG well type!");
65  maxRate *= factorINJ;
66  }
67  void SetProdPhaseWeight(const vector<OCP_DBL>& inPj)
68  {
69  if (type == PROD)
70  prodPhaseWeight = inPj;
71  else
72  OCP_ABORT("WRONG well type!");
73  }
74 
75 private:
76  USI type{0};
79  string fluidType;
80  OCP_BOOL state{OCP_FALSE};
81  USI optMode;
83  USI initOptMode;
87  OCP_DBL maxRate;
92  OCP_DBL maxBHP;
97  OCP_DBL minBHP;
102  vector<OCP_DBL> injZi;
103  USI injProdPhase;
104  vector<OCP_DBL> prodPhaseWeight;
105  OCP_DBL
106  factorINJ;
107  OCP_DBL injTemp;
108  // for Reinjection
109  OCP_BOOL reInj{OCP_FALSE};
110  USI reInjPhase;
111  OCP_DBL reInjFactor;
113  vector<USI> connWell;
114 };
115 
118 {
119 public:
120  SolventINJ() = default;
121  SolventINJ(const Solvent& other)
122  {
123  name = other.name;
124  data = other.comRatio;
125  };
126  string name;
127  vector<OCP_DBL> data;
128 };
129 
130 #endif
131 
132 /*----------------------------------------------------------------------------*/
133 /* Brief Change History of This File */
134 /*----------------------------------------------------------------------------*/
135 /* Author Date Actions */
136 /*----------------------------------------------------------------------------*/
137 /* Shizhe Li NOV/22/2022 Create file */
138 /*----------------------------------------------------------------------------*/
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:23
double OCP_DBL
Double precision.
Definition: OCPConst.hpp:27
const USI PROD
Well type = producer.
Definition: OCPConst.hpp:123
const USI INJ
Well type = injector.
Definition: OCPConst.hpp:122
unsigned int OCP_BOOL
OCP_BOOL in OCP.
Definition: OCPConst.hpp:29
ParamWell class declaration.
#define OCP_ABORT(msg)
Abort if critical error happens.
Definition: UtilError.hpp:47
Collect more detailed information of each time step.
Definition: OCPOutput.hpp:211
Describe the molar fraction of components of fluid injected to reservoir from INJ.
Definition: WellOpt.hpp:118
string name
name of solvent
Definition: WellOpt.hpp:125
vector< OCP_DBL > data
molar fraction of components
Definition: WellOpt.hpp:127
Describe the molar fraction of components of fluid injected to reservoir from INJ.
Definition: ParamWell.hpp:87
WellOpt()=default
Default constructor.
Definition: Well.hpp:45