OpenCAEPoro  v0.5.0
A simulator for multicomponent porous media flow
ParamWell.hpp
Go to the documentation of this file.
1 
12 #ifndef __PARAMWELL_HEADER__
13 #define __PARAMWELL_HEADER__
14 
15 // Standard header files
16 #include <cassert>
17 #include <fstream>
18 #include <vector>
19 
20 // OpenCAEPoro header files
21 #include "OCPConst.hpp"
22 #include "UtilInput.hpp"
23 
24 using namespace std;
25 
29 {
30 public:
31  WellOptParam(string intype, vector<string>& vbuf);
32  // WCONINJE & WCONPROD
33  string type;
34  string fluidType;
35  string state;
36  string optMode;
37 
42 };
43 
48 {
49 public:
50  WellOptPair(USI i, string type, vector<string>& vbuf)
51  : d(i)
52  , opt(type, vbuf){};
53  USI d;
54  WellOptParam opt;
55 };
56 
58 class WellParam
59 {
60 public:
61  WellParam(vector<string>& info);
62  // static infomation
63  // WELSPECS
64  string name;
65  string group{"FEILD"};
66  USI I;
67  USI J;
68  OCP_DBL depth{-1.0};
69 
70  // COMPDAT ---- for all perforation.
71  vector<USI> I_perf;
72  vector<USI> J_perf;
73  vector<USI> K_perf;
74  vector<OCP_DBL> WI;
75  vector<OCP_DBL> diameter;
76  vector<OCP_DBL> kh;
77  vector<OCP_DBL> skinFactor;
78  vector<string> direction;
79  OCP_BOOL ifUseUnweight{OCP_FALSE};
80 
81  // dynamic infomation
82  vector<WellOptPair> optParam;
83 };
84 
86 class Solvent
87 {
88 public:
89  Solvent() = default;
90  Solvent(const vector<string>& vbuf);
91  string name;
92  vector<OCP_DBL> comRatio;
93 };
94 
99 class ParamWell
100 {
101 public:
102  vector<WellParam> well;
103  vector<OCP_DBL> criticalTime;
104  vector<Solvent> solSet;
107 
109  void Init() { InitTime(); };
111  void InitTime() { criticalTime.push_back(0); };
114  void InputWELSPECS(ifstream& ifs);
117  void InputCOMPDAT(ifstream& ifs);
120  void InputWCONINJE(ifstream& ifs);
123  void InputWCONPROD(ifstream& ifs);
128  void InputTSTEP(ifstream& ifs);
132  void InputWELTARG(ifstream& ifs);
134  void InputWTEMP(ifstream& ifs);
136  void InputUNWEIGHT(ifstream& ifs);
139  void InputWELLSTRE(ifstream& ifs);
141  void InputPSURF(ifstream& ifs);
143  void InputTSURF(ifstream& ifs);
144 
145  // check
147  void CheckParam(const OCP_BOOL& boModel) const;
149  void CheckPerf() const;
150  void CheckINJFluid() const;
151 };
152 
153 #endif /* end if __PARAMWELL_HEADER__ */
154 
155 /*----------------------------------------------------------------------------*/
156 /* Brief Change History of This File */
157 /*----------------------------------------------------------------------------*/
158 /* Author Date Actions */
159 /*----------------------------------------------------------------------------*/
160 /* Shizhe Li Oct/01/2021 Create file */
161 /* Chensong Zhang Oct/15/2021 Format file */
162 /*----------------------------------------------------------------------------*/
Definition of build-in datatypes and consts.
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:23
double OCP_DBL
Double precision.
Definition: OCPConst.hpp:27
const OCP_DBL TEMPERATURE_STD
Standard temperature: F.
Definition: OCPConst.hpp:60
unsigned int OCP_BOOL
OCP_BOOL in OCP.
Definition: OCPConst.hpp:29
const OCP_DBL PRESSURE_STD
14.6959 psia = 1 atm
Definition: OCPConst.hpp:59
Supply basic tools used to input files.
vector< Solvent > solSet
Sets of Solvent.
Definition: ParamWell.hpp:104
void Init()
Initialize the inputting the params of wells.
Definition: ParamWell.hpp:109
vector< OCP_DBL > criticalTime
Records the critical time given by users.
Definition: ParamWell.hpp:103
void InitTime()
Initialize the critical time.
Definition: ParamWell.hpp:111
vector< WellParam > well
Contains all the information of wells.
Definition: ParamWell.hpp:102
Describe the molar fraction of components of fluid injected to reservoir from INJ.
Definition: ParamWell.hpp:87
OCP_DBL maxBHP
Maximum allowable pressure in the injection well.
Definition: ParamWell.hpp:39
string type
Type of well, injection or production?
Definition: ParamWell.hpp:33
string fluidType
Type of fluid into the injection well. (injection well only)
Definition: ParamWell.hpp:34
OCP_DBL injTemp
Temperature of injected fluid.
Definition: ParamWell.hpp:41
OCP_DBL maxRate
Maximum allowable flow rate into/out the well.
Definition: ParamWell.hpp:38
string optMode
Mode of well, Rate or BHP?
Definition: ParamWell.hpp:36
OCP_DBL minBHP
Minimum allowable pressure in the production well.
Definition: ParamWell.hpp:40
string state
State of well, open or close?
Definition: ParamWell.hpp:35
TODO: Add Doxygen.
Definition: ParamWell.hpp:59
vector< string > direction
Direction of perforations.
Definition: ParamWell.hpp:78
vector< OCP_DBL > diameter
Diameter of perforations.
Definition: ParamWell.hpp:75
vector< OCP_DBL > skinFactor
Skin factor.
Definition: ParamWell.hpp:77
USI I
I index of well.
Definition: ParamWell.hpp:66
vector< USI > I_perf
I-index of perforation in grid.
Definition: ParamWell.hpp:71
string name
Name of Well.
Definition: ParamWell.hpp:64
vector< OCP_DBL > WI
Transmissibility connection factor.
Definition: ParamWell.hpp:74
vector< USI > J_perf
J-index of perforation in grid.
Definition: ParamWell.hpp:72
vector< USI > K_perf
K-index of perforation in grid.
Definition: ParamWell.hpp:73
USI J
J index of well.
Definition: ParamWell.hpp:67