OpenCAEPoro  v0.5.0
A simulator for multicomponent porous media flow
Bulk.hpp
Go to the documentation of this file.
1 
12 #ifndef __BULK_HEADER__
13 #define __BULK_HEADER__
14 
15 // Standard header files
16 #include <iostream>
17 #include <vector>
18 
19 // OpenCAEPoro header files
20 #include "DenseMat.hpp"
21 #include "FlowUnit.hpp"
22 #include "Grid.hpp"
23 #include "LinearSystem.hpp"
24 #include "Mixture.hpp"
25 #include "MixtureBO.hpp"
26 #include "MixtureComp.hpp"
27 #include "MixtureThermal.hpp"
28 #include "OCPConst.hpp"
29 #include "OCPStructure.hpp"
30 #include "ParamReservoir.hpp"
31 #include "Rock.hpp"
32 
33 using namespace std;
34 
36 // General Error Yype
38 
39 const int BULK_SUCCESS = 0;
40 const int BULK_NEGATIVE_PRESSURE = -1;
41 const int BULK_NEGATIVE_TEMPERATURE = -2;
42 const int BULK_NEGATIVE_COMPONENTS_MOLES = -3;
43 const int BULK_OUTRANGED_VOLUME_ERROR = -4;
44 const int BULK_OUTRANGED_CFL = -5;
45 
47 // Note: This class includes reference depth and pressure at it, depth of contacts
48 // between phases, and capillary pressure at phase contact surfaces.
50 {
51  friend class Bulk;
52 
53 private:
54  OCP_DBL Dref;
55  OCP_DBL Pref;
56  OCP_DBL DOWC;
57  OCP_DBL DGOC;
58  OCP_DBL PcOW;
59  OCP_DBL PcGO;
60  OCPTable PBVD;
61 };
62 
63 class HeatLoss
64 {
65 public:
66  void InputParam(const HLoss& loss);
67  void Setup(const OCP_USI& nb);
68  OCP_BOOL IfHeatLoss() const { return ifHLoss; }
69  void CalHeatLoss(const vector<USI>& location,
70  const vector<OCP_DBL>& T,
71  const vector<OCP_DBL>& lT,
72  const vector<OCP_DBL>& initT,
73  const OCP_DBL& t,
74  const OCP_DBL& dt);
75  void ResetToLastTimeStep();
76  void UpdateLastTimeStep();
77 
78 public:
79  OCP_BOOL ifHLoss{OCP_FALSE};
84 
88  vector<OCP_DBL> I;
89  vector<OCP_DBL> p;
90  vector<OCP_DBL> pT;
91 
92  vector<OCP_DBL> lI;
93  vector<OCP_DBL> lp;
94  vector<OCP_DBL> lpT;
95 };
96 
98 // Note: Bulk contains main physical infomation of active grids. It describes the
99 // actual geometric domain for simulating. Variables are stored bulk by bulk, and then
100 // phase by phase, then component by component. The bulks are ordered in the alphabetic
101 // order, i.e. the X-axis indices first, followed by the Y-axis and Z-axis indices.
102 // Operations on each bulk are also defined here.
103 class Bulk
104 {
105  friend class BulkConn;
106  friend class Well;
107  friend class Out4RPT;
108  friend class Out4VTK;
109 
110  // temp
111  friend class Reservoir;
112  friend class IsothermalMethod;
113  friend class IsoT_IMPEC;
114  friend class IsoT_FIM;
115  friend class IsoT_FIMn;
116  friend class IsoT_AIMc;
117  friend class T_FIM;
118 
120  // Input Param and Setup
122 
123 public:
125  void InputParam(const ParamReservoir& rs_param);
126  void InputParamBLKOIL(const ParamReservoir& rs_param);
127  void InputParamCOMPS(const ParamReservoir& rs_param);
128  void InputParamTHERMAL(const ParamReservoir& rs_param);
129  void InputSatFunc(const ParamReservoir& rs_param);
130  void InputRockFunc(const ParamReservoir& rs_param);
131  void InputRockFuncT(const ParamReservoir& rs_param);
132 
134  void SetupIsoT(const Grid& myGrid);
136  void SetupT(const Grid& myGrid);
138  void SetupOptionalFeatures(const Grid& myGrid, OptionalFeatures& optFeatures);
139 
141  // General Variables
143 
144 public:
146  OCP_USI GetBulkNum() const { return numBulk; }
148  USI GetPhaseNum() const { return numPhase; }
150  USI GetComNum() const { return numCom; }
151 
152 protected:
157 
159  // Initial Properties
161 public:
163  void InitPTSw(const USI& tabrow);
164 
165 protected:
166  vector<OCPTable>
168  vector<OCPTable> initT_Tab;
169  vector<OCP_DBL> initT;
172  vector<OCP_DBL> thconp;
173 
175  // Region
177 
178 public:
180  void AllocateRegion(const Grid& myGrid);
182  void SetupBulkType(const Grid& myGrid);
184  const vector<Mixture*>& GetMixture() const { return flashCal; }
186  void OutMixtureIters() const { flashCal[0]->OutMixtureIters(); }
187 
188 protected:
191  vector<USI> PVTNUM;
192  vector<Mixture*> flashCal;
193 
196  vector<USI> SATNUM;
197  vector<FlowUnit*> flow;
198  vector<vector<OCP_DBL>>
200 
202  vector<USI> ROCKNUM;
203  vector<Rock*> rock;
204 
205  vector<USI> bType;
206  vector<USI> bLocation;
208 
210  // Basic PVT Model Information
212 
213 public:
215  OCP_BOOL IfUseEoS() const { return ifUseEoS; };
216 
217 protected:
218  OCP_BOOL ifBlackOil{OCP_FALSE};
219  OCP_BOOL ifComps{OCP_FALSE};
220  OCP_BOOL ifThermal{OCP_FALSE};
221  OCP_BOOL ifUseEoS{OCP_FALSE};
222  OCP_BOOL oil{OCP_FALSE};
223  OCP_BOOL gas{OCP_FALSE};
224  OCP_BOOL water{OCP_FALSE};
225  OCP_BOOL disGas{OCP_FALSE};
226 
228  // Basic Grid and Basic Rock Information
230 
231 public:
233  void AllocateGridRockIsoT(const Grid& myGrid);
234  void AllocateGridRockT(const Grid& myGrid);
235 
236 protected:
237  vector<OCP_DBL> dx;
238  vector<OCP_DBL> dy;
239  vector<OCP_DBL> dz;
240  vector<OCP_DBL> v;
241  vector<OCP_DBL> depth;
242 
243  vector<OCP_DBL> ntg;
244  vector<OCP_DBL> poroInit;
245  vector<OCP_DBL> poro;
246  vector<OCP_DBL> rockVp;
247  vector<OCP_DBL> rockKx;
248  vector<OCP_DBL> rockKy;
249  vector<OCP_DBL> rockKz;
250  vector<OCP_DBL> thconr;
251  vector<OCP_DBL> vr;
252  vector<OCP_DBL> Hr;
253 
254  // Last time step
255  vector<OCP_DBL> lporo;
256  vector<OCP_DBL> lrockVp;
257  vector<OCP_DBL> lvr;
258  vector<OCP_DBL> lHr;
259 
260  // Derivatives
261  vector<OCP_DBL> poroP;
262  vector<OCP_DBL> poroT;
263  vector<OCP_DBL> vrP;
264  vector<OCP_DBL> vrT;
265  vector<OCP_DBL> HrT;
266 
267  // Last time step
268  vector<OCP_DBL> lporoP;
269  vector<OCP_DBL> lporoT;
270  vector<OCP_DBL> lvrP;
271  vector<OCP_DBL> lvrT;
272  vector<OCP_DBL> lHrT;
273 
275  // Basic Fluid Information
277 
278 public:
280  OCP_DBL CalFPR() const;
282  OCP_DBL CalFTR() const;
284  OCP_DBL GetP(const OCP_USI& n) const { return P[n]; }
286  OCP_DBL GetSOIL(const OCP_USI& n) const
287  {
288  return S[n * numPhase + phase2Index[OIL]];
289  }
291  OCP_DBL GetSGAS(const OCP_USI& n) const
292  {
293  return S[n * numPhase + phase2Index[GAS]];
294  }
296  OCP_DBL GetSWAT(const OCP_USI& n) const
297  {
298  return S[n * numPhase + phase2Index[WATER]];
299  }
300 
301 protected:
302  vector<USI> phase2Index;
303  // Note: For example, `Oil' is at the i-th location.
304  vector<USI> phaseNum;
305  vector<OCP_DBL> Nt;
306  vector<OCP_DBL> Ni;
307  vector<OCP_DBL> vf;
308  vector<OCP_DBL> T;
309  vector<OCP_DBL> P;
310  vector<OCP_DBL> Pb;
311  vector<OCP_DBL> Pj;
312  vector<OCP_DBL> Pc;
313  vector<OCP_BOOL> phaseExist;
314  vector<OCP_DBL> S;
315  vector<OCP_DBL> vj;
316  vector<OCP_DBL> nj;
317  vector<OCP_DBL> xij;
318  vector<OCP_DBL> rho;
319  vector<OCP_DBL> xi;
320  vector<OCP_DBL> mu;
321  vector<OCP_DBL> kr;
322  vector<OCP_DBL> Uf;
323  vector<OCP_DBL> H;
324  vector<OCP_DBL> kt;
325 
326  // Last time step
327  vector<USI> lphaseNum;
328  vector<OCP_DBL> lNt;
329  vector<OCP_DBL> lNi;
330  vector<OCP_DBL> lvf;
331  vector<OCP_DBL> lT;
332  vector<OCP_DBL> lP;
333  vector<OCP_DBL> lPj;
334  vector<OCP_DBL> lPc;
335  vector<OCP_BOOL> lphaseExist;
336  vector<OCP_DBL> lS;
337  vector<OCP_DBL> lvj;
338  vector<OCP_DBL> lnj;
339  vector<OCP_DBL> lxij;
340  vector<OCP_DBL> lrho;
341  vector<OCP_DBL> lxi;
342  vector<OCP_DBL> lmu;
343  vector<OCP_DBL> lkr;
344  vector<OCP_DBL> lUf;
345  vector<OCP_DBL> lH;
346  vector<OCP_DBL> lkt;
347 
348  // Derivatives
349  vector<OCP_DBL> vfP;
350  vector<OCP_DBL> vfT;
351  vector<OCP_DBL> vfi;
352  vector<OCP_DBL> rhoP;
353  vector<OCP_DBL> rhoT;
354  vector<OCP_DBL> rhox;
355  vector<OCP_DBL> xiP;
356  vector<OCP_DBL> xiT;
357  vector<OCP_DBL> xix;
358  vector<OCP_DBL> muP;
359  vector<OCP_DBL> muT;
360  vector<OCP_DBL> mux;
361  vector<OCP_DBL> dPcj_dS;
362  vector<OCP_DBL> dKr_dS;
363  vector<OCP_DBL> UfP;
364  vector<OCP_DBL> UfT;
365  vector<OCP_DBL> Ufi;
366  vector<OCP_DBL> HT;
367  vector<OCP_DBL> Hx;
368  vector<OCP_DBL> ktP;
369  vector<OCP_DBL> ktT;
370  vector<OCP_DBL> ktS;
371 
372  // Last time step
373  vector<OCP_DBL> lvfP;
374  vector<OCP_DBL> lvfT;
375  vector<OCP_DBL> lvfi;
376  vector<OCP_DBL> lrhoP;
377  vector<OCP_DBL> lrhoT;
378  vector<OCP_DBL> lrhox;
379  vector<OCP_DBL> lxiP;
380  vector<OCP_DBL> lxiT;
381  vector<OCP_DBL> lxix;
382  vector<OCP_DBL> lmuP;
383  vector<OCP_DBL> lmuT;
384  vector<OCP_DBL> lmux;
385  vector<OCP_DBL> ldPcj_dS;
386  vector<OCP_DBL> ldKr_dS;
387  vector<OCP_DBL> lUfP;
388  vector<OCP_DBL> lUfT;
389  vector<OCP_DBL> lUfi;
390  vector<OCP_DBL> lHT;
391  vector<OCP_DBL> lHx;
392  vector<OCP_DBL> lktP;
393  vector<OCP_DBL> lktT;
394  vector<OCP_DBL> lktS;
395 
397  // Newton Iteration Information
399 
400 public:
402  OCP_DBL CalNRdSmax(OCP_USI& index);
404  OCP_DBL GetNRdPmax() const { return NRdPmax; };
406  OCP_DBL GetNRdNmax() const { return NRdNmax; };
407 
408 protected:
409  vector<OCP_DBL> dSNR;
410  vector<OCP_DBL> dSNRP;
411  vector<OCP_DBL> dNNR;
412  vector<OCP_DBL> dPNR;
413  vector<OCP_DBL> dTNR;
414 
421 
422  vector<OCP_DBL> NRstep;
423  vector<USI> NRphaseNum;
424 
426  // Important Indicator Variable and Check
428 
429 public:
431  OCP_INT CheckP() const;
433  OCP_INT CheckT() const;
435  OCP_INT CheckNi();
437  OCP_INT CheckVe(const OCP_DBL& Vlim) const;
439  OCP_INT CheckCFL(const OCP_DBL& cflLim) const;
440 
442  void CalMaxChange();
443 
445  OCP_DBL GetdPmax() const { return dPmax; }
447  OCP_DBL GetdTmax() const { return dTmax; }
449  OCP_DBL GetdNmax() const { return dNmax; }
451  OCP_DBL GetdSmax() const { return dSmax; }
453  OCP_DBL GeteVmax() const { return eVmax; }
455  OCP_DBL GetMaxCFL() const { return maxCFL; }
456 
457 protected:
464 
465  mutable vector<OCP_DBL> cfl;
466  mutable OCP_DBL maxCFL;
467 
469  // Error
471 
472 public:
473  void AllocateError();
474 
475 protected:
476  vector<OCP_DBL> ePEC;
477  mutable OCPRes res;
478 
479 protected:
481  // Method-Specified Variable
483 
485  vector<USI> bRowSizedSdP;
486  vector<OCP_DBL> dSec_dPri;
487  vector<OCP_BOOL> pSderExist;
488  vector<USI> pVnumCom;
489  vector<OCP_DBL> res_n;
490  vector<OCP_DBL> resPc;
491 
492  // Last time step
493  vector<USI> lbRowSizedSdP;
494  vector<OCP_DBL> ldSec_dPri;
495  vector<OCP_BOOL> lpSderExist;
496  vector<USI> lpVnumCom;
497  vector<OCP_DBL> lres_n;
498  vector<OCP_DBL> lresPc;
499 
500 public:
502  void ShowFIMBulk(const OCP_BOOL& flag = OCP_FALSE) const;
504  void AddWellBulkId(const OCP_USI& n) { wellBulkId.push_back(n); }
505 
506 protected:
507  vector<OCP_USI> wellBulkId;
510  {
511  public:
512  void Setup(const OCP_USI& nb) { indicator.resize(nb, -1); }
513  void Init() { fill(indicator.begin(), indicator.end(), -1); }
514  void SetBulkType(const OCP_USI& n, const OCP_INT& flag) { indicator[n] = flag; }
515  OCP_BOOL IfFIMbulk(const OCP_USI& n) const { return indicator[n] > 0; }
516  OCP_BOOL IfIMPECbulk(const OCP_USI& n) const { return indicator[n] < 0; }
517 
518  protected:
519  vector<OCP_INT> indicator;
521  } bulkTypeAIM;
522  vector<OCP_DBL> xijNR;
523 };
524 
525 #endif /* end if __BULK_HEADER__ */
526 
527 /*----------------------------------------------------------------------------*/
528 /* Brief Change History of This File */
529 /*----------------------------------------------------------------------------*/
530 /* Author Date Actions */
531 /*----------------------------------------------------------------------------*/
532 /* Shizhe Li Oct/01/2021 Create file */
533 /* Chensong Zhang Oct/15/2021 Format file */
534 /* Chensong Zhang Jan/09/2022 Update Doxygen */
535 /*----------------------------------------------------------------------------*/
Operations about small dense mat.
FlowUnit class declaration.
Grid class declaration.
Linear solver class declaration.
MixtureBO class declaration.
MixtureComp class declaration.
MixtureThermal class declaration.
Mixture class declaration.
Definition of build-in datatypes and consts.
unsigned int USI
Generic unsigned integer.
Definition: OCPConst.hpp:23
const USI GAS
Fluid type = gas.
Definition: OCPConst.hpp:92
double OCP_DBL
Double precision.
Definition: OCPConst.hpp:27
const USI WATER
Fluid type = water.
Definition: OCPConst.hpp:93
const USI OIL
Fluid type = oil.
Definition: OCPConst.hpp:91
unsigned int OCP_USI
Long unsigned integer.
Definition: OCPConst.hpp:25
int OCP_INT
Long integer.
Definition: OCPConst.hpp:26
unsigned int OCP_BOOL
OCP_BOOL in OCP.
Definition: OCPConst.hpp:29
Some Structure in OpenCAEPoro.
ParamReservoir class declaration.
Rock class declaration.
Properties and operations on connections between bulks (active grids).
Definition: BulkConn.hpp:71
vector< OCP_INT > indicator
Definition: Bulk.hpp:519
Physical information of each active reservoir bulk.
Definition: Bulk.hpp:104
vector< OCP_DBL > mu
Viscosity of phase: numPhase*numBulk.
Definition: Bulk.hpp:320
vector< USI > pVnumCom
num of variable components in the phase
Definition: Bulk.hpp:488
vector< OCP_DBL > dNNR
Ni change between NR steps.
Definition: Bulk.hpp:411
vector< OCP_DBL > lP
last P
Definition: Bulk.hpp:332
USI GetPhaseNum() const
Return the number of phases.
Definition: Bulk.hpp:148
vector< OCP_DBL > lS
last S
Definition: Bulk.hpp:336
vector< OCP_DBL > lkt
last kt
Definition: Bulk.hpp:346
vector< OCP_DBL > UfP
d Uf / d P: numbulk
Definition: Bulk.hpp:363
vector< OCP_DBL > NRstep
NRstep for FIM.
Definition: Bulk.hpp:422
vector< Rock * > rock
rock model
Definition: Bulk.hpp:203
vector< OCP_DBL > Pc
Capillary pressure of phase: numPhase*numBulk.
Definition: Bulk.hpp:312
vector< FlowUnit * > flow
Vector for capillary pressure, relative perm.
Definition: Bulk.hpp:197
vector< OCP_DBL > vrP
d vr / d p, numbulk
Definition: Bulk.hpp:263
vector< OCP_DBL > ldPcj_dS
last Pcj_dS
Definition: Bulk.hpp:385
USI NTSFUN
num of SAT regions
Definition: Bulk.hpp:194
vector< OCP_DBL > lNt
last Nt
Definition: Bulk.hpp:328
USI numPhase
Number of phase.
Definition: Bulk.hpp:154
vector< OCP_DBL > lvf
last vf
Definition: Bulk.hpp:330
vector< OCP_DBL > T
Temperature: numBulk.
Definition: Bulk.hpp:308
OCP_DBL eVmax
Definition: Bulk.hpp:462
vector< OCP_DBL > S
Saturation of phase: numPhase*numBulk.
Definition: Bulk.hpp:314
vector< USI > bLocation
Location of bulk: top, bottom, side.
Definition: Bulk.hpp:206
vector< OCP_DBL > lporoT
last poroT.
Definition: Bulk.hpp:269
vector< OCP_DBL > rho
Mass density of phase: numPhase*numBulk.
Definition: Bulk.hpp:318
OCP_DBL GeteVmax() const
Return eVmax.
Definition: Bulk.hpp:453
vector< OCP_DBL > kt
Coefficient of thermal diffusivity: activeGridNum.
Definition: Bulk.hpp:324
vector< OCP_DBL > ktP
d kt / d P: numbulk
Definition: Bulk.hpp:368
OCPRes res
Residual for all equations.
Definition: Bulk.hpp:477
vector< OCP_DBL > dSec_dPri
d Secondary variable / d Primary variable.
Definition: Bulk.hpp:486
OCP_DBL dSmax
Max change in saturation during the current time step.
Definition: Bulk.hpp:460
vector< OCP_DBL > lxij
last xij
Definition: Bulk.hpp:339
vector< OCP_DBL > rhoP
d Rho / d P: numPhase*numBulk.
Definition: Bulk.hpp:352
vector< OCP_DBL > ntg
net to gross of bulk.
Definition: Bulk.hpp:243
vector< OCP_DBL > dy
Size of cell in y-direction: activeGridNum.
Definition: Bulk.hpp:238
vector< OCP_DBL > lrho
last rho
Definition: Bulk.hpp:340
vector< USI > PVTNUM
Identify PVT region in black-oil model: numBulk.
Definition: Bulk.hpp:191
vector< USI > lphaseNum
last phaseNum
Definition: Bulk.hpp:327
vector< OCP_DBL > vfi
d vf / d Ni: numCom*numBulk.
Definition: Bulk.hpp:351
vector< OCP_DBL > lHrT
Last HrT.
Definition: Bulk.hpp:272
vector< OCP_DBL > lHx
last Hx
Definition: Bulk.hpp:391
vector< USI > lpVnumCom
last pVnumCom
Definition: Bulk.hpp:496
OCP_DBL maxCFL
max CFL number
Definition: Bulk.hpp:466
vector< OCP_DBL > poro
rock porosity * ntg.
Definition: Bulk.hpp:245
USI NTROCC
num of Rock regions
Definition: Bulk.hpp:201
vector< OCP_DBL > xij
Nij / Nj: numPhase*numCom*numBulk.
Definition: Bulk.hpp:317
vector< OCP_DBL > Ufi
d Uf / d Ni: numCom * numBulk
Definition: Bulk.hpp:365
vector< OCP_DBL > lrockVp
Pore volume: numBulk.
Definition: Bulk.hpp:256
vector< OCP_DBL > kr
Relative permeability of phase: numPhase*numBulk.
Definition: Bulk.hpp:321
vector< USI > SATNUM
Identify SAT region: numBulk.
Definition: Bulk.hpp:196
vector< OCP_DBL > depth
Depth of center of grid cells: activeGridNum.
Definition: Bulk.hpp:241
vector< OCP_DBL > rockVp
pore volume = Vgrid * ntg * poro.
Definition: Bulk.hpp:246
vector< OCP_DBL > Ni
Moles of component: numCom*numBulk.
Definition: Bulk.hpp:306
USI SATmode
Identify SAT mode.
Definition: Bulk.hpp:195
OCP_DBL NRdPmax
Max pressure difference in an NR step.
Definition: Bulk.hpp:417
vector< OCP_DBL > Pj
Pressure of phase: numPhase*numBulk.
Definition: Bulk.hpp:311
vector< OCP_DBL > mux
d Muj / d xij: numPhase*numCom*numBulk.
Definition: Bulk.hpp:360
vector< OCP_DBL > ePEC
error for fugacity balance equations, EoS only now
Definition: Bulk.hpp:476
USI NTPVT
num of PVT regions
Definition: Bulk.hpp:189
vector< OCP_DBL > rhox
d Rhoj / d xij: numPhase*numCom*numBulk.
Definition: Bulk.hpp:354
vector< OCP_DBL > lHr
Last Hr: activeGridNum.
Definition: Bulk.hpp:258
vector< OCP_DBL > lporoP
last poroP.
Definition: Bulk.hpp:268
vector< OCP_DBL > lUfP
last UfP
Definition: Bulk.hpp:387
OCP_USI index_maxNRdSSP
index of grid which has maxNRdSSP
Definition: Bulk.hpp:416
vector< OCP_DBL > lrhoT
last rhoT
Definition: Bulk.hpp:377
vector< OCP_DBL > lkr
last kr
Definition: Bulk.hpp:343
vector< OCP_DBL > dSNR
saturation change between NR steps
Definition: Bulk.hpp:406
vector< OCP_DBL > lvfi
last vfi
Definition: Bulk.hpp:375
vector< OCP_DBL > lporo
last poro.
Definition: Bulk.hpp:255
OCP_DBL maxNRdSSP
max difference between dSNR and dSNRP
Definition: Bulk.hpp:415
vector< OCP_DBL > lvj
last vj
Definition: Bulk.hpp:337
vector< OCP_DBL > vfT
d vf / d T, numBulk
Definition: Bulk.hpp:350
vector< OCP_DBL > lHT
last HT
Definition: Bulk.hpp:390
HeatLoss hLoss
Heat loss iterm.
Definition: Bulk.hpp:207
vector< OCP_DBL > lvfT
last vfT
Definition: Bulk.hpp:374
vector< OCP_DBL > lmuT
last muT
Definition: Bulk.hpp:383
vector< OCP_DBL > Nt
Total moles of components in bulks: numBulk.
Definition: Bulk.hpp:305
vector< OCP_DBL > muP
d Mu / d P: numPhase*numBulk.
Definition: Bulk.hpp:358
vector< OCP_DBL > Hx
d Hj / d xij: numPhase * numCom * numbulk
Definition: Bulk.hpp:367
vector< OCP_DBL > dz
Size of cell in z-direction: activeGridNum.
Definition: Bulk.hpp:239
vector< OCP_DBL > xiT
d xij / d T, numPhase * numbulk
Definition: Bulk.hpp:356
vector< OCP_DBL > poroT
d poro / d T.
Definition: Bulk.hpp:262
vector< OCP_DBL > thconr
Rock ifThermal conductivity: activeGridNum.
Definition: Bulk.hpp:250
vector< OCP_DBL > dKr_dS
d Krj / d Sk: numPhase * numPhase * bulk.
Definition: Bulk.hpp:362
vector< OCP_DBL > lT
last T
Definition: Bulk.hpp:331
vector< OCP_DBL > lUfT
last UfT
Definition: Bulk.hpp:388
vector< OCP_DBL > UfT
d Uf / d T: numbulk
Definition: Bulk.hpp:364
vector< Mixture * > flashCal
Flash calculation class.
Definition: Bulk.hpp:192
vector< USI > phase2Index
Location of phase according to its name: numPhase.
Definition: Bulk.hpp:302
OCP_DBL GetNRdPmax() const
Return NRdPmax.
Definition: Bulk.hpp:404
vector< OCP_BOOL > phaseExist
Existence of phase: numPhase*numBulk.
Definition: Bulk.hpp:313
vector< OCP_DBL > lktS
last ktS
Definition: Bulk.hpp:394
vector< OCP_DBL > lPj
last Pj
Definition: Bulk.hpp:333
OCP_DBL GetSOIL(const OCP_USI &n) const
Return oil saturation of the n-th bulk.
Definition: Bulk.hpp:286
vector< OCPTable > initZi_Tab
Initial mole ratio of components vs. depth, table set.
Definition: Bulk.hpp:167
vector< OCP_DBL > lUf
last Uf
Definition: Bulk.hpp:344
vector< OCP_DBL > lktT
last ktT
Definition: Bulk.hpp:393
vector< OCP_DBL > xiP
d xi / d P: numPhase*numBulk.
Definition: Bulk.hpp:355
vector< OCP_DBL > rhoT
d rhoj / d T: numPhase * numbulk
Definition: Bulk.hpp:353
vector< OCP_DBL > poroP
d poro / d P.
Definition: Bulk.hpp:261
const vector< Mixture * > & GetMixture() const
Return flash.
Definition: Bulk.hpp:184
vector< vector< OCP_DBL > > satcm
critical saturation when phase becomes mobile / immobile.
Definition: Bulk.hpp:199
vector< OCP_DBL > lvrP
last vrp.
Definition: Bulk.hpp:270
vector< OCP_DBL > lktP
last ktP
Definition: Bulk.hpp:392
vector< OCP_DBL > vrT
dvr / dT: activeGridNum.
Definition: Bulk.hpp:264
OCP_DBL GetMaxCFL() const
Return maxCFL.
Definition: Bulk.hpp:455
vector< OCP_DBL > ldKr_dS
last dKr_dS
Definition: Bulk.hpp:386
vector< OCP_DBL > Uf
Internal energy of fluid: numBulk.
Definition: Bulk.hpp:322
vector< OCP_DBL > lUfi
last Ufi
Definition: Bulk.hpp:389
vector< OCP_DBL > lrhoP
last rhoP
Definition: Bulk.hpp:376
vector< OCP_DBL > xi
Moles density of phase: numPhase*numBulk.
Definition: Bulk.hpp:319
OCP_DBL GetSWAT(const OCP_USI &n) const
Return water saturation of the n-th bulk.
Definition: Bulk.hpp:296
vector< OCP_DBL > lxi
last xi
Definition: Bulk.hpp:341
vector< OCP_DBL > lmux
last mux
Definition: Bulk.hpp:384
vector< OCP_DBL > vf
Total fluid volume: numBulk.
Definition: Bulk.hpp:307
vector< OCP_DBL > rockKz
current rock permeability along the z direction.
Definition: Bulk.hpp:249
OCP_DBL NRdTmax
Max temperature difference in an NR step.
Definition: Bulk.hpp:418
vector< USI > phaseNum
Num of hydrocarbon phase in each bulk.
Definition: Bulk.hpp:304
ParamEQUIL EQUIL
Initial Equilibration.
Definition: Bulk.hpp:170
OCP_DBL GetSGAS(const OCP_USI &n) const
Return gas saturation of the n-th bulk.
Definition: Bulk.hpp:291
vector< USI > bRowSizedSdP
length of dSec_dPri in each bulk
Definition: Bulk.hpp:485
vector< OCP_DBL > vfP
d vf / d P: numBulk.
Definition: Bulk.hpp:349
OCP_DBL GetNRdNmax() const
Return NRdNmax.
Definition: Bulk.hpp:406
OCP_DBL NRdNmax
Max Ni difference in an NR step.
Definition: Bulk.hpp:419
vector< OCP_DBL > lxiT
last xiT
Definition: Bulk.hpp:380
vector< OCPTable > initT_Tab
Initial temperature vs. depth, table set.
Definition: Bulk.hpp:168
OCP_DBL dNmax
Max change in moles of component during the current time step.
Definition: Bulk.hpp:461
vector< OCP_DBL > rockKx
current rock permeability along the x direction.
Definition: Bulk.hpp:247
OCP_DBL NRdSmax
Max saturation difference in an NR step(Real)
Definition: Bulk.hpp:420
vector< OCP_DBL > lres_n
last res_n
Definition: Bulk.hpp:497
vector< OCP_DBL > lxix
last xix
Definition: Bulk.hpp:381
OCP_DBL rsTemp
Reservoir temperature.
Definition: Bulk.hpp:171
vector< OCP_DBL > lresPc
last lresPc;
Definition: Bulk.hpp:498
OCP_DBL GetdSmax() const
Return dSmax.
Definition: Bulk.hpp:451
vector< USI > bType
Indicate bulk type, 0: rock, 1: rock and fluid.
Definition: Bulk.hpp:205
OCP_BOOL IfUseEoS() const
Return ifUseEoS.
Definition: Bulk.hpp:215
USI PVTmodeB
Identify PVT mode in black-oil model.
Definition: Bulk.hpp:190
vector< OCP_DBL > rockKy
current rock permeability along the y direction.
Definition: Bulk.hpp:248
vector< OCP_DBL > dPNR
P change between NR steps.
Definition: Bulk.hpp:412
vector< OCP_USI > wellBulkId
Definition: Bulk.hpp:507
vector< OCP_DBL > vj
Volume of phase: numPhase*numBulk.
Definition: Bulk.hpp:315
vector< OCP_DBL > lmuP
last muP
Definition: Bulk.hpp:382
OCP_DBL dTmax
Max change in temperature during the current time step.
Definition: Bulk.hpp:459
vector< OCP_DBL > ktT
d kt / d T: activeGridNum.
Definition: Bulk.hpp:369
vector< OCP_DBL > lvrT
Last vrT.
Definition: Bulk.hpp:271
vector< OCP_DBL > ktS
d kt / d S: numPhase * numbulk
Definition: Bulk.hpp:370
vector< OCP_DBL > muT
d muj / d T: numPhase * numbulk
Definition: Bulk.hpp:359
vector< OCP_DBL > lvfP
last vfP
Definition: Bulk.hpp:373
vector< OCP_DBL > Pb
Bubble point pressure: numBulk.
Definition: Bulk.hpp:310
vector< OCP_DBL > lrhox
last rhox
Definition: Bulk.hpp:378
vector< OCP_BOOL > lphaseExist
last phaseExist
Definition: Bulk.hpp:335
vector< OCP_DBL > Hr
Enthalpy of rock: activeGridNum.
Definition: Bulk.hpp:252
vector< OCP_DBL > v
Volume of grids: activeGridNum.
Definition: Bulk.hpp:240
USI numComH
Number of HydroCarbon.
Definition: Bulk.hpp:156
vector< OCP_DBL > dSNRP
predicted saturation change between NR steps
Definition: Bulk.hpp:410
vector< OCP_DBL > lxiP
last xiP
Definition: Bulk.hpp:379
vector< OCP_BOOL > lpSderExist
last pSderExist
Definition: Bulk.hpp:495
OCP_DBL GetdNmax() const
Return dNmax.
Definition: Bulk.hpp:449
vector< OCP_DBL > resPc
a precalculated value
Definition: Bulk.hpp:490
vector< OCP_DBL > HT
d Hj / d T: numPhase * numbulk
Definition: Bulk.hpp:366
vector< OCP_DBL > lmu
last mu
Definition: Bulk.hpp:342
vector< OCP_BOOL > pSderExist
Existence of derivative of phase saturation.
Definition: Bulk.hpp:487
OCP_DBL GetdPmax() const
Return dPmax.
Definition: Bulk.hpp:445
OCP_USI numBulk
Number of bulks (active grids).
Definition: Bulk.hpp:153
vector< USI > NRphaseNum
phaseNum in NR step
Definition: Bulk.hpp:423
vector< OCP_DBL > poroInit
initial rock porosity * ntg.
Definition: Bulk.hpp:244
vector< OCP_DBL > thconp
Phase thermal conductivity: numPhase.
Definition: Bulk.hpp:172
vector< OCP_DBL > ldSec_dPri
last dSec_dPri
Definition: Bulk.hpp:494
vector< OCP_DBL > xix
d Xi_j / d xij: numPhase*numCom*numBulk.
Definition: Bulk.hpp:357
OCP_DBL GetdTmax() const
Return dTmax.
Definition: Bulk.hpp:447
OCP_USI GetBulkNum() const
Return the number of bulks.
Definition: Bulk.hpp:146
vector< USI > ROCKNUM
index of Rock table for each bulk
Definition: Bulk.hpp:202
USI GetComNum() const
Return the number of components.
Definition: Bulk.hpp:150
vector< OCP_DBL > dx
Size of cell in x-direction: activeGridNum.
Definition: Bulk.hpp:237
OCP_DBL GetP(const OCP_USI &n) const
Return pressure of the n-th bulk.
Definition: Bulk.hpp:284
vector< OCP_DBL > H
Enthalpy of phase: numPhase*numBulk.
Definition: Bulk.hpp:323
vector< OCP_DBL > dTNR
T change between NR steps.
Definition: Bulk.hpp:413
vector< OCP_DBL > nj
moles number of phase: numPhase*numBulk.
Definition: Bulk.hpp:316
vector< OCP_DBL > dPcj_dS
d Pcj / d Sk: numPhase * numPhase * bulk.
Definition: Bulk.hpp:361
vector< OCP_DBL > HrT
dHr / dT: activeGridNum.
Definition: Bulk.hpp:265
vector< OCP_DBL > initT
Initial temperature of each bulk: numBulk.
Definition: Bulk.hpp:169
vector< OCP_DBL > res_n
residual for FIM_n
Definition: Bulk.hpp:489
vector< USI > lbRowSizedSdP
last bRowSizedSdP
Definition: Bulk.hpp:493
vector< OCP_DBL > xijNR
store the current NR step's xij in AIM
Definition: Bulk.hpp:522
void OutMixtureIters() const
Output iterations in Mixture.
Definition: Bulk.hpp:186
vector< OCP_DBL > vr
Volume of rock: activeGridNum.
Definition: Bulk.hpp:251
vector< OCP_DBL > P
Pressure: numBulk.
Definition: Bulk.hpp:309
vector< OCP_DBL > lNi
last Ni
Definition: Bulk.hpp:329
vector< OCP_DBL > lnj
last nj
Definition: Bulk.hpp:338
vector< OCP_DBL > cfl
CFL number for each bulk.
Definition: Bulk.hpp:465
vector< OCP_DBL > lPc
last Pc
Definition: Bulk.hpp:334
vector< OCP_DBL > lvr
Last vr: activeGridNum.
Definition: Bulk.hpp:257
USI maxLendSdP
length of dSec_dPri.
Definition: Bulk.hpp:484
USI numCom
Number of component.
Definition: Bulk.hpp:155
void AddWellBulkId(const OCP_USI &n)
push back an element for wellBulkId
Definition: Bulk.hpp:504
OCP_DBL dPmax
Max change in pressure during the current time step.
Definition: Bulk.hpp:458
vector< OCP_DBL > lH
last H
Definition: Bulk.hpp:345
Definition: Grid.hpp:89
vector< OCP_DBL > pT
dP / dT
Definition: Bulk.hpp:90
OCP_DBL ubD
Thermal diffusivity of underburden rock.
Definition: Bulk.hpp:87
OCP_DBL ubK
Thermal conductivity of underburden rock.
Definition: Bulk.hpp:83
vector< OCP_DBL > p
Auxiliary variable.
Definition: Bulk.hpp:89
OCP_DBL obC
Volumetric heat capacity of overburden rock.
Definition: Bulk.hpp:80
OCP_DBL obD
Thermal diffusivity of overburden rock.
Definition: Bulk.hpp:86
vector< OCP_DBL > lpT
last pT
Definition: Bulk.hpp:94
OCP_DBL obK
Thermal conductivity of overburden rock.
Definition: Bulk.hpp:81
vector< OCP_DBL > I
Auxiliary variable.
Definition: Bulk.hpp:88
vector< OCP_DBL > lp
Auxiliary variable.
Definition: Bulk.hpp:93
vector< OCP_DBL > lI
Auxiliary variable.
Definition: Bulk.hpp:92
OCP_USI numBulk
Num of Bulk.
Definition: Bulk.hpp:85
OCP_DBL ubC
Volumetric heat capacity of underburden rock.
Definition: Bulk.hpp:82
IsoT_FIM is FIM (Fully Implicit Method).
IsoT_IMPEC is IMPEC (implicit pressure explict saturation) method.
Collect more detailed information of each time step.
Definition: OCPOutput.hpp:211
Initial reservoir infomation for calculating initial equilibration.
Definition: Bulk.hpp:50
Definition: Well.hpp:45