OpenCAEPoro  0.2.0 Sep/22/2022
A simulator for multicomponent porous media flow
ParamReservoir.hpp
Go to the documentation of this file.
1 
12 #ifndef __PARAMRESERVOIR_HEADER__
13 #define __PARAMRESERVOIR_HEADER__
14 
15 // Standard header files
16 #include <fstream>
17 #include <vector>
18 
19 // OpenCAEPoro header files
20 #include "OCPConst.hpp"
21 #include "UtilInput.hpp"
22 
23 using namespace std;
24 
27 class TableSet
28 {
29 public:
30  void DisplayTable() const;
31 
32 public:
33  string name;
35  vector<vector<vector<OCP_DBL>>> data;
36 };
37 
39 class Dimens
40 {
41 public:
42  USI nx;
43  USI ny;
44  USI nz;
45 };
46 
48 class Rock
49 {
50 public:
53 };
54 
57 template <typename T> class Type_A_r
58 {
59 public:
60  bool activity{false};
61  vector<T> data;
62 };
63 
65 class EoSparam
66 {
67 public:
68  // Basic params
70  void InitEoSparam();
72  void InputCOM(ifstream& ifs); // useless now
73 
75  void InputCOMPONENTS(ifstream& ifs, const string& keyword);
78  Type_A_r<vector<OCP_DBL>>* FindPtr(const string& varName);
80  void InputCNAMES(ifstream& ifs);
82  void InputLBCCOEF(ifstream& ifs);
84  void InputBIC(ifstream& ifs);
85  // Method params
86  void InputSSMSTA(ifstream& ifs);
87  void InputNRSTA(ifstream& ifs);
88  void InputSSMSP(ifstream& ifs);
89  void InputNRSP(ifstream& ifs);
90  void InputRR(ifstream& ifs);
91 
92 public:
93  USI NTPVT{1};
94  USI numCom{0};
95  USI numPhase{2};
96  vector<vector<string>> COM;
97  vector<string> Cname;
108  // for viscosity calculation
111  vector<OCP_DBL> LBCcoef;
112  vector<vector<OCP_DBL>> BIC;
113 
114  bool miscible{false};
115 
116  vector<string> SSMparamSTA;
117  vector<string> NRparamSTA;
118  vector<string> SSMparamSP;
119  vector<string> NRparamSP;
120  vector<string> RRparam;
121 };
122 
123 class Miscstr
124 {
125 public:
126  vector<OCP_DBL> surTenRef;
127  // 0th entry: reference surface tension - flow is immiscible when the surface tension is greater than or equal to this value.
128  // 1th entry: maximum surface tension expected, it should be greater than surTenRef.
129  // 2th entry: maximum surface tension used to scale the input capillary pressure curves.
130 };
131 
137 {
138 
139 public:
140  // Grid
141  // Cartesian
144  vector<OCP_DBL> tops;
145  vector<OCP_DBL> dx;
146  vector<OCP_DBL> dy;
147  vector<OCP_DBL> dz;
148 
149  // Corner point geometry
150  vector<OCP_DBL> coord;
151  vector<OCP_DBL> zcorn;
152 
153  // Rock
154  vector<OCP_DBL> ntg;
155  vector<OCP_DBL> poro;
156  vector<OCP_DBL> permX;
157  vector<OCP_DBL> permY;
158  vector<OCP_DBL> permZ;
163 
164  // If P and Ni are given, then calculation of initial equilibration is unneeded.
165  vector<OCP_DBL> P;
166  vector<OCP_DBL> Ni;
167  vector<OCP_DBL> Swat;
168  bool ScalePcow{false};
169 
170  // phase property
173 
174  // Model and Phase
175  bool blackOil{false};
176  bool comps{false};
177  bool oil{false};
178  bool gas{false};
179  bool water{false};
180  bool disGas{false};
181 
182 
183  // Compositional Model
185 
186  // SAT Region & PVT Region
187  USI NTSFUN{1};
188  USI NTPVT{1};
192 
193  // Saturation tables & bubble point pressure
200  // initial zi vs depth
202  vector<OCP_DBL> EQUIL;
203 
204  // PVT properties
211 
214  vector<OCP_DBL>* FindPtr(const string& varName);
215 
218  TableSet* FindPtr_T(const string& varName);
219 
221  void Init();
222 
224  void InitTable();
225 
227  template <typename T>
228  void setVal(vector<T>& obj, const T& val, const vector<USI>& index);
229 
231  template <typename T>
232  void CopyVal(vector<T>& obj, const vector<T>& src, const vector<USI>& index);
233 
236  void MultiplyVal(vector<OCP_DBL>& obj, const OCP_DBL& val,
237  const vector<USI>& index);
238 
241  void InputCOMPS(ifstream& ifs);
242 
245  void InputDIMENS(ifstream& ifs);
246 
248  void DisplayDIMENS();
249 
251  void InputRTEMP(ifstream& ifs);
252 
256  void InputEQUALS(ifstream& ifs);
257 
260  void InputGRID(ifstream& ifs, string& keyword);
261 
263  void InputCOPY(ifstream& ifs);
264 
267  void InputMULTIPLY(ifstream& ifs);
268 
270  void InputTABLE(ifstream& ifs, const string& tabName);
271 
274  void InputROCK(ifstream& ifs);
275 
277  void InputMISCSTR(ifstream& ifs);
278 
280  void InputGRAVITY(ifstream& ifs);
281 
283  void InputDENSITY(ifstream& ifs);
284 
286  void InputEQUIL(ifstream& ifs);
287 
288  // SATNUM & PVTNUM -- Region
290  void InputTABDIMS(ifstream& ifs);
291 
293  void InputRegion(ifstream& ifs, const string& keyword);
294 
295  // Input EoSparam
296  // Basic params
297  void InputCNAMES(ifstream& ifs) { EoSp.InputCNAMES(ifs); };
298  void InputCOM(ifstream& ifs) { EoSp.InputCOM(ifs); };
299  void InputCOMPONENTS(ifstream& ifs, const string& keyword) { EoSp.InputCOMPONENTS(ifs, keyword); }
300  void InputLBCCOEF(ifstream& ifs) { EoSp.InputLBCCOEF(ifs); }
301  void InputBIC(ifstream& ifs) { EoSp.InputBIC(ifs); };
302 
303 
304  // Method params
305  void InputSSMSTA(ifstream& ifs) { EoSp.InputSSMSTA(ifs); };
306  void InputNRSTA(ifstream& ifs) { EoSp.InputNRSTA(ifs); };
307  void InputSSMSP(ifstream& ifs) { EoSp.InputSSMSP(ifs); };
308  void InputNRSP(ifstream& ifs) { EoSp.InputNRSP(ifs); };
309  void InputRR(ifstream& ifs) { EoSp.InputRR(ifs); };
310 
311  // check
313  void CheckParam();
314 
316  void CheckGrid();
317 
319  void CheckEQUIL() const;
320 
322  void CheckDenGra() const;
323 
325  void CheckPhase() const;
326 
328  void CheckPhaseTab() const;
329 
331  void CheckRegion() const;
332 
334  void CheckEqlRegion() const;
335 };
336 
337 #endif /* end if __PARAMRESERVOIR_HEADER__ */
338 
339 /*----------------------------------------------------------------------------*/
340 /* Brief Change History of This File */
341 /*----------------------------------------------------------------------------*/
342 /* Author Date Actions */
343 /*----------------------------------------------------------------------------*/
344 /* Shizhe Li Oct/01/2021 Create file */
345 /* Chensong Zhang Oct/15/2021 Format file */
346 /* Chensong Zhang Jan/09/2022 Update Doxygen */
347 /*----------------------------------------------------------------------------*/
Definition of build-in datatypes and consts.
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:22
double OCP_DBL
Double precision.
Definition: OCPConst.hpp:26
unsigned int OCP_USI
Long unsigned integer.
Definition: OCPConst.hpp:24
Supply basic tools used to input files.
Dimens contains the dimensions of grids.
USI nx
Num of bulks along x-direction.
USI ny
Num of bulks along y-direction.
USI nz
Num of bulks along z-direction.
EoSParam contains the params for Compositional Model and functions to read them.
Type_A_r< vector< OCP_DBL > > Zcvis
Critical Z-factor used for viscosity calculations only.
void InputBIC(ifstream &ifs)
Input the Binary interaction of components.
void InputCNAMES(ifstream &ifs)
Input the names of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > Vcvis
Critical volume used for viscosity calculations only.
vector< string > RRparam
Params for Solving Rachford-Rice equations.
Type_A_r< vector< OCP_DBL > > Vshift
Volume shift of hydrocarbon components.
vector< string > SSMparamSP
Params for Solving Phase Spliting with SSM.
void InputSSMSTA(ifstream &ifs)
TODO: Add Doxygen.
vector< OCP_DBL > LBCcoef
LBC coefficients for viscosity calculation.
Type_A_r< vector< OCP_DBL > > MW
Molecular Weight of hydrocarbon components.
void InputCOM(ifstream &ifs)
Input the information of components.
vector< string > NRparamSTA
Params for Solving Phase Spliting with NR.
Type_A_r< vector< OCP_DBL > > Acf
Acentric factor of hydrocarbon components.
void InputCOMPONENTS(ifstream &ifs, const string &keyword)
Input the information of hydrocarbon components.
void InputNRSTA(ifstream &ifs)
TODO: Add Doxygen.
void InputNRSP(ifstream &ifs)
TODO: Add Doxygen.
vector< string > SSMparamSTA
Params for Solving Phase Spliting with SSM.
vector< string > NRparamSP
Params for Solving Phase Spliting with NR.
void InputRR(ifstream &ifs)
TODO: Add Doxygen.
vector< string > Cname
Name of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > OmegaB
OMEGA_B of hydrocarbon components.
vector< vector< string > > COM
Components information.
void InputSSMSP(ifstream &ifs)
TODO: Add Doxygen.
void InputLBCCOEF(ifstream &ifs)
Input LBC coefficients for viscosity calculation.
Type_A_r< vector< OCP_DBL > > Pc
Critical pressure of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > Vc
Critical volume of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > OmegaA
OMEGA_A of hydrocarbon components.
vector< vector< OCP_DBL > > BIC
Binary interaction.
Type_A_r< vector< OCP_DBL > > Tc
Critical temperature of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > Parachor
PARACHOR of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > Zc
Critical Z-factor of hydrocarbon components.
vector< OCP_DBL > permY
Permeability along the y-direction for each grid.
vector< OCP_DBL > Ni
Initial moles of components in each grid.
vector< OCP_DBL > zcorn
TODO: Add Doxygen.
Type_A_r< OCP_DBL > SATNUM
Records the index of SAT region for each grid.
TableSet ZMFVD_T
Table set of ZMFVD.
vector< OCP_DBL > EQUIL
See ParamEQUIL.
Type_A_r< OCP_DBL > ACTNUM
Records the index of Active region for each grid.
vector< OCP_DBL > poro
Porosity for each grid.
USI numPhase
Number of phases.
vector< OCP_DBL > dy
Size along the y - direction for each grid.
vector< OCP_DBL > permX
Permeability along the x - direction for each grid.
TableSet PVDG_T
Table set of PVDG.
vector< OCP_DBL > permZ
Permeability along the z-direction for each grid.
TableSet SOF3_T
Table set of SOF3.
vector< OCP_DBL > dx
Size along the x - direction for each grid.
TableSet PBVD_T
Table set of PBVD.
Type_A_r< OCP_DBL > density
Density of oil, water, gas in standard conditions.
TableSet PVDO_T
Table set of PVDO.
vector< OCP_DBL > tops
Depth of the top surface of the uppermost grids.
TableSet SGOF_T
Table set of SGOF.
Type_A_r< OCP_DBL > PVTNUM
Records the index of PVT region for each grid.
USI numCom
Number of components(hydrocarbon components), used in Compositional Model when input.
vector< OCP_DBL > ntg
Net to gross for each grid.
TableSet SGFN_T
Table set of SGFN.
vector< OCP_DBL > coord
TODO: Add Doxygen.
Type_A_r< OCP_DBL > gravity
Gravity of oil, water, gas in standard conditions.
TableSet PVTW_T
Table set of PVTW.
Dimens dimens
Dimension of grid: the number of grids along x,y,z direction.
vector< OCP_DBL > dz
Size along the z - direction for each grid.
TableSet SWOF_T
Table set of SWOF.
vector< OCP_DBL > Swat
Initial water saturation in each grid.
Miscstr miscstr
reference Miscibility surface tension
vector< OCP_DBL > P
Initial pressure of components in each grid.
TableSet PVCO_T
Table set of PVCO.
TableSet SWFN_T
Table set of SWFN.
OCP_DBL rsTemp
Temperature for reservoir.
OCP_USI numGrid
Num of grids.
EoSparam EoSp
Initial component composition, used in compositional models.
Rock class contains information about the keyword ROCK.
OCP_DBL Cr
Compressibility factor of rock in reservoir.
OCP_DBL Pref
Reference pressure at initial porosity.
vector< vector< vector< OCP_DBL > > > data
All table with the same name.
USI colNum
Number of columns of table.
string name
Name of table.
vector< T > data
Data of param.