14 WellOptParam::WellOptParam(
string intype, vector<string>& vbuf)
21 if (vbuf[4] ==
"1*") {
25 cout <<
"### ERROR: Inj Rate is missing in WCONINJE!" << endl;
31 }
else if (
type ==
"PROD") {
34 if (vbuf[3] ==
"1*") {
38 cout <<
"### ERROR: Prod Rate is missing in WCONINJE!" << endl;
49 WellParam::WellParam(vector<string>& info)
52 if (info[1] !=
"DEFAULT")
group = info[1];
55 if (info[4] !=
"DEFAULT")
depth = stod(info[4]);
58 Solvent::Solvent(
const vector<string>& vbuf)
61 USI len = vbuf.size();
62 for (
USI i = 0; i < len - 1; i++) {
63 if (vbuf[i + 1] ==
"/")
break;
64 comRatio.push_back(stod(vbuf[i + 1]));
72 if (vbuf[0] ==
"/")
break;
85 if (vbuf[0] ==
"/")
break;
89 string::size_type pos = src.find(
"*");
90 OCP_BOOL match = (pos != string::npos);
96 for (
USI w = 0; w < num; w++) {
98 tmp = (
well[w].name.substr(0, pos) == src);
100 tmp = (
well[w].name == src);
104 USI k1 = stoi(vbuf[3]);
105 USI k2 = stoi(vbuf[4]);
107 for (
USI k = k1; k <= k2; k++) {
108 if (vbuf[1] ==
"DEFAULT" || vbuf[2] ==
"DEFAULT") {
109 well[w].I_perf.push_back(
well[w].I);
110 well[w].J_perf.push_back(
well[w].J);
112 well[w].I_perf.push_back(stoi(vbuf[1]));
113 well[w].J_perf.push_back(stoi(vbuf[2]));
115 well[w].K_perf.push_back(k);
117 if (vbuf[5] !=
"DEFAULT")
118 well[w].WI.push_back(stod(vbuf[5]));
120 well[w].WI.push_back(-1.0);
122 if (vbuf[6] !=
"DEFAULT")
123 well[w].diameter.push_back(stod(vbuf[6]));
125 well[w].diameter.push_back(1.0);
127 if (vbuf[7] !=
"DEFAULT")
128 well[w].kh.push_back(stod(vbuf[7]));
130 well[w].kh.push_back(-1.0);
132 if (vbuf[8] !=
"DEFAULT")
133 well[w].skinFactor.push_back(stod(vbuf[8]));
135 well[w].skinFactor.push_back(0.0);
137 if (vbuf[9] !=
"DEFAULT")
138 well[w].direction.push_back(vbuf[9]);
140 well[w].direction.push_back(
"z");
156 if (vbuf[0] ==
"/")
break;
159 string src = vbuf[0];
160 string::size_type pos = src.find(
"*");
161 const OCP_BOOL fuzzyMatch = (pos != string::npos);
167 for (
USI w = 0; w < num; w++) {
168 if (
well[w].name.find(src) != string::npos) {
173 for (
USI w = 0; w < num; w++) {
174 if (
well[w].name == src) {
191 if (vbuf[0] ==
"/")
break;
194 string src = vbuf[0];
195 string::size_type pos = src.find(
"*");
196 const OCP_BOOL fuzzyMatch = (pos != string::npos);
202 for (
USI w = 0; w < num; w++)
203 if (
well[w].name.find(src) != string::npos)
206 for (
USI w = 0; w < num; w++)
207 if (
well[w].name == src)
220 if (vbuf[0] ==
"/")
break;
224 for (
OCP_INT i = 0; i < len - 1; i++) {
228 if (vbuf.back() !=
"/") {
239 cout <<
"\n---------------------" << endl
241 <<
"\n---------------------" << endl;
247 if (vbuf[0] ==
"/")
break;
249 for (
const auto& s : vbuf) {
254 string src = vbuf[0];
255 string::size_type pos = src.find(
"*");
256 const OCP_BOOL fuzzyMatch = (pos != string::npos);
262 for (
USI w = 0; w < num; w++) {
264 succMatch = (
well[w].name.find(src) != string::npos);
266 succMatch = (
well[w].name == src);
269 if (
well[w].optParam.size() == 0) {
270 OCP_ABORT(
"No Well Control Defined in Advance!");
276 if (vbuf[1] ==
"BHP") {
277 if (tar.opt.
type ==
"INJ")
284 well[w].optParam.push_back(tar);
294 cout <<
"\n---------------------" << endl
296 <<
"\n---------------------" << endl;
299 const USI numWell =
well.size();
302 if (vbuf[0] ==
"/")
break;
304 for (
const auto& s : vbuf) {
309 string src = vbuf[0];
310 string::size_type pos = src.find(
"*");
311 const OCP_BOOL fuzzyMatch = (pos != string::npos);
317 for (
USI w = 0; w < numWell; w++) {
319 succMatch = (
well[w].name.find(src) != string::npos);
321 succMatch = (
well[w].name == src);
324 if (
well[w].optParam.size() == 0) {
325 OCP_ABORT(
"No Well Control Defined in Advance!");
329 tar.opt.
injTemp = stod(vbuf[1]);
330 well[w].optParam.push_back(tar);
340 cout <<
"\n---------------------" << endl
342 <<
"\n---------------------" << endl;
347 if (vbuf[0] ==
"/")
break;
349 for (
const auto& s : vbuf) {
355 string src = vbuf[0];
356 string::size_type pos = src.find(
"*");
357 const OCP_BOOL fuzzyMatch = (pos != string::npos);
363 for (
USI w = 0; w < num; w++)
364 if (
well[w].name.find(src) != string::npos)
365 well[w].ifUseUnweight = OCP_TRUE;
367 for (
USI w = 0; w < num; w++)
368 if (
well[w].name == src)
well[w].ifUseUnweight = OCP_TRUE;
377 if (vbuf[0] ==
"/")
break;
388 Psurf = stod(vbuf[0]);
390 cout <<
"\n---------------------" << endl
392 <<
"\n---------------------" << endl;
393 cout <<
Psurf << endl;
401 Tsurf = stod(vbuf[0]);
403 cout <<
"\n---------------------" << endl
405 <<
"\n---------------------" << endl;
406 cout <<
Tsurf << endl;
418 void ParamWell::CheckINJFluid()
const
422 for (
USI w = 0; w < wellnum; w++) {
423 len =
well[w].optParam.size();
424 for (
USI i = 0; i < len; i++) {
426 if (tmpOpt.
type ==
"INJ") {
441 for (
USI w = 0; w < wellnum; w++) {
442 perfnum =
well[w].I_perf.size();
443 if (
well[w].J_perf.size() != perfnum) {
444 OCP_ABORT(
"Wrong perforation size J_perf!");
446 if (
well[w].K_perf.size() != perfnum) {
447 OCP_ABORT(
"Wrong perforation size K_perf!");
449 if (
well[w].diameter.size() != perfnum) {
450 OCP_ABORT(
"Wrong perforation diameter size!");
452 if (
well[w].WI.size() != perfnum) {
455 if (
well[w].kh.size() != perfnum) {
458 if (
well[w].skinFactor.size() != perfnum) {
459 OCP_ABORT(
"Wrong perforation skinFactor size!");
461 if (
well[w].direction.size() != perfnum) {
462 OCP_ABORT(
"Wrong perforation direction size!");
unsigned int USI
Generic unsigned integer.
double OCP_DBL
Double precision.
unsigned int OCP_BOOL
OCP_BOOL in OCP.
ParamWell class declaration.
#define OCP_ABORT(msg)
Abort if critical error happens.
void InputWTEMP(ifstream &ifs)
Input the temperature of injected fluid.
void InputWCONPROD(ifstream &ifs)
void InputPSURF(ifstream &ifs)
Input surface pressure.
void InputWELLSTRE(ifstream &ifs)
OCP_DBL Psurf
Pressure in surface condition.
void InputWELSPECS(ifstream &ifs)
vector< Solvent > solSet
Sets of Solvent.
void InputWELTARG(ifstream &ifs)
void InputTSTEP(ifstream &ifs)
void CheckPerf() const
Check if params of Perforation is wrong.
vector< OCP_DBL > criticalTime
Records the critical time given by users.
void InputWCONINJE(ifstream &ifs)
OCP_DBL Tsurf
Temperature in surface condition.
void InputUNWEIGHT(ifstream &ifs)
Input injector type – MOBWEIGHT(defaulted) or UNWEIGHT.
void InputTSURF(ifstream &ifs)
Input surface temperature.
void InputCOMPDAT(ifstream &ifs)
void CheckParam(const OCP_BOOL &boModel) const
Check if wrong params are input.
vector< WellParam > well
Contains all the information of wells.
Describe the molar fraction of components of fluid injected to reservoir from INJ.
OCP_DBL maxBHP
Maximum allowable pressure in the injection well.
string type
Type of well, injection or production?
string fluidType
Type of fluid into the injection well. (injection well only)
OCP_DBL injTemp
Temperature of injected fluid.
OCP_DBL maxRate
Maximum allowable flow rate into/out the well.
string optMode
Mode of well, Rate or BHP?
OCP_DBL minBHP
Minimum allowable pressure in the production well.
string state
State of well, open or close?
OCP_DBL depth
Depth of well.
string group
Group the well belongs to.