OpenCAEPoro  v0.5.0
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<string> refName;
36  vector<OCP_DBL> refData;
37  vector<vector<vector<OCP_DBL>>> data;
38 };
39 
41 class Dimens
42 {
43 public:
44  USI nx;
45  USI ny;
46  USI nz;
47 };
48 
49 class HLoss
50 {
51 public:
52  OCP_BOOL ifHLoss{OCP_FALSE};
57 };
58 
60 class RockParam
61 {
62 public:
63  string type{"LINEAR"};
64  OCP_DBL Pref{14.7};
65  OCP_DBL Tref{60};
66  OCP_DBL cp1{3.406E-6};
67  OCP_DBL cp2{0};
68  OCP_DBL ct{0};
69  OCP_DBL cpt{0};
70  OCP_BOOL ConstRock{OCP_TRUE};
72  OCP_DBL HCP1{35};
73  OCP_DBL HCP2{0};
74 };
75 
78 template <typename T>
79 class Type_A_r
80 {
81 public:
82  OCP_BOOL activity{OCP_FALSE};
83  vector<T> data;
84 };
85 
88 {
89 public:
90  // Basic params
92  void Init();
94  void InputCOMPONENTS(ifstream& ifs, const string& keyword);
97  Type_A_r<vector<OCP_DBL>>* FindPtr01(const string& varName);
99  void InputRefPR(ifstream& ifs, const string& keyword);
101  vector<OCP_DBL>* FindPtr02(const string& varName);
103  void InputCNAMES(ifstream& ifs);
105  void InputLBCCOEF(ifstream& ifs);
107  void InputBIC(ifstream& ifs);
109  void InputVISCTAB(ifstream& ifs);
110  // Method params
111  void InputSSMSTA(ifstream& ifs);
112  void InputNRSTA(ifstream& ifs);
113  void InputSSMSP(ifstream& ifs);
114  void InputNRSP(ifstream& ifs);
115  void InputRR(ifstream& ifs);
116 
117 public:
118  USI NTPVT{1};
119  USI numCom{0};
120  USI numPhase{2};
121  vector<string> Cname;
132  // for viscosity calculation
137  vector<OCP_DBL> LBCcoef;
138  vector<vector<OCP_DBL>> BIC;
139  // ifThermal only
166  hvr;
168  ev;
174  avg;
176  bvg;
180 
181  vector<OCP_DBL> Pref;
182  vector<OCP_DBL> Tref;
183 
184  // Miscibility
185  OCP_BOOL miscible{OCP_FALSE};
187 
188  vector<string> SSMparamSTA;
189  vector<string> NRparamSTA;
190  vector<string> SSMparamSP;
191  vector<string> NRparamSP;
192  vector<string> RRparam;
193 };
194 
195 class Miscstr
196 {
197 public:
198  vector<OCP_DBL> surTenRef;
199  // 0th entry: reference surface tension - flow is immiscible when the surface
200  // tension is greater than or equal to this value. 1th entry: maximum surface
201  // tension expected, it should be greater than surTenRef. 2th entry: maximum surface
202  // tension used to scale the input capillary pressure curves.
203 };
204 
210 {
211 
212 public:
213  // Grid
214  // Cartesian
217  vector<OCP_DBL> tops;
218  vector<OCP_DBL> dx;
219  vector<OCP_DBL> dy;
220  vector<OCP_DBL> dz;
221 
222  // Corner point geometry
223  vector<OCP_DBL> coord;
224  vector<OCP_DBL> zcorn;
225 
226  // RockParam
227  vector<OCP_DBL> ntg;
228  vector<OCP_DBL> poro;
229  vector<OCP_DBL> permX;
230  vector<OCP_DBL> permY;
231  vector<OCP_DBL> permZ;
232  vector<OCP_DBL> thconr;
234  vector<RockParam> rockSet;
237 
238  // If P and Ni are given, then calculation of initial equilibration is unneeded.
239  vector<OCP_DBL> P;
240  vector<OCP_DBL> Ni;
241  vector<OCP_DBL> Swat;
242  OCP_BOOL ScalePcow{OCP_FALSE};
243 
244  // phase property
247  OCP_DBL thcono{24};
248  OCP_DBL thcong{24};
249  OCP_DBL thconw{24};
250 
251  // Models
252  OCP_BOOL blackOil{OCP_FALSE};
253  OCP_BOOL comps{OCP_FALSE};
254  OCP_BOOL thermal{OCP_FALSE};
255  OCP_BOOL oil{OCP_FALSE};
256  OCP_BOOL gas{OCP_FALSE};
257  OCP_BOOL water{OCP_FALSE};
258  OCP_BOOL disGas{OCP_FALSE};
259 
261 
262  // SAT Region & PVT Region
263  USI NTSFUN{1};
264  USI NTPVT{1};
265  USI NTROOC{1};
270 
271  // Saturation tables & bubble point pressure
278  // initial zi vs depth
281  vector<OCP_DBL> EQUIL;
282 
283  // PVT properties
291 
294  vector<OCP_DBL>* FindPtr(const string& varName);
295 
298  TableSet* FindPtr_T(const string& varName);
299 
301  void Init();
302 
304  void InitTable();
305 
307  template <typename T>
308  void setVal(vector<T>& obj, const T& val, const vector<USI>& index);
309 
311  template <typename T>
312  void CopyVal(vector<T>& obj, const vector<T>& src, const vector<USI>& index);
313 
316  void
317  MultiplyVal(vector<OCP_DBL>& obj, const OCP_DBL& val, const vector<USI>& index);
318 
321  void InputCOMPS(ifstream& ifs);
322 
325  void InputDIMENS(ifstream& ifs);
326 
328  void DisplayDIMENS();
329 
331  void InputRTEMP(ifstream& ifs);
332 
336  void InputEQUALS(ifstream& ifs);
337 
340  void InputGRID(ifstream& ifs, string& keyword);
341 
343  void InputCOPY(ifstream& ifs);
344 
347  void InputMULTIPLY(ifstream& ifs);
348 
350  void InputTABLE(ifstream& ifs, const string& tabName);
351 
354  void InputROCK(ifstream& ifs);
356  void InputROCKT(ifstream& ifs);
358  void InputHLOSS(ifstream& ifs);
359 
361  void InputMISCSTR(ifstream& ifs);
362 
364  void InputGRAVITY(ifstream& ifs);
365 
367  void InputDENSITY(ifstream& ifs);
368 
370  void InputTHCON(ifstream& ifs, const string& keyword);
371 
373  void InputEQUIL(ifstream& ifs);
374 
375  // SATNUM & PVTNUM -- Region
377  void InputTABDIMS(ifstream& ifs);
378 
380  void InputRegion(ifstream& ifs, const string& keyword);
381 
382  // Input ComponentParam
383  // Basic params
384  void InputCNAMES(ifstream& ifs) { comsParam.InputCNAMES(ifs); };
385  void InputCOMPONENTS(ifstream& ifs, const string& keyword)
386  {
387  comsParam.InputCOMPONENTS(ifs, keyword);
388  }
389  void InputLBCCOEF(ifstream& ifs) { comsParam.InputLBCCOEF(ifs); }
390  void InputBIC(ifstream& ifs) { comsParam.InputBIC(ifs); };
391  void InputVISCTAB(ifstream& ifs) { comsParam.InputVISCTAB(ifs); }
392  void InputRefPR(ifstream& ifs, const string& keyword)
393  {
394  comsParam.InputRefPR(ifs, keyword);
395  };
396 
397  // Method params
398  void InputSSMSTA(ifstream& ifs) { comsParam.InputSSMSTA(ifs); };
399  void InputNRSTA(ifstream& ifs) { comsParam.InputNRSTA(ifs); };
400  void InputSSMSP(ifstream& ifs) { comsParam.InputSSMSP(ifs); };
401  void InputNRSP(ifstream& ifs) { comsParam.InputNRSP(ifs); };
402  void InputRR(ifstream& ifs) { comsParam.InputRR(ifs); };
403 
404  // check
406  void CheckParam();
407 
409  void CheckGrid();
410 
412  void CheckRock();
413 
415  void CheckEQUIL() const;
416 
418  void CheckDenGra() const;
419 
421  void CheckPhase() const;
422 
424  void CheckPhaseTab() const;
425 
427  void CheckRegion() const;
428 
430  void CheckEqlRegion() const;
431 };
432 
433 #endif /* end if __PARAMRESERVOIR_HEADER__ */
434 
435 /*----------------------------------------------------------------------------*/
436 /* Brief Change History of This File */
437 /*----------------------------------------------------------------------------*/
438 /* Author Date Actions */
439 /*----------------------------------------------------------------------------*/
440 /* Shizhe Li Oct/01/2021 Create file */
441 /* Chensong Zhang Oct/15/2021 Format file */
442 /* Chensong Zhang Jan/09/2022 Update Doxygen */
443 /*----------------------------------------------------------------------------*/
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
unsigned int OCP_USI
Long unsigned integer.
Definition: OCPConst.hpp:25
unsigned int OCP_BOOL
OCP_BOOL in OCP.
Definition: OCPConst.hpp:29
Supply basic tools used to input files.
ComponentParam contains information of components.
Type_A_r< vector< OCP_DBL > > cpg4
Type_A_r< vector< OCP_DBL > > cpl1
void InputLBCCOEF(ifstream &ifs)
Input LBC coefficients for viscosity calculation.
void InputSSMSP(ifstream &ifs)
TODO: Add Doxygen.
Type_A_r< vector< OCP_DBL > > Tc
Critical temperature of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > Vcvis
Critical volume used for viscosity calculations only.
Type_A_r< vector< OCP_DBL > > ev
coefficients in the vaporization enthalpy calculations
Type_A_r< vector< OCP_DBL > > Zc
Critical Z-factor of hydrocarbon components.
vector< string > SSMparamSP
Params for Solving Phase Spliting with SSM.
Type_A_r< vector< OCP_DBL > > MW
Molecular Weight of hydrocarbon components.
vector< string > SSMparamSTA
Params for Solving Phase Spliting with SSM.
Type_A_r< vector< OCP_DBL > > cpg2
Type_A_r< vector< OCP_DBL > > avisc
coefficients in water and oil viscosity correlation formulae
Type_A_r< vector< OCP_DBL > > bvisc
coefficients in water and oil viscosity correlation formulae
vector< OCP_DBL > Pref
reference pressure
Type_A_r< vector< OCP_DBL > > bvg
void InputRR(ifstream &ifs)
TODO: Add Doxygen.
Type_A_r< vector< OCP_DBL > > cpl3
void InputVISCTAB(ifstream &ifs)
Input VISCTAB.
void InputBIC(ifstream &ifs)
Input the Binary interaction of components.
Type_A_r< vector< OCP_DBL > > cpl4
Type_A_r< vector< OCP_DBL > > hvapr
coefficients in the component gas enthalpy calculations, Btu/lbmol
vector< string > Cname
Name of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > ct1
the first ifThermal expansion coefficient, 1/F
Type_A_r< vector< OCP_DBL > > avg
coefficients Ak in gas viscosity correlation formulae
void InputCOMPONENTS(ifstream &ifs, const string &keyword)
Input the information of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > cpt
Type_A_r< vector< OCP_DBL > > Acf
Acentric factor of hydrocarbon components.
void InputNRSTA(ifstream &ifs)
TODO: Add Doxygen.
Type_A_r< vector< OCP_DBL > > Vshift
Volume shift of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > hvr
coefficients in the vaporization enthalpy calculations
vector< string > NRparamSP
Params for Solving Phase Spliting with NR.
void InputCNAMES(ifstream &ifs)
Input the names of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > Zcvis
Critical Z-factor used for viscosity calculations only.
Type_A_r< vector< OCP_DBL > > OmegaB
OMEGA_B of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > cpg1
vector< string > NRparamSTA
Params for Solving Phase Spliting with NR.
vector< string > RRparam
Params for Solving Rachford-Rice equations.
Type_A_r< vector< OCP_DBL > > ct2
the second ifThermal expansion coefficient, 1/F
Type_A_r< vector< OCP_DBL > > Vc
Critical volume of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > cpg3
Type_A_r< vector< OCP_DBL > > Pc
Critical pressure of hydrocarbon components.
void InputSSMSTA(ifstream &ifs)
TODO: Add Doxygen.
Type_A_r< vector< OCP_DBL > > cpl2
Type_A_r< vector< OCP_DBL > > OmegaA
OMEGA_A of hydrocarbon components.
Type_A_r< vector< OCP_DBL > > cp
component compressibility, 1/psi
vector< vector< OCP_DBL > > BIC
Binary interaction.
void InputNRSP(ifstream &ifs)
TODO: Add Doxygen.
Type_A_r< vector< OCP_DBL > > molden
vector< OCP_DBL > LBCcoef
LBC coefficients for viscosity calculation.
vector< OCP_DBL > Tref
reference temperature
void InputRefPR(ifstream &ifs, const string &keyword)
input reference pressure, temperature
Type_A_r< vector< OCP_DBL > > Parachor
PARACHOR of hydrocarbon components.
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.
OCP_DBL obC
Volumetric heat capacity of overburden rock.
OCP_DBL obK
Thermal conductivity of overburden rock.
OCP_DBL ubK
Thermal conductivity of underburden rock.
OCP_DBL ubC
Volumetric heat capacity of underburden rock.
vector< RockParam > rockSet
a set of rock
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.
ComponentParam comsParam
information for components
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.
TableSet TEMPVD_T
Table set of TEMPVD.
vector< OCP_DBL > ntg
Net to gross for each grid.
vector< OCP_DBL > thconr
Rock ifThermal conductivity.
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.
Type_A_r< OCP_DBL > ROCKNUM
Records the index of ROCK region for each grid.
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.
HLoss hLoss
Heat loss property.
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.
RockParam class contains information about the keyword ROCK.
vector< string > refName
name of refData
vector< vector< vector< OCP_DBL > > > data
All table with the same name.
vector< OCP_DBL > refData
refData for each sub data.
USI colNum
Number of columns of table.
string name
Name of table.
vector< T > data
Data of param.