12 #ifndef __WELL_HEADER__
13 #define __WELL_HEADER__
35 const int WELL_SUCCESS = 10;
36 const int WELL_NEGATIVE_PRESSURE = -11;
37 const int WELL_SWITCH_TO_BHPMODE = -12;
38 const int WELL_CROSSFLOW = -13;
50 friend class MyMetisTest;
63 void Setup(
const Grid& gd,
const Bulk& bk,
const vector<SolventINJ>& sols);
94 void InitBHP(
const Bulk& myBulk) { bhp = myBulk.
P[perf[0].location]; }
96 void CalWI_Peaceman(
const Bulk& myBulk);
98 void CalTrans(
const Bulk& myBulk);
100 void CalFlux(
const Bulk& myBulk,
const OCP_BOOL ReCalXi = OCP_FALSE);
107 void CalInjQj(
const Bulk& myBulk,
const OCP_DBL& dt);
110 void CalProdQj(
const Bulk& myBulk,
const OCP_DBL& dt);
112 void CaldG(
const Bulk& myBulk);
114 void CalInjdG(
const Bulk& myBulk);
116 void CalProddG(
const Bulk& myBulk);
118 void CalProddG01(
const Bulk& myBulk);
120 void CalProddG02(
const Bulk& myBulk);
122 void CalProdWeight(
const Bulk& myBulk)
const;
124 void CalReInjFluid(
const Bulk& myBulk, vector<OCP_DBL>& myZi);
128 void CheckOptMode(
const Bulk& myBulk);
136 for (
USI p = 0; p < numPerf; p++) perf[p].P = bhp + dG[p];
139 void ShowPerfStatus(
const Bulk& myBulk)
const;
141 USI PerfNum()
const {
return numPerf; }
142 void SetBHP(
const OCP_DBL& p) { bhp = p; }
143 OCP_DBL BHP()
const {
return bhp; }
144 OCP_DBL DG(
const USI& p)
const {
return dG[p]; }
145 OCP_DBL ProdWeight(
const USI& i)
const {
return prodWeight[i]; }
147 USI OptMode()
const {
return opt.optMode; }
152 vector<OCP_DBL> InjZi()
const
162 OCP_DBL MaxRate()
const {
return opt.maxRate; }
179 OCP_BOOL PerfState(
const USI& p)
const {
return perf[p].state; }
180 USI PerfLocation(
const USI& p)
const {
return perf[p].location; }
181 OCP_DBL PerfWI(
const USI& p)
const {
return perf[p].WI; }
182 OCP_DBL PerfMultiplier(
const USI& p)
const {
return perf[p].multiplier; }
183 OCP_DBL PerfTransInj(
const USI& p)
const {
return perf[p].transINJ; }
184 OCP_DBL PerfXi(
const USI& p)
const {
return perf[p].xi; }
185 OCP_DBL PerfTransj(
const USI& p,
const USI& j)
const {
return perf[p].transj[j]; }
188 return perf[p].qi_lbmol[i];
193 return perf[p].qj_ft3[j];
198 return perf[p].qt_ft3;
200 OCP_DBL Qi_lbmol(
const USI& i)
const {
return qi_lbmol[i]; }
201 OCP_BOOL IfUseUnweight()
const {
return ifUseUnweight; }
240 void AssembleMatReinjection_IMPEC(
const Bulk& myBulk,
243 const vector<Well>& allWell,
244 const vector<USI>& injId)
const;
253 void AssembleMatReinjection_FIM(
const Bulk& myBulk,
256 const vector<Well>& allWell,
257 const vector<USI>& injId)
const;
Operations about small dense mat.
Linear solver class declaration.
Definition of build-in datatypes and consts.
unsigned int USI
Generic unsigned integer.
double OCP_DBL
Double precision.
const USI PROD
Well type = producer.
const OCP_DBL TEMPERATURE_STD
Standard temperature: F.
const USI INJ
Well type = injector.
unsigned int OCP_BOOL
OCP_BOOL in OCP.
const OCP_DBL PRESSURE_STD
14.6959 psia = 1 atm
Some Structure in OpenCAEPoro.
ParamWell class declaration.
#define OCP_ASSERT(cond, msg)
Assert condition and log user messages in DEBUG mode.
WellOpt class declaration.
WellPerf class declaration.
Physical information of each active reservoir bulk.
vector< OCP_DBL > P
Pressure: numBulk.
Linear solvers for discrete systems.
Record the initial grid information, all of grids are contained.
Collect more detailed information of each time step.
USI numPerf
num of perforations belonging to this well.
OCP_DBL numPhase
num of phases
vector< OCP_DBL > prodWeight
maybe only a num is needed
vector< OCP_DBL > prodRate
flow rate of volume of phase outflowing
OCP_DBL depth
reference depth of well.
USI I
I-index of the well header.
WellOpt opt
well control parameters, contains current control parameters.
OCP_DBL numCom
num of components
string group
group well belongs to, it should be moved to opt if necessary!!!
void CalPerfP()
Update pressure in Perforation after well pressure updates.
OCP_DBL bhp
Well pressure in reference depth.
OCP_BOOL IsOpen() const
Return the state of the well, Open or Close.
vector< OCP_DBL > ldG
Last dG.
USI J
J-index of the well header.
vector< Mixture * > flashCal
from bulks's flashCal
void InitBHP(const Bulk &myBulk)
Initialize the Well BHP.
USI WellType() const
Return the type of well, Inj or Prod.
vector< OCP_DBL > qi_lbmol
flow rate of moles of component inflowing/outflowing
vector< OCP_DBL > dG
difference of pressure between well and perforation: numPerf.
vector< Perforation > perf
information of perforation belonging to this well.