OpenCAEPoro  v0.5.0
A simulator for multicomponent porous media flow
Public Member Functions | Public Attributes | List of all members
ParamReservoir Class Reference

#include <ParamReservoir.hpp>

Public Member Functions

vector< OCP_DBL > * FindPtr (const string &varName)
 Find pointer to the specified variable. More...
 
TableSetFindPtr_T (const string &varName)
 Find pointer to the specified table. More...
 
void Init ()
 Initialize the default value in reservoir, such as temperature, density, table. More...
 
void InitTable ()
 Initialize the tables' name and num of colum. More...
 
template<typename T >
void setVal (vector< T > &obj, const T &val, const vector< USI > &index)
 It's used in InputEQUALS, assigning values in batches. More...
 
template<typename T >
void CopyVal (vector< T > &obj, const vector< T > &src, const vector< USI > &index)
 It's used in InputCOPY, copying the value of one variable to another. More...
 
void MultiplyVal (vector< OCP_DBL > &obj, const OCP_DBL &val, const vector< USI > &index)
 TODO: Add Doxygen. More...
 
void InputCOMPS (ifstream &ifs)
 TODO: Add Doxygen. More...
 
void InputDIMENS (ifstream &ifs)
 TODO: Add Doxygen. More...
 
void DisplayDIMENS ()
 Display the dimens, it's used to chech input. More...
 
void InputRTEMP (ifstream &ifs)
 Input the keyword: RTEMP. RTEMP gives the temperature of reservoir. More...
 
void InputEQUALS (ifstream &ifs)
 TODO: Add Doxygen. More...
 
void InputGRID (ifstream &ifs, string &keyword)
 TODO: Add Doxygen. More...
 
void InputCOPY (ifstream &ifs)
 Input the keyword: COPY. COPY could copy the value of one variable to another. More...
 
void InputMULTIPLY (ifstream &ifs)
 TODO: Add Doxygen. More...
 
void InputTABLE (ifstream &ifs, const string &tabName)
 Input PVTtable and SATtable such as SWOF, PVCO. More...
 
void InputROCK (ifstream &ifs)
 Read data from the ROCK keyword. More...
 
void InputROCKT (ifstream &ifs)
 Input Rock information for ifThermal model. More...
 
void InputHLOSS (ifstream &ifs)
 Input heat loss property for overburden rock and underburden rock.
 
void InputMISCSTR (ifstream &ifs)
 Input the Miscibility information. More...
 
void InputGRAVITY (ifstream &ifs)
 Input the reference gravity of oil, water, and air in standard condition. More...
 
void InputDENSITY (ifstream &ifs)
 Input the reference density of oil, water, and air in standard condition. More...
 
void InputTHCON (ifstream &ifs, const string &keyword)
 Input the phase ifThermal conductivity. More...
 
void InputEQUIL (ifstream &ifs)
 EQUIL contains initial information of reservoir; see ParamEQUIL. More...
 
void InputTABDIMS (ifstream &ifs)
 TABDIMS contains the num of saturation region and PVT region. More...
 
void InputRegion (ifstream &ifs, const string &keyword)
 Input the keyword: SATNUM and PVTNUM. More...
 
void InputCNAMES (ifstream &ifs)
 
void InputCOMPONENTS (ifstream &ifs, const string &keyword)
 
void InputLBCCOEF (ifstream &ifs)
 
void InputBIC (ifstream &ifs)
 
void InputVISCTAB (ifstream &ifs)
 
void InputRefPR (ifstream &ifs, const string &keyword)
 
void InputSSMSTA (ifstream &ifs)
 
void InputNRSTA (ifstream &ifs)
 
void InputSSMSP (ifstream &ifs)
 
void InputNRSP (ifstream &ifs)
 
void InputRR (ifstream &ifs)
 
void CheckParam ()
 Check the reservoir param from input file. More...
 
void CheckGrid ()
 Check the size of properties of grids. More...
 
void CheckRock ()
 Check Rock. More...
 
void CheckEQUIL () const
 Check if keyword EQUIL is given. More...
 
void CheckDenGra () const
 Check if density and gravity are both input, only one of them is needed. More...
 
void CheckPhase () const
 Check existence of disgas, it could only exist when both oil and gas exist. More...
 
void CheckPhaseTab () const
 Check existence of PVTtable and SATtable. More...
 
void CheckRegion () const
 Check if each grid is assigned to an area or all defaulted. More...
 
void CheckEqlRegion () const
 (Todo) Initialization of equilibration of only one region is realized. More...
 

Public Attributes

Dimens dimens
 Dimension of grid: the number of grids along x,y,z direction.
 
OCP_USI numGrid
 Num of grids.
 
vector< OCP_DBLtops
 Depth of the top surface of the uppermost grids.
 
vector< OCP_DBLdx
 Size along the x - direction for each grid.
 
vector< OCP_DBLdy
 Size along the y - direction for each grid.
 
vector< OCP_DBLdz
 Size along the z - direction for each grid.
 
vector< OCP_DBLcoord
 TODO: Add Doxygen.
 
vector< OCP_DBLzcorn
 TODO: Add Doxygen.
 
vector< OCP_DBLntg
 Net to gross for each grid.
 
vector< OCP_DBLporo
 Porosity for each grid.
 
vector< OCP_DBLpermX
 Permeability along the x - direction for each grid.
 
vector< OCP_DBLpermY
 Permeability along the y-direction for each grid.
 
vector< OCP_DBLpermZ
 Permeability along the z-direction for each grid.
 
vector< OCP_DBLthconr
 Rock ifThermal conductivity.
 
OCP_DBL rsTemp
 Temperature for reservoir.
 
vector< RockParamrockSet
 a set of rock
 
HLoss hLoss
 Heat loss property.
 
Miscstr miscstr
 reference Miscibility surface tension
 
vector< OCP_DBLP
 Initial pressure of components in each grid.
 
vector< OCP_DBLNi
 Initial moles of components in each grid.
 
vector< OCP_DBLSwat
 Initial water saturation in each grid.
 
OCP_BOOL ScalePcow {OCP_FALSE}
 whether Pcow should be scaled.
 
Type_A_r< OCP_DBLdensity
 Density of oil, water, gas in standard conditions.
 
Type_A_r< OCP_DBLgravity
 Gravity of oil, water, gas in standard conditions.
 
OCP_DBL thcono {24}
 oil ifThermal conductivity
 
OCP_DBL thcong {24}
 gas ifThermal conductivity
 
OCP_DBL thconw {24}
 water ifThermal conductivity
 
OCP_BOOL blackOil {OCP_FALSE}
 If ture, blackoil model will be used.
 
OCP_BOOL comps {OCP_FALSE}
 If OCP_TRUE, compositional model will be used.
 
OCP_BOOL thermal {OCP_FALSE}
 If OCP_TRUE, ifThermal model will be used.
 
OCP_BOOL oil {OCP_FALSE}
 If OCP_TRUE, oil phase could exist.
 
OCP_BOOL gas {OCP_FALSE}
 If OCP_TRUE, gas phase could exist.
 
OCP_BOOL water {OCP_FALSE}
 If OCP_TRUE, water phase could exist.
 
OCP_BOOL disGas {OCP_FALSE}
 If OCP_TRUE, dissolve gas could exist in oil phase.
 
ComponentParam comsParam
 information for components
 
USI NTSFUN {1}
 Num of SAT regions.
 
USI NTPVT {1}
 Num of PVT regions.
 
USI NTROOC {1}
 Num of Rock regions.
 
Type_A_r< OCP_DBLSATNUM
 Records the index of SAT region for each grid.
 
Type_A_r< OCP_DBLPVTNUM
 Records the index of PVT region for each grid.
 
Type_A_r< OCP_DBLACTNUM
 Records the index of Active region for each grid.
 
Type_A_r< OCP_DBLROCKNUM
 Records the index of ROCK region for each grid.
 
TableSet SWFN_T
 Table set of SWFN.
 
TableSet SWOF_T
 Table set of SWOF.
 
TableSet SGFN_T
 Table set of SGFN.
 
TableSet SGOF_T
 Table set of SGOF.
 
TableSet SOF3_T
 Table set of SOF3.
 
TableSet PBVD_T
 Table set of PBVD.
 
TableSet ZMFVD_T
 Table set of ZMFVD.
 
TableSet TEMPVD_T
 Table set of TEMPVD.
 
vector< OCP_DBLEQUIL
 See ParamEQUIL.
 
USI numPhase
 Number of phases.
 
USI numCom
 
TableSet PVCO_T
 Table set of PVCO.
 
TableSet PVDO_T
 Table set of PVDO.
 
TableSet PVDG_T
 Table set of PVDG.
 
TableSet PVTW_T
 Table set of PVTW.
 

Detailed Description

ParamReservoir is an internal structure used to stores the information of reservoir(except wells) from input files. It is an intermediate interface and independent of the main simulator. After all file inputting finishs, the params in it will pass to corresponding modules.

Definition at line 209 of file ParamReservoir.hpp.

Member Function Documentation

◆ CheckDenGra()

void ParamReservoir::CheckDenGra ( ) const

Check if density and gravity are both input, only one of them is needed.

TODO: Add Doxygen.

Definition at line 852 of file ParamReservoir.cpp.

853 {
854  if (density.activity && gravity.activity) {
855  OCP_ABORT("Both DENSITY and GRAVITY have been given, just one can be used!");
856  }
857 }
#define OCP_ABORT(msg)
Abort if critical error happens.
Definition: UtilError.hpp:47
Type_A_r< OCP_DBL > density
Density of oil, water, gas in standard conditions.
Type_A_r< OCP_DBL > gravity
Gravity of oil, water, gas in standard conditions.
OCP_BOOL activity
If OCP_FALSE, this param is not given.

References Type_A_r< T >::activity, density, gravity, and OCP_ABORT.

◆ CheckEqlRegion()

void ParamReservoir::CheckEqlRegion ( ) const

(Todo) Initialization of equilibration of only one region is realized.

TODO: Add Doxygen.

Definition at line 901 of file ParamReservoir.cpp.

902 {
903  if (PBVD_T.data.size() > 1) {
904  OCP_ABORT("More than one equilibrium region is not supported!");
905  }
906 }
TableSet PBVD_T
Table set of PBVD.
vector< vector< vector< OCP_DBL > > > data
All table with the same name.

References TableSet::data, OCP_ABORT, and PBVD_T.

◆ CheckEQUIL()

void ParamReservoir::CheckEQUIL ( ) const

Check if keyword EQUIL is given.

Check EQUIL keyword.

Definition at line 846 of file ParamReservoir.cpp.

847 {
848  if (EQUIL.empty()) OCP_ABORT("EQUIL is missing!");
849 }
vector< OCP_DBL > EQUIL
See ParamEQUIL.

References EQUIL, and OCP_ABORT.

◆ CheckGrid()

void ParamReservoir::CheckGrid ( )

Check the size of properties of grids.

Check data dimension for potential problems.

Definition at line 813 of file ParamReservoir.cpp.

814 {
815  if (coord.size() == 0) {
816  if (tops.size() != dimens.nx * dimens.ny) OCP_ABORT("Wrong TOPS size!");
817  if (dx.size() != numGrid) OCP_ABORT("Wrong DX size!");
818  if (dy.size() != numGrid) OCP_ABORT("Wrong DY size!");
819  if (dz.size() != numGrid) OCP_ABORT("Wrong DZ size!");
820  } else {
821  if (coord.size() != (dimens.nx + 1) * (dimens.ny + 1) * 6)
822  OCP_ABORT("Wrong COORD size!");
823  if (zcorn.size() != numGrid * 8) OCP_ABORT("Wrong ZCORN size!");
824  }
825 
826  if (poro.size() != numGrid) OCP_ABORT("Wrong PORO size!");
827  if (permX.size() != numGrid) OCP_ABORT("Wrong PERMX size!");
828  if (permY.size() != numGrid) OCP_ABORT("Wrong PERMY size!");
829  if (permZ.size() != numGrid) OCP_ABORT("Wrong PERMZ size!");
830 
831  if (ntg.size() != numGrid) {
832  ntg.resize(numGrid, 1);
833  cout << "Set net-to-gross ratio to 1.0!" << endl;
834  }
835 }
USI nx
Num of bulks along x-direction.
USI ny
Num of bulks along y-direction.
vector< OCP_DBL > permY
Permeability along the y-direction for each grid.
vector< OCP_DBL > zcorn
TODO: Add Doxygen.
vector< OCP_DBL > poro
Porosity for each grid.
vector< OCP_DBL > dy
Size along the y - direction for each grid.
vector< OCP_DBL > permX
Permeability along the x - direction for each grid.
vector< OCP_DBL > permZ
Permeability along the z-direction for each grid.
vector< OCP_DBL > dx
Size along the x - direction for each grid.
vector< OCP_DBL > tops
Depth of the top surface of the uppermost grids.
vector< OCP_DBL > ntg
Net to gross for each grid.
vector< OCP_DBL > coord
TODO: Add Doxygen.
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.
OCP_USI numGrid
Num of grids.

References coord, dimens, dx, dy, dz, ntg, numGrid, Dimens::nx, Dimens::ny, OCP_ABORT, permX, permY, permZ, poro, tops, and zcorn.

◆ CheckParam()

void ParamReservoir::CheckParam ( )

Check the reservoir param from input file.

Check consistency of input parameters.

Definition at line 802 of file ParamReservoir.cpp.

803 {
804  CheckGrid();
805  CheckEQUIL();
806  CheckDenGra();
807  CheckPhase();
808  CheckRegion();
809  CheckRock();
810 }
void CheckEQUIL() const
Check if keyword EQUIL is given.
void CheckPhase() const
Check existence of disgas, it could only exist when both oil and gas exist.
void CheckGrid()
Check the size of properties of grids.
void CheckRegion() const
Check if each grid is assigned to an area or all defaulted.
void CheckDenGra() const
Check if density and gravity are both input, only one of them is needed.
void CheckRock()
Check Rock.

References CheckDenGra(), CheckEQUIL(), CheckGrid(), CheckPhase(), CheckRegion(), and CheckRock().

◆ CheckPhase()

void ParamReservoir::CheckPhase ( ) const

Check existence of disgas, it could only exist when both oil and gas exist.

TODO: Add Doxygen.

Definition at line 860 of file ParamReservoir.cpp.

861 {
862  if (blackOil && disGas && (!gas && !oil)) {
863  OCP_ABORT("DISGAS can only be used only if OIL and GAS are both present!");
864  }
865 }
OCP_BOOL oil
If OCP_TRUE, oil phase could exist.
OCP_BOOL gas
If OCP_TRUE, gas phase could exist.
OCP_BOOL blackOil
If ture, blackoil model will be used.
OCP_BOOL disGas
If OCP_TRUE, dissolve gas could exist in oil phase.

References blackOil, disGas, gas, OCP_ABORT, and oil.

◆ CheckPhaseTab()

void ParamReservoir::CheckPhaseTab ( ) const

Check existence of PVTtable and SATtable.

Check tables: Different tables will be used under different conditions.

Definition at line 868 of file ParamReservoir.cpp.

869 {
870  if (!blackOil && !comps) OCP_ABORT("Unknown model: Use BLACKOIL or COMPS!");
871 
872  if (water && oil && SWOF_T.data.empty()) OCP_ABORT("SWOF is missing!");
873  if (gas && oil && SGOF_T.data.empty()) OCP_ABORT("SGOF is missing!");
874  if (water && PVTW_T.data.empty()) OCP_ABORT("PVTW is missing!");
875 
876  if (blackOil) {
877  if (oil && disGas && PVCO_T.data.empty()) OCP_ABORT("PVCO is missing!");
878  if (oil && (!disGas) && PVDO_T.data.empty()) OCP_ABORT("PVDO is missing!");
879  if (gas && PVDG_T.data.empty()) OCP_ABORT("PVDG is missing!");
880  }
881 }
TableSet PVDG_T
Table set of PVDG.
TableSet PVDO_T
Table set of PVDO.
OCP_BOOL comps
If OCP_TRUE, compositional model will be used.
TableSet SGOF_T
Table set of SGOF.
TableSet PVTW_T
Table set of PVTW.
TableSet SWOF_T
Table set of SWOF.
TableSet PVCO_T
Table set of PVCO.
OCP_BOOL water
If OCP_TRUE, water phase could exist.

References blackOil, comps, TableSet::data, disGas, gas, OCP_ABORT, oil, PVCO_T, PVDG_T, PVDO_T, PVTW_T, SGOF_T, SWOF_T, and water.

◆ CheckRegion()

void ParamReservoir::CheckRegion ( ) const

Check if each grid is assigned to an area or all defaulted.

TODO: Add Doxygen.

Definition at line 884 of file ParamReservoir.cpp.

885 {
886  if (SATNUM.activity && SATNUM.data.size() != numGrid) {
887  OCP_ABORT("Missing data in SATNUM!");
888  }
889  if (PVTNUM.activity && PVTNUM.data.size() != numGrid) {
890  OCP_ABORT("Missing data in PVTNUM!");
891  }
892  if (ACTNUM.activity && ACTNUM.data.size() != numGrid) {
893  OCP_ABORT("Missing data in ACTNUM!");
894  }
895  if (ROCKNUM.activity && ROCKNUM.data.size() != numGrid) {
896  OCP_ABORT("Missing data in ROCKNUM!");
897  }
898 }
Type_A_r< OCP_DBL > SATNUM
Records the index of SAT region for each grid.
Type_A_r< OCP_DBL > ACTNUM
Records the index of Active region for each grid.
Type_A_r< OCP_DBL > PVTNUM
Records the index of PVT region for each grid.
Type_A_r< OCP_DBL > ROCKNUM
Records the index of ROCK region for each grid.
vector< T > data
Data of param.

References Type_A_r< T >::activity, ACTNUM, Type_A_r< T >::data, numGrid, OCP_ABORT, PVTNUM, ROCKNUM, and SATNUM.

◆ CheckRock()

void ParamReservoir::CheckRock ( )

Check Rock.

Check rock keyword.

Definition at line 838 of file ParamReservoir.cpp.

839 {
840  if (rockSet.size() != NTROOC) {
841  OCP_ABORT("Wrong ROCK or ROCKT!");
842  }
843 }
vector< RockParam > rockSet
a set of rock
USI NTROOC
Num of Rock regions.

References NTROOC, OCP_ABORT, and rockSet.

◆ CopyVal()

template<typename T >
void ParamReservoir::CopyVal ( vector< T > &  obj,
const vector< T > &  src,
const vector< USI > &  index 
)

It's used in InputCOPY, copying the value of one variable to another.

TODO: Add Doxygen.

Definition at line 243 of file ParamReservoir.cpp.

246 {
247  USI Nx = dimens.nx;
248  USI Ny = dimens.ny;
249  OCP_USI NxNy = Nx * Ny;
250  OCP_USI id = 0;
251 
252  for (USI k = index[4]; k <= index[5]; k++) {
253  for (USI j = index[2]; j <= index[3]; j++) {
254  for (USI i = index[0]; i <= index[1]; i++) {
255  id = k * NxNy + j * Nx + i;
256  obj[id] = src[id];
257  }
258  }
259  }
260 }
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:23
unsigned int OCP_USI
Long unsigned integer.
Definition: OCPConst.hpp:25

References dimens, Dimens::nx, and Dimens::ny.

◆ DisplayDIMENS()

void ParamReservoir::DisplayDIMENS ( )

Display the dimens, it's used to chech input.

TODO: Add Doxygen.

Definition at line 310 of file ParamReservoir.cpp.

311 {
312  cout << "\n---------------------" << endl
313  << "DIMENS"
314  << "\n---------------------" << endl;
315  cout << " " << dimens.nx << " " << dimens.ny << " " << dimens.nz << endl;
316 }
USI nz
Num of bulks along z-direction.

References dimens, Dimens::nx, Dimens::ny, and Dimens::nz.

◆ FindPtr()

vector< OCP_DBL > * ParamReservoir::FindPtr ( const string &  varName)

Find pointer to the specified variable.

Find corresponding variable according to the name of variable. It is used for the basic properties of reservoir such as DX.

Definition at line 15 of file ParamReservoir.cpp.

16 {
17  vector<OCP_DBL>* myPtr = nullptr;
18 
19  switch (Map_Str2Int(&varName[0], varName.size())) {
20  case Map_Str2Int("DX", 2):
21  dx.reserve(numGrid);
22  myPtr = &dx;
23  break;
24 
25  case Map_Str2Int("DY", 2):
26  dy.reserve(numGrid);
27  myPtr = &dy;
28  break;
29 
30  case Map_Str2Int("DZ", 2):
31  dz.reserve(numGrid);
32  myPtr = &dz;
33  break;
34 
35  case Map_Str2Int("COORD", 5):
36  coord.reserve((dimens.nx + 1) * (dimens.ny + 1) * 6);
37  myPtr = &coord;
38  break;
39 
40  case Map_Str2Int("ZCORN", 5):
41  zcorn.reserve(numGrid * 8);
42  myPtr = &zcorn;
43  break;
44 
45  case Map_Str2Int("PORO", 4):
46  poro.reserve(numGrid);
47  myPtr = &poro;
48  break;
49 
50  case Map_Str2Int("NTG", 3):
51  ntg.reserve(numGrid);
52  myPtr = &ntg;
53  break;
54 
55  case Map_Str2Int("PERMX", 5):
56  permX.reserve(numGrid);
57  myPtr = &permX;
58  break;
59 
60  case Map_Str2Int("PERMY", 5):
61  permY.reserve(numGrid);
62  myPtr = &permY;
63  break;
64 
65  case Map_Str2Int("PERMZ", 5):
66  permZ.reserve(numGrid);
67  myPtr = &permZ;
68  break;
69 
70  case Map_Str2Int("THCONR", 6):
71  thconr.reserve(numGrid);
72  myPtr = &thconr;
73  break;
74 
75  case Map_Str2Int("TOPS", 4):
76  tops.reserve(dimens.nx * dimens.ny);
77  myPtr = &tops;
78  break;
79 
80  case Map_Str2Int("PRESSURE", 8):
81  P.reserve(numGrid);
82  myPtr = &P;
83  break;
84 
85  case Map_Str2Int("Ni", 2):
86  Ni.reserve(numGrid);
87  myPtr = &Ni;
88  break;
89 
90  case Map_Str2Int("SWATINIT", 8):
91  Swat.reserve(numGrid);
92  myPtr = &Swat;
93  ScalePcow = OCP_TRUE;
94  break;
95 
96  case Map_Str2Int("SATNUM", 6):
97  SATNUM.activity = OCP_TRUE;
98  SATNUM.data.reserve(numGrid);
99  myPtr = &SATNUM.data;
100  break;
101 
102  case Map_Str2Int("PVTNUM", 6):
103  PVTNUM.activity = OCP_TRUE;
104  PVTNUM.data.reserve(numGrid);
105  myPtr = &PVTNUM.data;
106  break;
107 
108  case Map_Str2Int("ROCKNUM", 7):
109  ROCKNUM.activity = OCP_TRUE;
110  ROCKNUM.data.reserve(numGrid);
111  myPtr = &ROCKNUM.data;
112  break;
113  }
114 
115  return myPtr;
116 }
constexpr long long Map_Str2Int(const char *mystr, const USI &len)
Definition: UtilInput.hpp:34
vector< OCP_DBL > Ni
Initial moles of components in each grid.
vector< OCP_DBL > thconr
Rock ifThermal conductivity.
vector< OCP_DBL > Swat
Initial water saturation in each grid.
vector< OCP_DBL > P
Initial pressure of components in each grid.

References coord, dimens, dx, dy, dz, Map_Str2Int(), Ni, ntg, numGrid, Dimens::nx, Dimens::ny, P, permX, permY, permZ, poro, Swat, thconr, tops, and zcorn.

◆ FindPtr_T()

TableSet * ParamReservoir::FindPtr_T ( const string &  varName)

Find pointer to the specified table.

Find corresponding variable according to the name of variable. It is used for the scope of the table.

Definition at line 119 of file ParamReservoir.cpp.

120 {
121  TableSet* myPtr = nullptr;
122 
123  switch (Map_Str2Int(&varName[0], varName.size())) {
124  case Map_Str2Int("SWFN", 4):
125  myPtr = &SWFN_T;
126  break;
127 
128  case Map_Str2Int("SWOF", 4):
129  myPtr = &SWOF_T;
130  break;
131 
132  case Map_Str2Int("SGFN", 4):
133  myPtr = &SGFN_T;
134  break;
135 
136  case Map_Str2Int("SGOF", 4):
137  myPtr = &SGOF_T;
138  break;
139 
140  case Map_Str2Int("SOF3", 4):
141  myPtr = &SOF3_T;
142  break;
143 
144  case Map_Str2Int("PBVD", 4):
145  myPtr = &PBVD_T;
146  break;
147 
148  case Map_Str2Int("PVCO", 4):
149  myPtr = &PVCO_T;
150  break;
151 
152  case Map_Str2Int("PVDO", 4):
153  myPtr = &PVDO_T;
154  break;
155 
156  case Map_Str2Int("PVDG", 4):
157  myPtr = &PVDG_T;
158  break;
159 
160  case Map_Str2Int("PVTW", 4):
161  myPtr = &PVTW_T;
162  break;
163 
164  case Map_Str2Int("ZMFVD", 5):
165  myPtr = &ZMFVD_T;
166  break;
167 
168  case Map_Str2Int("TEMPVD", 6):
169  myPtr = &TEMPVD_T;
170  break;
171  }
172 
173  return myPtr;
174 }
TableSet ZMFVD_T
Table set of ZMFVD.
TableSet SOF3_T
Table set of SOF3.
TableSet TEMPVD_T
Table set of TEMPVD.
TableSet SGFN_T
Table set of SGFN.
TableSet SWFN_T
Table set of SWFN.

References Map_Str2Int(), PBVD_T, PVCO_T, PVDG_T, PVDO_T, PVTW_T, SGFN_T, SGOF_T, SOF3_T, SWFN_T, SWOF_T, TEMPVD_T, and ZMFVD_T.

◆ Init()

void ParamReservoir::Init ( )

Initialize the default value in reservoir, such as temperature, density, table.

Initialize tables and other reservoir parameters.

Definition at line 177 of file ParamReservoir.cpp.

178 {
179  InitTable();
180 
181  gravity.data.resize(3);
182  gravity.data[0] = 45.5; // oil
183  gravity.data[1] = 1.0; // pure water
184  gravity.data[2] = 0.7773; // air
185 
186  density.data.resize(3);
187  density.data[0] = 37.457; // The density of oil at surface conditions: lb/ft3
188  density.data[1] = 62.366416; // The density of water at surface conditions: lb/ft3
189  density.data[2] = 0.062428; // The density of gas at surface conditions: lb/ft3
190 
191  rsTemp = 60.0;
192 }
void InitTable()
Initialize the tables' name and num of colum.
OCP_DBL rsTemp
Temperature for reservoir.

References Type_A_r< T >::data, density, gravity, InitTable(), and rsTemp.

◆ InitTable()

void ParamReservoir::InitTable ( )

Initialize the tables' name and num of colum.

Initialize tables.

Definition at line 195 of file ParamReservoir.cpp.

196 {
197  SWFN_T.name = "SWFN";
198  SWFN_T.colNum = 3;
199  SWOF_T.name = "SWOF";
200  SWOF_T.colNum = 4;
201  SGFN_T.name = "SGFN";
202  SGFN_T.colNum = 3;
203  SGOF_T.name = "SGOF";
204  SGOF_T.colNum = 4;
205  SOF3_T.name = "SOF3";
206  SOF3_T.colNum = 3;
207  PBVD_T.name = "PBVD";
208  PBVD_T.colNum = 2;
209  PVCO_T.name = "PVCO";
210  PVCO_T.colNum = 6;
211  PVDO_T.name = "PVDO";
212  PVDO_T.colNum = 3;
213  PVDG_T.name = "PVDG";
214  PVDG_T.colNum = 3;
215  PVTW_T.name = "PVTW";
216  PVTW_T.colNum = 5;
217  ZMFVD_T.name = "ZMFVD"; // colnum equals numCom(hydrocarbon) + 1
218  TEMPVD_T.name = "TEMPVD"; // colnum equals 2
219  TEMPVD_T.colNum = 2;
220 }
USI colNum
Number of columns of table.
string name
Name of table.

References TableSet::colNum, TableSet::name, PBVD_T, PVCO_T, PVDG_T, PVDO_T, PVTW_T, SGFN_T, SGOF_T, SOF3_T, SWFN_T, SWOF_T, TEMPVD_T, and ZMFVD_T.

◆ InputCOMPS()

void ParamReservoir::InputCOMPS ( ifstream &  ifs)

TODO: Add Doxygen.

Input the keyword: COMPS. COMPS is used in compositional model, which gives the num of components.

Definition at line 283 of file ParamReservoir.cpp.

284 {
285  comps = OCP_TRUE;
286  vector<string> vbuf;
287  ReadLine(ifs, vbuf);
288  numCom = stoi(vbuf[0]);
290  comsParam.Init();
291 
292  cout << endl << "COMPS" << endl;
293  cout << numCom << endl;
294 }
OCP_BOOL ReadLine(ifstream &ifs, vector< string > &result)
Definition: UtilInput.cpp:14
USI numCom
num of components, water is excluded.
void Init()
Init Params.
ComponentParam comsParam
information for components

References comps.

◆ InputCOPY()

void ParamReservoir::InputCOPY ( ifstream &  ifs)

Input the keyword: COPY. COPY could copy the value of one variable to another.

TODO: Add Doxygen.

Definition at line 410 of file ParamReservoir.cpp.

411 {
412  cout << "\n---------------------" << endl
413  << "COPY"
414  << "\n---------------------" << endl;
415 
416  vector<string> vbuf;
417  vector<USI> index(6, 0);
418 
419  while (ReadLine(ifs, vbuf)) {
420  if (vbuf[0] == "/") break;
421 
422  for (auto v : vbuf) {
423  if (v != "/") cout << setw(10) << v;
424  }
425  cout << "\n";
426 
427  index[0] = 0, index[1] = dimens.nx - 1;
428  index[2] = 0, index[3] = dimens.ny - 1;
429  index[4] = 0, index[5] = dimens.nz - 1;
430 
431  string srcName = vbuf[0];
432  string objName = vbuf[1];
433  DealDefault(vbuf);
434  for (USI n = 2; n < 8; n++) {
435  if (vbuf[n] != "DEFAULT") index[n - 2] = stoi(vbuf[n]) - 1;
436  }
437 
438  vector<OCP_DBL>* srcPtr = FindPtr(srcName);
439  vector<OCP_DBL>* objPtr = FindPtr(objName);
440  if (srcPtr != nullptr && objPtr != nullptr) {
441  objPtr->resize(srcPtr->size());
442  CopyVal(*objPtr, *srcPtr, index);
443  } else {
444  OCP_ABORT("Wrong object names: " + srcName + ", " + objName);
445  }
446  }
447 }
void DealDefault(vector< string > &result)
Definition: UtilInput.cpp:50
void CopyVal(vector< T > &obj, const vector< T > &src, const vector< USI > &index)
It's used in InputCOPY, copying the value of one variable to another.
vector< OCP_DBL > * FindPtr(const string &varName)
Find pointer to the specified variable.

References CopyVal(), DealDefault(), dimens, FindPtr(), Dimens::nx, Dimens::ny, Dimens::nz, OCP_ABORT, and ReadLine().

◆ InputDENSITY()

void ParamReservoir::InputDENSITY ( ifstream &  ifs)

Input the reference density of oil, water, and air in standard condition.

Read data from the DENSITY keyword.

Definition at line 677 of file ParamReservoir.cpp.

678 {
679  vector<string> vbuf;
680  ReadLine(ifs, vbuf);
681  if (vbuf[0] == "/") return;
682 
683  DealDefault(vbuf);
684  OCP_ASSERT(vbuf.size() == 3, "Wrong Keyword DENSITY!");
685  for (USI i = 0; i < 3; i++) {
686  if (vbuf[i] != "DEFAULT") {
687  density.activity = OCP_TRUE;
688  density.data[i] = stod(vbuf[i]);
689  }
690  }
691 
692  cout << "\n---------------------" << endl
693  << "DENSITY"
694  << "\n---------------------" << endl;
695  cout << density.data[0] << " " << density.data[1] << " " << density.data[2]
696  << endl;
697 }
#define OCP_ASSERT(cond, msg)
Assert condition and log user messages in DEBUG mode.
Definition: UtilError.hpp:58

References Type_A_r< T >::activity, DealDefault(), density, OCP_ASSERT, and ReadLine().

◆ InputDIMENS()

void ParamReservoir::InputDIMENS ( ifstream &  ifs)

TODO: Add Doxygen.

Input the keyword: DIMENS. DIMENS contain the dimension of grids of reservoir. It gives the num of grids along the x,y,z direction.

Definition at line 297 of file ParamReservoir.cpp.

298 {
299  vector<string> vbuf;
300  ReadLine(ifs, vbuf);
301  dimens.nx = stoi(vbuf[0]);
302  dimens.ny = stoi(vbuf[1]);
303  dimens.nz = stoi(vbuf[2]);
305 
306  DisplayDIMENS();
307 }
void DisplayDIMENS()
Display the dimens, it's used to chech input.

References dimens, DisplayDIMENS(), numGrid, Dimens::nx, Dimens::ny, Dimens::nz, and ReadLine().

◆ InputEQUALS()

void ParamReservoir::InputEQUALS ( ifstream &  ifs)

TODO: Add Doxygen.

Input the keyword: EQUALS. EQUALS contains many keywords about grids which has special input format. These keywords contains DX, TOPS, PORO and so on. You can assign values to them in batches

Definition at line 330 of file ParamReservoir.cpp.

331 {
332  cout << "\n---------------------" << endl
333  << "EQUALS"
334  << "\n---------------------" << endl;
335 
336  vector<USI> index(6, 0);
337  vector<string> vbuf;
338 
339  while (ReadLine(ifs, vbuf)) {
340  if (vbuf[0] == "/") break;
341 
342  for (auto v : vbuf) {
343  if (v != "/") cout << setw(10) << v;
344  }
345  cout << "\n";
346 
347  index[0] = 0, index[1] = dimens.nx - 1;
348  index[2] = 0, index[3] = dimens.ny - 1;
349  index[4] = 0, index[5] = dimens.nz - 1;
350 
351  string objName = vbuf[0];
352  OCP_DBL val = stod(vbuf[1]);
353 
354  DealDefault(vbuf);
355 
356  for (USI n = 2; n < 8; n++) {
357  if (vbuf[n] != "DEFAULT") index[n - 2] = stoi(vbuf[n]) - 1;
358  }
359  if (index[0] < 0 || index[2] < 0 || index[4] < 0 || index[1] > dimens.nx - 1 ||
360  index[3] > dimens.ny - 1 || index[5] > dimens.nz - 1) {
361  OCP_ABORT("WRONG Range in " + objName + " in EQUALS!");
362  }
363 
364  vector<OCP_DBL>* objPtr = FindPtr(objName);
365 
366  if (objPtr != nullptr) {
367  if (objName == "TOPS") {
368  objPtr->resize(dimens.nx * dimens.ny);
369  index[4] = index[5] = 0;
370  } else {
371  objPtr->resize(numGrid);
372  }
373  setVal(*objPtr, val, index);
374  } else {
375  OCP_ABORT("Wrong object name: " + objName);
376  }
377  }
378 }
double OCP_DBL
Double precision.
Definition: OCPConst.hpp:27
void setVal(vector< T > &obj, const T &val, const vector< USI > &index)
It's used in InputEQUALS, assigning values in batches.

References DealDefault(), dimens, FindPtr(), numGrid, Dimens::nx, Dimens::ny, Dimens::nz, OCP_ABORT, ReadLine(), and setVal().

◆ InputEQUIL()

void ParamReservoir::InputEQUIL ( ifstream &  ifs)

EQUIL contains initial information of reservoir; see ParamEQUIL.

Read data from the EQUIL keyword.

Definition at line 718 of file ParamReservoir.cpp.

719 {
720  vector<string> vbuf;
721  ReadLine(ifs, vbuf);
722  if (vbuf[0] == "/") return;
723 
724  EQUIL.resize(6, 0);
725  DealDefault(vbuf);
726  for (USI i = 0; i < 6; i++) {
727  if (vbuf[i] != "DEFAULT") EQUIL[i] = stod(vbuf[i]);
728  }
729 
730  cout << "\n---------------------" << endl
731  << "EQUIL"
732  << "\n---------------------" << endl;
733  cout << " ";
734  for (USI i = 0; i < 6; i++) cout << EQUIL[i] << " ";
735  cout << endl;
736 }

References DealDefault(), EQUIL, and ReadLine().

◆ InputGRAVITY()

void ParamReservoir::InputGRAVITY ( ifstream &  ifs)

Input the reference gravity of oil, water, and air in standard condition.

Read data from the GRAVITY keyword.

Definition at line 655 of file ParamReservoir.cpp.

656 {
657  gravity.activity = OCP_TRUE;
658  vector<string> vbuf;
659  ReadLine(ifs, vbuf);
660  if (vbuf[0] == "/") return;
661  DealDefault(vbuf);
662  OCP_ASSERT(vbuf.size() == 4, "Wrong Keyword GRAVITY!");
663  for (USI i = 0; i < 3; i++) {
664  if (vbuf[i] != "DEFAULT") {
665  gravity.data[i] = stod(vbuf[i]);
666  }
667  }
668 
669  cout << "\n---------------------" << endl
670  << "GRAVITY"
671  << "\n---------------------" << endl;
672  cout << " " << gravity.data[0] << " " << gravity.data[1] << " "
673  << gravity.data[2] << endl;
674 }

References Type_A_r< T >::activity, and gravity.

◆ InputGRID()

void ParamReservoir::InputGRID ( ifstream &  ifs,
string &  keyword 
)

TODO: Add Doxygen.

Input the keyword about grids, actually, it's a supplement for EQUALS. It supplies another way to input the params in EQUALS.

Definition at line 381 of file ParamReservoir.cpp.

382 {
383  vector<OCP_DBL>* objPtr = nullptr;
384 
385  objPtr = FindPtr(keyword);
386  if (objPtr == nullptr) {
387  OCP_ABORT("Unknown keyword!");
388  }
389 
390  vector<string> vbuf;
391  while (ReadLine(ifs, vbuf)) {
392  if (vbuf[0] == "/") break;
393 
394  for (auto& str : vbuf) {
395  // if m*n occurs, then push back n m times
396  auto pos = str.find('*');
397  if (pos == string::npos) {
398  objPtr->push_back(stod(str));
399  } else {
400  USI len = str.size();
401  OCP_USI num = stoi(str.substr(0, pos));
402  OCP_DBL val = stod(str.substr(pos + 1, len - (pos + 1)));
403  for (USI i = 0; i < num; i++) objPtr->push_back(val);
404  }
405  }
406  }
407 }

References FindPtr(), OCP_ABORT, and ReadLine().

◆ InputMISCSTR()

void ParamReservoir::InputMISCSTR ( ifstream &  ifs)

Input the Miscibility information.

Read data from the MISCSTR keyword.

Definition at line 632 of file ParamReservoir.cpp.

633 {
634  if (!comsParam.miscible) {
635  OCP_WARNING("MISCIBLE has not been declared. Keyword ignored!");
636  } else {
637  vector<string> vbuf;
638  ReadLine(ifs, vbuf);
639  if (vbuf[0] == "/") return;
640  if (vbuf.back() == "/") vbuf.pop_back();
641 
642  USI len = vbuf.size();
643  for (USI i = 0; i < len; i++) {
644  miscstr.surTenRef.push_back(stod(vbuf[i]));
645  }
646  }
647  cout << "\n---------------------" << endl
648  << "MISCSTR"
649  << "\n---------------------" << endl;
650  for (auto& v : miscstr.surTenRef) cout << v << " ";
651  cout << endl;
652 }
#define OCP_WARNING(msg)
Log warning messages.
Definition: UtilError.hpp:39
Miscstr miscstr
reference Miscibility surface tension

References comsParam, ComponentParam::miscible, miscstr, OCP_WARNING, and ReadLine().

◆ InputMULTIPLY()

void ParamReservoir::InputMULTIPLY ( ifstream &  ifs)

TODO: Add Doxygen.

Input the keyword: MULTIPLY. MULTIIPLY could multiply the value of a certain range of a variable by a coefficient.

Definition at line 450 of file ParamReservoir.cpp.

451 {
452  vector<string> vbuf;
453  vector<USI> index(6, 0);
454 
455  while (ReadLine(ifs, vbuf)) {
456  if (vbuf[0] == "/") break;
457 
458  index[0] = 0, index[1] = dimens.nx - 1;
459  index[2] = 0, index[3] = dimens.ny - 1;
460  index[4] = 0, index[5] = dimens.nz - 1;
461 
462  string objName = vbuf[0];
463  OCP_DBL val = stod(vbuf[1]);
464 
465  DealDefault(vbuf);
466  for (USI n = 2; n < 8; n++) {
467  if (vbuf[n] != "DEFAULT") index[n - 2] = stoi(vbuf[n]) - 1;
468  }
469 
470  vector<OCP_DBL>* objPtr = FindPtr(objName);
471  if (objPtr != nullptr) {
472  if (objName == "TOPS") {
473  index[4] = index[5] = 0;
474  }
475  MultiplyVal(*objPtr, val, index);
476  } else {
477  OCP_ABORT("Wrong object name: " + objName);
478  }
479  }
480 }
void MultiplyVal(vector< OCP_DBL > &obj, const OCP_DBL &val, const vector< USI > &index)
TODO: Add Doxygen.

References DealDefault(), dimens, FindPtr(), MultiplyVal(), Dimens::nx, Dimens::ny, Dimens::nz, OCP_ABORT, and ReadLine().

◆ InputRegion()

void ParamReservoir::InputRegion ( ifstream &  ifs,
const string &  keyword 
)

Input the keyword: SATNUM and PVTNUM.

Region information like SATNUM to decide which grid belongs to which saturation region, so corresponding saturation table will be used.

Definition at line 761 of file ParamReservoir.cpp.

762 {
763  Type_A_r<OCP_DBL>* ptr = &PVTNUM;
764  USI lim = NTPVT;
765 
766  if (keyword == "SATNUM") {
767  ptr = &SATNUM;
768  lim = NTSFUN;
769  } else if (keyword == "ACTNUM") {
770  ptr = &ACTNUM;
771  } else if (keyword == "ROCKNUM") {
772  ptr = &ROCKNUM;
773  }
774 
775  ptr->activity = OCP_TRUE;
776  ptr->data.reserve(numGrid);
777  vector<string> vbuf;
778  vector<OCP_USI> obj;
779  vector<USI> region;
780 
781  while (ReadLine(ifs, vbuf)) {
782  if (vbuf[0] == "/") break;
783 
784  for (auto& str : vbuf) {
785  // if m*n occurs, then push back n m times
786  auto pos = str.find('*');
787  if (pos == string::npos) {
788  ptr->data.push_back(stod(str));
789  } else {
790  USI len = str.size();
791  OCP_USI num = stoi(str.substr(0, pos));
792  OCP_DBL val = stod(str.substr(pos + 1, len - (pos + 1)));
793  for (USI i = 0; i < num; i++) ptr->data.push_back(val);
794  }
795  }
796  }
797 
798  cout << "Number of Tables = " << lim << endl;
799 }
USI NTSFUN
Num of SAT regions.
USI NTPVT
Num of PVT regions.

References Type_A_r< T >::activity, ACTNUM, NTPVT, NTSFUN, PVTNUM, ROCKNUM, and SATNUM.

◆ InputROCK()

void ParamReservoir::InputROCK ( ifstream &  ifs)

Read data from the ROCK keyword.

Input the keyword: ROCK. ROCK contains the compressibility factor and reference pressure at initial porosity.

Definition at line 520 of file ParamReservoir.cpp.

521 {
522  cout << "\n---------------------" << endl
523  << "ROCK"
524  << "\n---------------------" << endl;
525 
526  vector<string> vbuf;
527  while (true) {
528  ReadLine(ifs, vbuf);
529  if (vbuf[0] == "/") break;
530 
531  RockParam rock;
532  rock.type = vbuf[0];
533  rock.Pref = stod(vbuf[1]);
534  rock.cp1 = stod(vbuf[2]);
535 
536  if (rock.type == "LINEAR02") {
537  if (vbuf.size() > 3 && vbuf[3] != "/") {
538  rock.cp2 = stod(vbuf[3]);
539  } else {
540  rock.cp2 = rock.cp1;
541  }
542  }
543  rockSet.push_back(rock);
544 
545  cout << " " << rock.type << " " << rock.Pref << " " << rock.cp1 << " "
546  << rock.cp2 << endl;
547  }
548 }
RockParam class contains information about the keyword ROCK.
OCP_DBL cp1
Compressibility factor of rock in reservoir.
OCP_DBL Pref
Reference pressure at initial porosity.
string type
LINEAR or EXPONENT for porosity model.
OCP_DBL cp2
2 order Compressibility factor of rock in reservoir.

References RockParam::cp1, RockParam::cp2, RockParam::Pref, ReadLine(), rockSet, and RockParam::type.

◆ InputROCKT()

void ParamReservoir::InputROCKT ( ifstream &  ifs)

Input Rock information for ifThermal model.

Read data from the ROCK keyword.

Definition at line 551 of file ParamReservoir.cpp.

552 {
553  cout << "\n---------------------" << endl
554  << "ROCKT"
555  << "\n---------------------" << endl;
556 
557  RockParam rock;
558  vector<string> vbuf;
559  while (true) {
560  ReadLine(ifs, vbuf);
561  if (vbuf[0] == "/") break;
562 
563  USI index = 0;
564  USI len = vbuf.size();
565  while (index < len) {
566  if (vbuf[index] == "*PORFORM") {
567  rock.type = vbuf[index + 1];
568  } else if (vbuf[index] == "*PRPOR") {
569  rock.Pref = stod(vbuf[index + 1]);
570  } else if (vbuf[index] == "*TRPOR") {
571  rock.Tref = stod(vbuf[index + 1]);
572  } else if (vbuf[index] == "*CPOR") {
573  rock.cp1 = stod(vbuf[index + 1]);
574  } else if (vbuf[index] == "*CTPOR") {
575  rock.ct = stod(vbuf[index + 1]);
576  } else if (vbuf[index] == "*CPTPOR") {
577  rock.cpt = stod(vbuf[index + 1]);
578  } else if (vbuf[index] == "*VOLCONST") {
579  if (vbuf[index + 1] == "BULK") rock.ConstRock = OCP_FALSE;
580  } else if (vbuf[index] == "*CP1") {
581  rock.HCP1 = stod(vbuf[index + 1]);
582  } else if (vbuf[index] == "*CP2") {
583  rock.HCP2 = stod(vbuf[index + 1]);
584  }
585  index += 2;
586  }
587  }
588  rockSet.push_back(rock);
589 
590  cout << "*PORFORM " << rock.type << endl;
591  cout << "*PRPOR " << rock.Pref << endl;
592  cout << "*TRPOR " << rock.Tref << endl;
593  cout << "*CPOR " << rock.cp1 << endl;
594  cout << "*CTPOR " << rock.ct << endl;
595  cout << "*CPTPOR " << rock.cpt << endl;
596  cout << "*VOLCONST " << (rock.ConstRock ? "ROCK" : "BULK") << endl;
597  cout << "*CP1 " << rock.HCP1 << endl;
598  cout << "*CP2 " << rock.HCP2 << endl;
599 }
OCP_DBL cpt
cross items, ifThermal only
OCP_DBL HCP1
coefficients of the rock enthalpy formula, Btu/ft^3 - F
OCP_DBL HCP2
coefficients of the rock enthalpy formula, Btu/ft^3 - F
OCP_DBL ct
Expansion factor of rock in reservoir, ifThermal only.
OCP_DBL Tref
Reference temperature at initial porosity.
OCP_BOOL ConstRock

References RockParam::ConstRock, RockParam::cp1, RockParam::cpt, RockParam::ct, RockParam::Pref, ReadLine(), RockParam::Tref, and RockParam::type.

◆ InputRTEMP()

void ParamReservoir::InputRTEMP ( ifstream &  ifs)

Input the keyword: RTEMP. RTEMP gives the temperature of reservoir.

TODO: Add Doxygen.

Definition at line 319 of file ParamReservoir.cpp.

320 {
321  vector<string> vbuf;
322  ReadLine(ifs, vbuf);
323  if (vbuf[0] == "/") return;
324 
325  rsTemp = stod(vbuf[0]);
326  cout << "RTEMP\n" << rsTemp << endl << endl;
327 }

References ReadLine(), and rsTemp.

◆ InputTABDIMS()

void ParamReservoir::InputTABDIMS ( ifstream &  ifs)

TABDIMS contains the num of saturation region and PVT region.

Read data from the TABDIMS keyword.

Definition at line 739 of file ParamReservoir.cpp.

740 {
741  vector<string> vbuf;
742  ReadLine(ifs, vbuf);
743 
744  if (vbuf.size() < 3) {
745  OCP_ABORT("Input the number of Saturation tables, PVT tables, and Rock tables "
746  "in turn!");
747  }
748 
749  NTSFUN = stoi(vbuf[0]);
750  NTPVT = stoi(vbuf[1]);
751  NTROOC = stoi(vbuf[2]);
752 
753  cout << "\n---------------------" << endl
754  << "TABDIMS"
755  << "\n---------------------" << endl;
756  cout << " " << NTSFUN << " " << NTPVT << " " << NTROOC << endl;
757 }

References NTPVT, NTROOC, NTSFUN, OCP_ABORT, and ReadLine().

◆ InputTABLE()

void ParamReservoir::InputTABLE ( ifstream &  ifs,
const string &  tabName 
)

Input PVTtable and SATtable such as SWOF, PVCO.

TODO: Add Doxygen.

Definition at line 483 of file ParamReservoir.cpp.

484 {
485  TableSet* obj;
486  obj = FindPtr_T(tabName);
487  if (obj == nullptr) {
488  OCP_ABORT("Wrong table name :" + tabName);
489  }
490 
491  USI col = obj->colNum;
492  if (tabName == "ZMFVD") {
493  if (!comps) OCP_ABORT("COMPS isn't set correctly!");
494  obj->colNum = numCom + 1;
495  col = obj->colNum;
496  }
497  vector<vector<OCP_DBL>> tmpTab(col);
498 
499  vector<string> vbuf;
500  while (ReadLine(ifs, vbuf)) {
501  if (vbuf[0] == "/") break;
502 
503  for (USI i = 0; i < col; i++) {
504  tmpTab[i].push_back(stod(vbuf[i]));
505  }
506 
507  if (vbuf.back() == "/") {
508  obj->data.push_back(tmpTab);
509  for (USI j = 0; j < col; j++) {
510  tmpTab[j].clear();
511  }
512  }
513  }
514  if (!tmpTab[0].empty()) obj->data.push_back(tmpTab);
515 
516  obj->DisplayTable();
517 }
TableSet * FindPtr_T(const string &varName)
Find pointer to the specified table.
void DisplayTable() const
Print table.

References TableSet::colNum, comps, TableSet::data, TableSet::DisplayTable(), FindPtr_T(), numCom, OCP_ABORT, and ReadLine().

◆ InputTHCON()

void ParamReservoir::InputTHCON ( ifstream &  ifs,
const string &  keyword 
)

Input the phase ifThermal conductivity.

Read data from the THCONO, THCONG, THCONW.

Definition at line 700 of file ParamReservoir.cpp.

701 {
702  vector<string> vbuf;
703  ReadLine(ifs, vbuf);
704  if (keyword == "THCONO") {
705  thcono = stod(vbuf[0]);
706  } else if (keyword == "THCONG") {
707  thcong = stod(vbuf[0]);
708  } else if (keyword == "THCONW") {
709  thconw = stod(vbuf[0]);
710  }
711 
712  cout << "THCONO\n" << thcono << endl << endl;
713  cout << "THCONG\n" << thcong << endl << endl;
714  cout << "THCONW\n" << thconw << endl << endl;
715 }
OCP_DBL thconw
water ifThermal conductivity
OCP_DBL thcong
gas ifThermal conductivity
OCP_DBL thcono
oil ifThermal conductivity

References ReadLine(), thcong, thcono, and thconw.

◆ MultiplyVal()

void ParamReservoir::MultiplyVal ( vector< OCP_DBL > &  obj,
const OCP_DBL val,
const vector< USI > &  index 
)

TODO: Add Doxygen.

It's used in InputMULTIPLY, multipling the value of a certain range of a variable by a coefficient.

Definition at line 263 of file ParamReservoir.cpp.

266 {
267  USI Nx = dimens.nx;
268  USI Ny = dimens.ny;
269  OCP_USI NxNy = Nx * Ny;
270  OCP_USI id = 0;
271 
272  for (USI k = index[4]; k <= index[5]; k++) {
273  for (USI j = index[2]; j <= index[3]; j++) {
274  for (USI i = index[0]; i <= index[1]; i++) {
275  id = k * NxNy + j * Nx + i;
276  obj[id] *= val;
277  }
278  }
279  }
280 }

References dimens, Dimens::nx, and Dimens::ny.

◆ setVal()

template<typename T >
void ParamReservoir::setVal ( vector< T > &  obj,
const T &  val,
const vector< USI > &  index 
)

It's used in InputEQUALS, assigning values in batches.

TODO: Add Doxygen.

Definition at line 224 of file ParamReservoir.cpp.

225 {
226  USI Nx = dimens.nx;
227  USI Ny = dimens.ny;
228  OCP_USI NxNy = Nx * Ny;
229  OCP_USI id = 0;
230 
231  for (USI k = index[4]; k <= index[5]; k++) {
232  for (USI j = index[2]; j <= index[3]; j++) {
233  for (USI i = index[0]; i <= index[1]; i++) {
234  id = k * NxNy + j * Nx + i;
235  obj[id] = val;
236  }
237  }
238  }
239 }

References dimens, Dimens::nx, and Dimens::ny.

Member Data Documentation

◆ numCom

USI ParamReservoir::numCom

Number of components(hydrocarbon components), used in Compositional Model when input

Definition at line 285 of file ParamReservoir.hpp.


The documentation for this class was generated from the following files: