OpenCAEPoro  0.2.0 Sep/22/2022
A simulator for multicomponent porous media flow
Public Member Functions | Public Attributes | List of all members
ParamWell Class Reference

#include <ParamWell.hpp>

Public Member Functions

void Init ()
 Initialize the inputting the params of wells.
 
void InitTime ()
 Initialize the critical time.
 
void InputWELSPECS (ifstream &ifs)
 
void InputCOMPDAT (ifstream &ifs)
 
void InputWCONINJE (ifstream &ifs)
 
void InputWCONPROD (ifstream &ifs)
 
void InputTSTEP (ifstream &ifs)
 
void InputWELTARG (ifstream &ifs)
 
void InputWELLSTRE (ifstream &ifs)
 
void CheckParam (const bool &boModel) const
 Check if wrong params are input.
 
void CheckPerf () const
 Check if params of Perforation is wrong.
 
void CheckINJFluid () const
 

Public Attributes

vector< WellParamwell
 Contains all the information of wells.
 
vector< OCP_DBLcriticalTime
 Records the critical time given by users.
 
vector< SolventsolSet
 Sets of Solvent.
 

Detailed Description

ParamWell is an internal structure used to stores the information of 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 100 of file ParamWell.hpp.

Member Function Documentation

◆ InputCOMPDAT()

void ParamWell::InputCOMPDAT ( ifstream &  ifs)

Input the well keyword COMPDAT. COMPDAT contains the information of perforations of wells, for example the location, the trans or directions.

Definition at line 81 of file ParamWell.cpp.

82 {
83  USI num = well.size();
84  vector<string> vbuf;
85  while (ReadLine(ifs, vbuf)) {
86  if (vbuf[0] == "/") break;
87 
88  DealDefault(vbuf);
89  string src = vbuf[0];
90  int pos = src.find("*");
91  bool match = (pos != string::npos);
92  if (match) {
93  src.erase(pos);
94  }
95  bool tmp = false;
96 
97  for (USI w = 0; w < num; w++) {
98  if (match)
99  tmp = (well[w].name.substr(0, pos) == src);
100  else
101  tmp = (well[w].name == src);
102 
103  if (tmp) {
104 
105  USI k1 = stoi(vbuf[3]);
106  USI k2 = stoi(vbuf[4]);
107 
108  for (USI k = k1; k <= k2; k++) {
109  if (vbuf[1] == "DEFAULT" || vbuf[2] == "DEFAULT") {
110  well[w].I_perf.push_back(well[w].I);
111  well[w].J_perf.push_back(well[w].J);
112  } else {
113  well[w].I_perf.push_back(stoi(vbuf[1]));
114  well[w].J_perf.push_back(stoi(vbuf[2]));
115  }
116  well[w].K_perf.push_back(k);
117 
118  if (vbuf[5] != "DEFAULT")
119  well[w].WI.push_back(stod(vbuf[5]));
120  else
121  well[w].WI.push_back(-1.0);
122 
123  if (vbuf[6] != "DEFAULT")
124  well[w].diameter.push_back(stod(vbuf[6]));
125  else
126  well[w].diameter.push_back(1.0);
127 
128  if (vbuf[7] != "DEFAULT")
129  well[w].kh.push_back(stod(vbuf[7]));
130  else
131  well[w].kh.push_back(-1.0);
132 
133  if (vbuf[8] != "DEFAULT")
134  well[w].skinFactor.push_back(stod(vbuf[8]));
135  else
136  well[w].skinFactor.push_back(0.0);
137 
138  if (vbuf[9] != "DEFAULT")
139  well[w].direction.push_back(vbuf[9]);
140  else
141  well[w].direction.push_back("z");
142  }
143  }
144  }
145  }
146  cout << "COMPDAT" << endl;
147 }
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:22
void DealDefault(vector< string > &result)
Definition: UtilInput.cpp:50
bool ReadLine(ifstream &ifs, vector< string > &result)
Definition: UtilInput.cpp:14
vector< WellParam > well
Contains all the information of wells.
Definition: ParamWell.hpp:103

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

◆ InputTSTEP()

void ParamWell::InputTSTEP ( ifstream &  ifs)

Input the keyword: TSTEP. TSTEP is used to divide the simulation time and ususally the time point is critical, at which for example, the operation mode of well will change. So the params of solving equations could be adjusted correspondingly.

Definition at line 215 of file ParamWell.cpp.

216 {
217  assert(criticalTime.size() > 0);
218 
219  vector<string> vbuf;
220  while (ReadLine(ifs, vbuf)) {
221  if (vbuf[0] == "/") break;
222 
223  DealDefault(vbuf);
224  OCP_INT len = vbuf.size();
225  for (OCP_INT i = 0; i < len - 1; i++) {
226  OCP_DBL t = criticalTime.back() + stod(vbuf[i]);
227  criticalTime.push_back(t);
228  }
229  if (vbuf.back() != "/") {
230  OCP_DBL t = criticalTime.back() + stod(vbuf.back());
231  criticalTime.push_back(t);
232  }
233  }
234 }
double OCP_DBL
Double precision.
Definition: OCPConst.hpp:26
int OCP_INT
Long integer.
Definition: OCPConst.hpp:25
vector< OCP_DBL > criticalTime
Records the critical time given by users.
Definition: ParamWell.hpp:104

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

◆ InputWCONINJE()

void ParamWell::InputWCONINJE ( ifstream &  ifs)

Input the well keyword WCONINJE. WCONINJE describes the initial operation mode of injection well.

Definition at line 149 of file ParamWell.cpp.

150 {
151  assert(criticalTime.size() > 0);
152 
153  USI d = criticalTime.size() - 1;
154  USI num = well.size();
155  vector<string> vbuf;
156  while (ReadLine(ifs, vbuf)) {
157  if (vbuf[0] == "/") break;
158 
159  DealDefault(vbuf);
160  string src = vbuf[0];
161  int pos = src.find("*");
162  bool match = (pos != string::npos);
163  if (match) {
164  src.erase(pos);
165  }
166 
167  if (match) {
168  for (USI w = 0; w < num; w++) {
169  if (well[w].name.substr(0, pos) == src) {
170  well[w].optParam.push_back(WellOptPair(d, "INJ", vbuf));
171  }
172  }
173  } else {
174  for (USI w = 0; w < num; w++) {
175  if (well[w].name == src) {
176  well[w].optParam.push_back(WellOptPair(d, "INJ", vbuf));
177  }
178  }
179  }
180  }
181  cout << "WCONINJE" << endl;
182 }

References criticalTime, DealDefault(), ReadLine(), and well.

◆ InputWCONPROD()

void ParamWell::InputWCONPROD ( ifstream &  ifs)

Input the well keyword WCONPROD. WCONPROD describes the initial operation mode of production well.

Definition at line 184 of file ParamWell.cpp.

185 {
186  assert(criticalTime.size() > 0);
187 
188  USI d = criticalTime.size() - 1;
189  USI num = well.size();
190  vector<string> vbuf;
191  while (ReadLine(ifs, vbuf)) {
192  if (vbuf[0] == "/") break;
193 
194  DealDefault(vbuf);
195  string src = vbuf[0];
196  int pos = src.find("*");
197  bool match = (pos != string::npos);
198  if (match) {
199  src.erase(pos);
200  }
201 
202  if (match) {
203  for (USI w = 0; w < num; w++)
204  if (well[w].name.substr(0, pos) == src)
205  well[w].optParam.push_back(WellOptPair(d, "PROD", vbuf));
206  } else {
207  for (USI w = 0; w < num; w++)
208  if (well[w].name == src)
209  well[w].optParam.push_back(WellOptPair(d, "PROD", vbuf));
210  }
211  }
212  cout << "WCONPROD" << endl;
213 }

References criticalTime, DealDefault(), ReadLine(), and well.

◆ InputWELLSTRE()

void ParamWell::InputWELLSTRE ( ifstream &  ifs)

Input well keyword: Solvent. It describes the molar fraction of components of fluid injected to reservoir from INJ.

Definition at line 282 of file ParamWell.cpp.

283 {
284  vector<string> vbuf;
285  while (ReadLine(ifs, vbuf)) {
286  if (vbuf[0] == "/") break;
287  solSet.push_back(Solvent(vbuf));
288  }
289  cout << "WELLSTRE" << endl;
290 }
vector< Solvent > solSet
Sets of Solvent.
Definition: ParamWell.hpp:105
Describe the molar fraction of components of fluid injected to reservoir from INJ.
Definition: ParamWell.hpp:88

References ReadLine(), and solSet.

◆ InputWELSPECS()

void ParamWell::InputWELSPECS ( ifstream &  ifs)

Input the well keyword WELSPECS. WELSPECS defines wells including well name, well location, well depth and son on.

Definition at line 69 of file ParamWell.cpp.

70 {
71  vector<string> vbuf;
72  while (ReadLine(ifs, vbuf)) {
73  if (vbuf[0] == "/") break;
74 
75  DealDefault(vbuf);
76  well.push_back(WellParam(vbuf));
77  }
78  cout << "WELSPECS" << endl;
79 }
TODO: Add Doxygen.
Definition: ParamWell.hpp:61

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

◆ InputWELTARG()

void ParamWell::InputWELTARG ( ifstream &  ifs)

Input the well keyword: WELTARG. WELTARG is used to change the opeartion mode of well anytime. For example, the oil production rate is changed from 1000 stb/day to 1500 stb/day at the 100th day.

Definition at line 236 of file ParamWell.cpp.

237 {
238  assert(criticalTime.size() > 0);
239 
240  USI d = criticalTime.size() - 1;
241  USI num = well.size();
242  vector<string> vbuf;
243  while (ReadLine(ifs, vbuf)) {
244  if (vbuf[0] == "/") break;
245 
246  DealDefault(vbuf);
247  string src = vbuf[0];
248  int pos = src.find("*");
249  bool match = (pos != string::npos);
250  if (match) {
251  src.erase(pos);
252  }
253  bool tmp = false;
254 
255  for (USI w = 0; w < num; w++) {
256  if (match)
257  tmp = (well[w].name.substr(0, pos) == src);
258  else
259  tmp = (well[w].name == src);
260 
261  if (tmp) {
262 
263  WellOptPair tar = well[w].optParam.back();
264  tar.d = d;
265  tar.opt.optMode = vbuf[1];
266  OCP_DBL val = stod(vbuf[2]);
267  if (vbuf[1] == "BHP") {
268  if (tar.opt.type == "INJ")
269  tar.opt.maxBHP = val;
270  else
271  tar.opt.minBHP = val;
272  } else {
273  tar.opt.maxRate = val;
274  }
275  well[w].optParam.push_back(tar);
276  }
277  }
278  }
279  cout << "WELTARG" << endl;
280 }
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
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

References criticalTime, DealDefault(), WellOptParam::maxBHP, WellOptParam::maxRate, WellOptParam::minBHP, WellOptParam::optMode, ReadLine(), WellOptParam::type, and well.


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