15 WellOptParam::WellOptParam(
string intype, vector<string>& vbuf)
22 if (vbuf[4] ==
"1*") {
26 cout <<
"### ERROR: Inj Rate is missing in WCONINJE!" << endl;
32 }
else if (
type ==
"PROD") {
35 if (vbuf[3] ==
"1*") {
39 cout <<
"### ERROR: Prod Rate is missing in WCONINJE!" << endl;
50 WellParam::WellParam(vector<string>& info)
53 if (info[1] !=
"DEFAULT")
group = info[1];
56 if (info[4] !=
"DEFAULT")
depth = stod(info[4]);
59 Solvent::Solvent(
const vector<string>& vbuf)
62 USI len = vbuf.size();
63 for (
USI i = 0; i < len - 1; i++) {
64 if (vbuf[i + 1] ==
"/")
break;
65 comRatio.push_back(stod(vbuf[i + 1]));
73 if (vbuf[0] ==
"/")
break;
78 cout <<
"WELSPECS" << endl;
86 if (vbuf[0] ==
"/")
break;
90 int pos = src.find(
"*");
91 bool match = (pos != string::npos);
97 for (
USI w = 0; w < num; w++) {
99 tmp = (
well[w].name.substr(0, pos) == src);
101 tmp = (
well[w].name == src);
105 USI k1 = stoi(vbuf[3]);
106 USI k2 = stoi(vbuf[4]);
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);
113 well[w].I_perf.push_back(stoi(vbuf[1]));
114 well[w].J_perf.push_back(stoi(vbuf[2]));
116 well[w].K_perf.push_back(k);
118 if (vbuf[5] !=
"DEFAULT")
119 well[w].WI.push_back(stod(vbuf[5]));
121 well[w].WI.push_back(-1.0);
123 if (vbuf[6] !=
"DEFAULT")
124 well[w].diameter.push_back(stod(vbuf[6]));
126 well[w].diameter.push_back(1.0);
128 if (vbuf[7] !=
"DEFAULT")
129 well[w].kh.push_back(stod(vbuf[7]));
131 well[w].kh.push_back(-1.0);
133 if (vbuf[8] !=
"DEFAULT")
134 well[w].skinFactor.push_back(stod(vbuf[8]));
136 well[w].skinFactor.push_back(0.0);
138 if (vbuf[9] !=
"DEFAULT")
139 well[w].direction.push_back(vbuf[9]);
141 well[w].direction.push_back(
"z");
146 cout <<
"COMPDAT" << endl;
157 if (vbuf[0] ==
"/")
break;
160 string src = vbuf[0];
161 int pos = src.find(
"*");
162 bool match = (pos != string::npos);
168 for (
USI w = 0; w < num; w++) {
169 if (
well[w].name.substr(0, pos) == src) {
174 for (
USI w = 0; w < num; w++) {
175 if (
well[w].name == src) {
181 cout <<
"WCONINJE" << endl;
192 if (vbuf[0] ==
"/")
break;
195 string src = vbuf[0];
196 int pos = src.find(
"*");
197 bool match = (pos != string::npos);
203 for (
USI w = 0; w < num; w++)
204 if (
well[w].name.substr(0, pos) == src)
207 for (
USI w = 0; w < num; w++)
208 if (
well[w].name == src)
212 cout <<
"WCONPROD" << endl;
221 if (vbuf[0] ==
"/")
break;
225 for (
OCP_INT i = 0; i < len - 1; i++) {
229 if (vbuf.back() !=
"/") {
244 if (vbuf[0] ==
"/")
break;
247 string src = vbuf[0];
248 int pos = src.find(
"*");
249 bool match = (pos != string::npos);
255 for (
USI w = 0; w < num; w++) {
257 tmp = (
well[w].name.substr(0, pos) == src);
259 tmp = (
well[w].name == src);
267 if (vbuf[1] ==
"BHP") {
268 if (tar.opt.
type ==
"INJ")
275 well[w].optParam.push_back(tar);
279 cout <<
"WELTARG" << endl;
286 if (vbuf[0] ==
"/")
break;
289 cout <<
"WELLSTRE" << endl;
301 void ParamWell::CheckINJFluid()
const
305 for (
USI w = 0; w < wellnum; w++) {
306 len =
well[w].optParam.size();
307 for (
USI i = 0; i < len; i++) {
309 if (tmpOpt.
type ==
"INJ") {
324 for (
USI w = 0; w < wellnum; w++) {
325 perfnum =
well[w].I_perf.size();
326 if (
well[w].J_perf.size() != perfnum) {
327 OCP_ABORT(
"Wrong perforation size J_perf!");
329 if (
well[w].K_perf.size() != perfnum) {
330 OCP_ABORT(
"Wrong perforation size K_perf!");
332 if (
well[w].diameter.size() != perfnum) {
333 OCP_ABORT(
"Wrong perforation diameter size!");
335 if (
well[w].WI.size() != perfnum) {
338 if (
well[w].kh.size() != perfnum) {
341 if (
well[w].skinFactor.size() != perfnum) {
342 OCP_ABORT(
"Wrong perforation skinFactor size!");
344 if (
well[w].direction.size() != perfnum) {
345 OCP_ABORT(
"Wrong perforation direction size!");
unsigned int USI
Generic unsigned integer.
double OCP_DBL
Double precision.
ParamWell class declaration.
Logging error and warning messages.
#define OCP_ABORT(msg)
Abort if critical error happens.
void InputWCONPROD(ifstream &ifs)
void InputWELLSTRE(ifstream &ifs)
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.
void CheckParam(const bool &boModel) const
Check if wrong params are input.
vector< OCP_DBL > criticalTime
Records the critical time given by users.
void InputWCONINJE(ifstream &ifs)
void InputCOMPDAT(ifstream &ifs)
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 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.